objc2_cloud_kit/generated/
CKSubscription.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksubscriptiontype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct CKSubscriptionType(pub NSInteger);
15impl CKSubscriptionType {
16    #[doc(alias = "CKSubscriptionTypeQuery")]
17    pub const Query: Self = Self(1);
18    #[doc(alias = "CKSubscriptionTypeRecordZone")]
19    pub const RecordZone: Self = Self(2);
20    #[doc(alias = "CKSubscriptionTypeDatabase")]
21    pub const Database: Self = Self(3);
22}
23
24unsafe impl Encode for CKSubscriptionType {
25    const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for CKSubscriptionType {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksubscriptionid?language=objc)
33pub type CKSubscriptionID = NSString;
34
35extern_class!(
36    /// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksubscription?language=objc)
37    #[unsafe(super(NSObject))]
38    #[derive(Debug, PartialEq, Eq, Hash)]
39    pub struct CKSubscription;
40);
41
42unsafe impl NSCoding for CKSubscription {}
43
44unsafe impl NSCopying for CKSubscription {}
45
46unsafe impl CopyingHelper for CKSubscription {
47    type Result = Self;
48}
49
50unsafe impl NSObjectProtocol for CKSubscription {}
51
52unsafe impl NSSecureCoding for CKSubscription {}
53
54impl CKSubscription {
55    extern_methods!(
56        #[unsafe(method(init))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
59
60        #[unsafe(method(new))]
61        #[unsafe(method_family = new)]
62        pub unsafe fn new() -> Retained<Self>;
63
64        #[unsafe(method(subscriptionID))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn subscriptionID(&self) -> Retained<CKSubscriptionID>;
67
68        #[unsafe(method(subscriptionType))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn subscriptionType(&self) -> CKSubscriptionType;
71
72        /// Describes the notification that will be sent when the subscription fires.
73        ///
74        ///
75        /// This property must be set to a non-nil value before saving the
76        /// `CKSubscription.`
77        #[unsafe(method(notificationInfo))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn notificationInfo(&self) -> Option<Retained<CKNotificationInfo>>;
80
81        /// Setter for [`notificationInfo`][Self::notificationInfo].
82        #[unsafe(method(setNotificationInfo:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setNotificationInfo(&self, notification_info: Option<&CKNotificationInfo>);
85    );
86}
87
88/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckquerysubscriptionoptions?language=objc)
89// NS_OPTIONS
90#[repr(transparent)]
91#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
92pub struct CKQuerySubscriptionOptions(pub NSUInteger);
93bitflags::bitflags! {
94    impl CKQuerySubscriptionOptions: NSUInteger {
95        #[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordCreation")]
96        const FiresOnRecordCreation = 1<<0;
97        #[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordUpdate")]
98        const FiresOnRecordUpdate = 1<<1;
99        #[doc(alias = "CKQuerySubscriptionOptionsFiresOnRecordDeletion")]
100        const FiresOnRecordDeletion = 1<<2;
101        #[doc(alias = "CKQuerySubscriptionOptionsFiresOnce")]
102        const FiresOnce = 1<<3;
103    }
104}
105
106unsafe impl Encode for CKQuerySubscriptionOptions {
107    const ENCODING: Encoding = NSUInteger::ENCODING;
108}
109
110unsafe impl RefEncode for CKQuerySubscriptionOptions {
111    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
112}
113
114extern_class!(
115    /// A subscription that fires whenever a change matching the predicate occurs.
116    ///
117    ///
118    /// `CKQuerySubscriptions`are not supported in a
119    /// `sharedCloudDatabase`
120    ///
121    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckquerysubscription?language=objc)
122    #[unsafe(super(CKSubscription, NSObject))]
123    #[derive(Debug, PartialEq, Eq, Hash)]
124    pub struct CKQuerySubscription;
125);
126
127unsafe impl NSCoding for CKQuerySubscription {}
128
129unsafe impl NSCopying for CKQuerySubscription {}
130
131unsafe impl CopyingHelper for CKQuerySubscription {
132    type Result = Self;
133}
134
135unsafe impl NSObjectProtocol for CKQuerySubscription {}
136
137unsafe impl NSSecureCoding for CKQuerySubscription {}
138
139impl CKQuerySubscription {
140    extern_methods!(
141        #[cfg(feature = "CKRecord")]
142        #[deprecated]
143        #[unsafe(method(initWithRecordType:predicate:options:))]
144        #[unsafe(method_family = init)]
145        pub unsafe fn initWithRecordType_predicate_options(
146            this: Allocated<Self>,
147            record_type: &CKRecordType,
148            predicate: &NSPredicate,
149            query_subscription_options: CKQuerySubscriptionOptions,
150        ) -> Retained<Self>;
151
152        #[cfg(feature = "CKRecord")]
153        #[unsafe(method(initWithRecordType:predicate:subscriptionID:options:))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn initWithRecordType_predicate_subscriptionID_options(
156            this: Allocated<Self>,
157            record_type: &CKRecordType,
158            predicate: &NSPredicate,
159            subscription_id: &CKSubscriptionID,
160            query_subscription_options: CKQuerySubscriptionOptions,
161        ) -> Retained<Self>;
162
163        #[unsafe(method(initWithCoder:))]
164        #[unsafe(method_family = init)]
165        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
166
167        #[cfg(feature = "CKRecord")]
168        /// The record type that this subscription watches
169        #[unsafe(method(recordType))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn recordType(&self) -> Retained<CKRecordType>;
172
173        /// A predicate that determines when the subscription fires.
174        #[unsafe(method(predicate))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn predicate(&self) -> Retained<NSPredicate>;
177
178        #[cfg(feature = "CKRecordZoneID")]
179        /// Optional property.  If set, a query subscription is scoped to only record changes in the indicated zone.
180        /// Query Subscriptions that do not specify a
181        /// `zoneID`are scoped to record changes across all zones in the database.
182        #[unsafe(method(zoneID))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn zoneID(&self) -> Option<Retained<CKRecordZoneID>>;
185
186        #[cfg(feature = "CKRecordZoneID")]
187        /// Setter for [`zoneID`][Self::zoneID].
188        #[unsafe(method(setZoneID:))]
189        #[unsafe(method_family = none)]
190        pub unsafe fn setZoneID(&self, zone_id: Option<&CKRecordZoneID>);
191
192        /// Options flags describing the firing behavior subscription.
193        ///
194        ///
195        /// One of
196        /// `CKQuerySubscriptionOptionsFiresOnRecordCreation,``CKQuerySubscriptionOptionsFiresOnRecordUpdate,`or
197        /// `CKQuerySubscriptionOptionsFiresOnRecordDeletion`must be specified or an
198        /// `NSInvalidArgumentException`will be thrown.
199        #[unsafe(method(querySubscriptionOptions))]
200        #[unsafe(method_family = none)]
201        pub unsafe fn querySubscriptionOptions(&self) -> CKQuerySubscriptionOptions;
202    );
203}
204
205/// Methods declared on superclass `CKSubscription`.
206impl CKQuerySubscription {
207    extern_methods!(
208        #[unsafe(method(init))]
209        #[unsafe(method_family = init)]
210        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
211
212        #[unsafe(method(new))]
213        #[unsafe(method_family = new)]
214        pub unsafe fn new() -> Retained<Self>;
215    );
216}
217
218extern_class!(
219    /// A subscription that fires whenever any change happens in the indicated Record Zone.
220    ///
221    ///
222    /// The RecordZone must have the capability
223    /// `CKRecordZoneCapabilityFetchChanges``CKRecordZoneSubscriptions`are not supported in a
224    /// `sharedCloudDatabase`
225    ///
226    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckrecordzonesubscription?language=objc)
227    #[unsafe(super(CKSubscription, NSObject))]
228    #[derive(Debug, PartialEq, Eq, Hash)]
229    pub struct CKRecordZoneSubscription;
230);
231
232unsafe impl NSCoding for CKRecordZoneSubscription {}
233
234unsafe impl NSCopying for CKRecordZoneSubscription {}
235
236unsafe impl CopyingHelper for CKRecordZoneSubscription {
237    type Result = Self;
238}
239
240unsafe impl NSObjectProtocol for CKRecordZoneSubscription {}
241
242unsafe impl NSSecureCoding for CKRecordZoneSubscription {}
243
244impl CKRecordZoneSubscription {
245    extern_methods!(
246        #[cfg(feature = "CKRecordZoneID")]
247        #[deprecated]
248        #[unsafe(method(initWithZoneID:))]
249        #[unsafe(method_family = init)]
250        pub unsafe fn initWithZoneID(
251            this: Allocated<Self>,
252            zone_id: &CKRecordZoneID,
253        ) -> Retained<Self>;
254
255        #[cfg(feature = "CKRecordZoneID")]
256        #[unsafe(method(initWithZoneID:subscriptionID:))]
257        #[unsafe(method_family = init)]
258        pub unsafe fn initWithZoneID_subscriptionID(
259            this: Allocated<Self>,
260            zone_id: &CKRecordZoneID,
261            subscription_id: &CKSubscriptionID,
262        ) -> Retained<Self>;
263
264        #[unsafe(method(initWithCoder:))]
265        #[unsafe(method_family = init)]
266        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
267
268        #[cfg(feature = "CKRecordZoneID")]
269        #[unsafe(method(zoneID))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn zoneID(&self) -> Retained<CKRecordZoneID>;
272
273        #[cfg(feature = "CKRecord")]
274        /// Optional property. If set, a zone subscription is scoped to record changes for this record type
275        #[unsafe(method(recordType))]
276        #[unsafe(method_family = none)]
277        pub unsafe fn recordType(&self) -> Option<Retained<CKRecordType>>;
278
279        #[cfg(feature = "CKRecord")]
280        /// Setter for [`recordType`][Self::recordType].
281        #[unsafe(method(setRecordType:))]
282        #[unsafe(method_family = none)]
283        pub unsafe fn setRecordType(&self, record_type: Option<&CKRecordType>);
284    );
285}
286
287/// Methods declared on superclass `CKSubscription`.
288impl CKRecordZoneSubscription {
289    extern_methods!(
290        #[unsafe(method(init))]
291        #[unsafe(method_family = init)]
292        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
293
294        #[unsafe(method(new))]
295        #[unsafe(method_family = new)]
296        pub unsafe fn new() -> Retained<Self>;
297    );
298}
299
300extern_class!(
301    /// A subscription fires whenever any change happens in the database that this subscription was saved in.
302    ///
303    ///
304    /// `CKDatabaseSubscription`is only supported in the Private and Shared databases.
305    ///
306    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckdatabasesubscription?language=objc)
307    #[unsafe(super(CKSubscription, NSObject))]
308    #[derive(Debug, PartialEq, Eq, Hash)]
309    pub struct CKDatabaseSubscription;
310);
311
312unsafe impl NSCoding for CKDatabaseSubscription {}
313
314unsafe impl NSCopying for CKDatabaseSubscription {}
315
316unsafe impl CopyingHelper for CKDatabaseSubscription {
317    type Result = Self;
318}
319
320unsafe impl NSObjectProtocol for CKDatabaseSubscription {}
321
322unsafe impl NSSecureCoding for CKDatabaseSubscription {}
323
324impl CKDatabaseSubscription {
325    extern_methods!(
326        #[deprecated]
327        #[unsafe(method(init))]
328        #[unsafe(method_family = init)]
329        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
330
331        #[unsafe(method(new))]
332        #[unsafe(method_family = new)]
333        pub unsafe fn new() -> Retained<Self>;
334
335        #[unsafe(method(initWithSubscriptionID:))]
336        #[unsafe(method_family = init)]
337        pub unsafe fn initWithSubscriptionID(
338            this: Allocated<Self>,
339            subscription_id: &CKSubscriptionID,
340        ) -> Retained<Self>;
341
342        #[unsafe(method(initWithCoder:))]
343        #[unsafe(method_family = init)]
344        pub unsafe fn initWithCoder(this: Allocated<Self>, a_decoder: &NSCoder) -> Retained<Self>;
345
346        #[cfg(feature = "CKRecord")]
347        /// Optional property. If set, a database subscription is scoped to record changes for this record type
348        #[unsafe(method(recordType))]
349        #[unsafe(method_family = none)]
350        pub unsafe fn recordType(&self) -> Option<Retained<CKRecordType>>;
351
352        #[cfg(feature = "CKRecord")]
353        /// Setter for [`recordType`][Self::recordType].
354        #[unsafe(method(setRecordType:))]
355        #[unsafe(method_family = none)]
356        pub unsafe fn setRecordType(&self, record_type: Option<&CKRecordType>);
357    );
358}
359
360extern_class!(
361    /// The payload of a push notification delivered in the UIApplication
362    /// `application:didReceiveRemoteNotification:`delegate method contains information about the firing subscription.
363    ///
364    /// Use
365    ///
366    /// ```text
367    ///  +[CKNotification notificationFromRemoteNotificationDictionary:]
368    /// ```
369    ///
370    /// to parse that payload.
371    /// On tvOS, alerts, badges, sounds, and categories are not handled in push notifications. However, CKSubscriptions remain available to help you avoid polling the server.
372    ///
373    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cknotificationinfo?language=objc)
374    #[unsafe(super(NSObject))]
375    #[derive(Debug, PartialEq, Eq, Hash)]
376    pub struct CKNotificationInfo;
377);
378
379unsafe impl NSCoding for CKNotificationInfo {}
380
381unsafe impl NSCopying for CKNotificationInfo {}
382
383unsafe impl CopyingHelper for CKNotificationInfo {
384    type Result = Self;
385}
386
387unsafe impl NSObjectProtocol for CKNotificationInfo {}
388
389unsafe impl NSSecureCoding for CKNotificationInfo {}
390
391impl CKNotificationInfo {
392    extern_methods!(
393        /// Optional alert string to display in a push notification.
394        #[unsafe(method(alertBody))]
395        #[unsafe(method_family = none)]
396        pub unsafe fn alertBody(&self) -> Option<Retained<NSString>>;
397
398        /// Setter for [`alertBody`][Self::alertBody].
399        #[unsafe(method(setAlertBody:))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn setAlertBody(&self, alert_body: Option<&NSString>);
402
403        /// Instead of a raw alert string, you may optionally specify a key for a localized string in your app's Localizable.strings file.
404        #[unsafe(method(alertLocalizationKey))]
405        #[unsafe(method_family = none)]
406        pub unsafe fn alertLocalizationKey(&self) -> Option<Retained<NSString>>;
407
408        /// Setter for [`alertLocalizationKey`][Self::alertLocalizationKey].
409        #[unsafe(method(setAlertLocalizationKey:))]
410        #[unsafe(method_family = none)]
411        pub unsafe fn setAlertLocalizationKey(&self, alert_localization_key: Option<&NSString>);
412
413        #[cfg(feature = "CKRecord")]
414        /// A list of field names to take from the matching record that is used as substitution variables in a formatted alert string.
415        #[unsafe(method(alertLocalizationArgs))]
416        #[unsafe(method_family = none)]
417        pub unsafe fn alertLocalizationArgs(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
418
419        #[cfg(feature = "CKRecord")]
420        /// Setter for [`alertLocalizationArgs`][Self::alertLocalizationArgs].
421        #[unsafe(method(setAlertLocalizationArgs:))]
422        #[unsafe(method_family = none)]
423        pub unsafe fn setAlertLocalizationArgs(
424            &self,
425            alert_localization_args: Option<&NSArray<CKRecordFieldKey>>,
426        );
427
428        /// Optional title of the alert to display in a push notification.
429        #[unsafe(method(title))]
430        #[unsafe(method_family = none)]
431        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
432
433        /// Setter for [`title`][Self::title].
434        #[unsafe(method(setTitle:))]
435        #[unsafe(method_family = none)]
436        pub unsafe fn setTitle(&self, title: Option<&NSString>);
437
438        /// Instead of a raw title string, you may optionally specify a key for a localized string in your app's Localizable.strings file.
439        #[unsafe(method(titleLocalizationKey))]
440        #[unsafe(method_family = none)]
441        pub unsafe fn titleLocalizationKey(&self) -> Option<Retained<NSString>>;
442
443        /// Setter for [`titleLocalizationKey`][Self::titleLocalizationKey].
444        #[unsafe(method(setTitleLocalizationKey:))]
445        #[unsafe(method_family = none)]
446        pub unsafe fn setTitleLocalizationKey(&self, title_localization_key: Option<&NSString>);
447
448        #[cfg(feature = "CKRecord")]
449        /// A list of field names to take from the matching record that is used as substitution variables in a formatted title string.
450        #[unsafe(method(titleLocalizationArgs))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn titleLocalizationArgs(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
453
454        #[cfg(feature = "CKRecord")]
455        /// Setter for [`titleLocalizationArgs`][Self::titleLocalizationArgs].
456        #[unsafe(method(setTitleLocalizationArgs:))]
457        #[unsafe(method_family = none)]
458        pub unsafe fn setTitleLocalizationArgs(
459            &self,
460            title_localization_args: Option<&NSArray<CKRecordFieldKey>>,
461        );
462
463        /// Optional subtitle of the alert to display in a push notification.
464        #[unsafe(method(subtitle))]
465        #[unsafe(method_family = none)]
466        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
467
468        /// Setter for [`subtitle`][Self::subtitle].
469        #[unsafe(method(setSubtitle:))]
470        #[unsafe(method_family = none)]
471        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
472
473        /// Instead of a raw subtitle string, you may optionally specify a key for a localized string in your app's Localizable.strings file.
474        #[unsafe(method(subtitleLocalizationKey))]
475        #[unsafe(method_family = none)]
476        pub unsafe fn subtitleLocalizationKey(&self) -> Option<Retained<NSString>>;
477
478        /// Setter for [`subtitleLocalizationKey`][Self::subtitleLocalizationKey].
479        #[unsafe(method(setSubtitleLocalizationKey:))]
480        #[unsafe(method_family = none)]
481        pub unsafe fn setSubtitleLocalizationKey(
482            &self,
483            subtitle_localization_key: Option<&NSString>,
484        );
485
486        #[cfg(feature = "CKRecord")]
487        /// A list of field names to take from the matching record that is used as substitution variables in a formatted subtitle string.
488        #[unsafe(method(subtitleLocalizationArgs))]
489        #[unsafe(method_family = none)]
490        pub unsafe fn subtitleLocalizationArgs(
491            &self,
492        ) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
493
494        #[cfg(feature = "CKRecord")]
495        /// Setter for [`subtitleLocalizationArgs`][Self::subtitleLocalizationArgs].
496        #[unsafe(method(setSubtitleLocalizationArgs:))]
497        #[unsafe(method_family = none)]
498        pub unsafe fn setSubtitleLocalizationArgs(
499            &self,
500            subtitle_localization_args: Option<&NSArray<CKRecordFieldKey>>,
501        );
502
503        /// A key for a localized string to be used as the alert action in a modal style notification.
504        #[unsafe(method(alertActionLocalizationKey))]
505        #[unsafe(method_family = none)]
506        pub unsafe fn alertActionLocalizationKey(&self) -> Option<Retained<NSString>>;
507
508        /// Setter for [`alertActionLocalizationKey`][Self::alertActionLocalizationKey].
509        #[unsafe(method(setAlertActionLocalizationKey:))]
510        #[unsafe(method_family = none)]
511        pub unsafe fn setAlertActionLocalizationKey(
512            &self,
513            alert_action_localization_key: Option<&NSString>,
514        );
515
516        /// The name of an image in your app bundle to be used as the launch image when launching in response to the notification.
517        #[unsafe(method(alertLaunchImage))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn alertLaunchImage(&self) -> Option<Retained<NSString>>;
520
521        /// Setter for [`alertLaunchImage`][Self::alertLaunchImage].
522        #[unsafe(method(setAlertLaunchImage:))]
523        #[unsafe(method_family = none)]
524        pub unsafe fn setAlertLaunchImage(&self, alert_launch_image: Option<&NSString>);
525
526        /// The name of a sound file in your app bundle to play upon receiving the notification.
527        #[unsafe(method(soundName))]
528        #[unsafe(method_family = none)]
529        pub unsafe fn soundName(&self) -> Option<Retained<NSString>>;
530
531        /// Setter for [`soundName`][Self::soundName].
532        #[unsafe(method(setSoundName:))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn setSoundName(&self, sound_name: Option<&NSString>);
535
536        #[cfg(feature = "CKRecord")]
537        /// A list of keys from the matching record to include in the notification payload.
538        ///
539        ///
540        /// Only some keys are allowed.  The value types associated with those keys on the server must be one of these classes:
541        /// - CKReference
542        /// - CLLocation
543        /// - NSDate
544        /// - NSNumber
545        /// - NSString
546        #[unsafe(method(desiredKeys))]
547        #[unsafe(method_family = none)]
548        pub unsafe fn desiredKeys(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
549
550        #[cfg(feature = "CKRecord")]
551        /// Setter for [`desiredKeys`][Self::desiredKeys].
552        #[unsafe(method(setDesiredKeys:))]
553        #[unsafe(method_family = none)]
554        pub unsafe fn setDesiredKeys(&self, desired_keys: Option<&NSArray<CKRecordFieldKey>>);
555
556        /// Indicates that the notification should increment the app's badge count. Default value is
557        /// `NO.`
558        #[unsafe(method(shouldBadge))]
559        #[unsafe(method_family = none)]
560        pub unsafe fn shouldBadge(&self) -> bool;
561
562        /// Setter for [`shouldBadge`][Self::shouldBadge].
563        #[unsafe(method(setShouldBadge:))]
564        #[unsafe(method_family = none)]
565        pub unsafe fn setShouldBadge(&self, should_badge: bool);
566
567        /// Indicates that the notification should be sent with the "content-available" flag to allow for background downloads in the application.
568        ///
569        ///
570        /// Default value is
571        /// `NO.`
572        #[unsafe(method(shouldSendContentAvailable))]
573        #[unsafe(method_family = none)]
574        pub unsafe fn shouldSendContentAvailable(&self) -> bool;
575
576        /// Setter for [`shouldSendContentAvailable`][Self::shouldSendContentAvailable].
577        #[unsafe(method(setShouldSendContentAvailable:))]
578        #[unsafe(method_family = none)]
579        pub unsafe fn setShouldSendContentAvailable(&self, should_send_content_available: bool);
580
581        /// Indicates that the notification should be sent with the "mutable-content" flag to allow a Notification Service app extension to modify or replace the push payload.
582        ///
583        ///
584        /// Default value is
585        /// `NO.`
586        #[unsafe(method(shouldSendMutableContent))]
587        #[unsafe(method_family = none)]
588        pub unsafe fn shouldSendMutableContent(&self) -> bool;
589
590        /// Setter for [`shouldSendMutableContent`][Self::shouldSendMutableContent].
591        #[unsafe(method(setShouldSendMutableContent:))]
592        #[unsafe(method_family = none)]
593        pub unsafe fn setShouldSendMutableContent(&self, should_send_mutable_content: bool);
594
595        /// Optional property for the category to be sent with the push when this subscription fires.
596        ///
597        ///
598        /// Categories allow you to present custom actions to the user on your push notifications.
599        ///
600        ///
601        /// See: UIMutableUserNotificationCategory
602        #[unsafe(method(category))]
603        #[unsafe(method_family = none)]
604        pub unsafe fn category(&self) -> Option<Retained<NSString>>;
605
606        /// Setter for [`category`][Self::category].
607        #[unsafe(method(setCategory:))]
608        #[unsafe(method_family = none)]
609        pub unsafe fn setCategory(&self, category: Option<&NSString>);
610
611        /// Optional property specifying a field name to take from the matching record whose value is used as the apns-collapse-id header.
612        ///
613        ///
614        /// See: APNs Notification API documentation
615        #[unsafe(method(collapseIDKey))]
616        #[unsafe(method_family = none)]
617        pub unsafe fn collapseIDKey(&self) -> Option<Retained<NSString>>;
618
619        /// Setter for [`collapseIDKey`][Self::collapseIDKey].
620        #[unsafe(method(setCollapseIDKey:))]
621        #[unsafe(method_family = none)]
622        pub unsafe fn setCollapseIDKey(&self, collapse_id_key: Option<&NSString>);
623    );
624}
625
626/// Methods declared on superclass `NSObject`.
627impl CKNotificationInfo {
628    extern_methods!(
629        #[unsafe(method(init))]
630        #[unsafe(method_family = init)]
631        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
632
633        #[unsafe(method(new))]
634        #[unsafe(method_family = new)]
635        pub unsafe fn new() -> Retained<Self>;
636    );
637}