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