objc2_cloud_kit/generated/
CKModifySubscriptionsOperation.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
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckmodifysubscriptionsoperation?language=objc)
12    #[unsafe(super(CKDatabaseOperation, CKOperation, NSOperation, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
15    pub struct CKModifySubscriptionsOperation;
16);
17
18#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
19extern_conformance!(
20    unsafe impl NSObjectProtocol for CKModifySubscriptionsOperation {}
21);
22
23#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
24impl CKModifySubscriptionsOperation {
25    extern_methods!(
26        #[unsafe(method(init))]
27        #[unsafe(method_family = init)]
28        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
29
30        #[cfg(feature = "CKSubscription")]
31        #[unsafe(method(initWithSubscriptionsToSave:subscriptionIDsToDelete:))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn initWithSubscriptionsToSave_subscriptionIDsToDelete(
34            this: Allocated<Self>,
35            subscriptions_to_save: Option<&NSArray<CKSubscription>>,
36            subscription_i_ds_to_delete: Option<&NSArray<CKSubscriptionID>>,
37        ) -> Retained<Self>;
38
39        #[cfg(feature = "CKSubscription")]
40        /// This property is not atomic.
41        ///
42        /// # Safety
43        ///
44        /// This might not be thread-safe.
45        #[unsafe(method(subscriptionsToSave))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn subscriptionsToSave(&self) -> Option<Retained<NSArray<CKSubscription>>>;
48
49        #[cfg(feature = "CKSubscription")]
50        /// Setter for [`subscriptionsToSave`][Self::subscriptionsToSave].
51        ///
52        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
53        ///
54        /// # Safety
55        ///
56        /// This might not be thread-safe.
57        #[unsafe(method(setSubscriptionsToSave:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn setSubscriptionsToSave(
60            &self,
61            subscriptions_to_save: Option<&NSArray<CKSubscription>>,
62        );
63
64        #[cfg(feature = "CKSubscription")]
65        /// This property is not atomic.
66        ///
67        /// # Safety
68        ///
69        /// This might not be thread-safe.
70        #[unsafe(method(subscriptionIDsToDelete))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn subscriptionIDsToDelete(&self)
73            -> Option<Retained<NSArray<CKSubscriptionID>>>;
74
75        #[cfg(feature = "CKSubscription")]
76        /// Setter for [`subscriptionIDsToDelete`][Self::subscriptionIDsToDelete].
77        ///
78        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
79        ///
80        /// # Safety
81        ///
82        /// This might not be thread-safe.
83        #[unsafe(method(setSubscriptionIDsToDelete:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setSubscriptionIDsToDelete(
86            &self,
87            subscription_i_ds_to_delete: Option<&NSArray<CKSubscriptionID>>,
88        );
89
90        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
91        /// Called on success or failure of a subscription save
92        ///
93        ///
94        /// Each
95        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
96        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
97        /// should not be concurrently used outside of blocks assigned to this operation.
98        ///
99        /// This property is not atomic.
100        ///
101        /// # Safety
102        ///
103        /// - The returned block's argument 1 must be a valid pointer.
104        /// - The returned block's argument 2 must be a valid pointer or null.
105        /// - The returned block's argument 3 must be a valid pointer or null.
106        /// - This might not be thread-safe.
107        #[unsafe(method(perSubscriptionSaveBlock))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn perSubscriptionSaveBlock(
110            &self,
111        ) -> *mut block2::DynBlock<
112            dyn Fn(NonNull<CKSubscriptionID>, *mut CKSubscription, *mut NSError),
113        >;
114
115        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
116        /// Setter for [`perSubscriptionSaveBlock`][Self::perSubscriptionSaveBlock].
117        ///
118        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
119        ///
120        /// # Safety
121        ///
122        /// This might not be thread-safe.
123        #[unsafe(method(setPerSubscriptionSaveBlock:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn setPerSubscriptionSaveBlock(
126            &self,
127            per_subscription_save_block: Option<
128                &block2::DynBlock<
129                    dyn Fn(NonNull<CKSubscriptionID>, *mut CKSubscription, *mut NSError),
130                >,
131            >,
132        );
133
134        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
135        /// Called on success or failure of a subscription deletion
136        ///
137        ///
138        /// Each
139        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
140        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
141        /// should not be concurrently used outside of blocks assigned to this operation.
142        ///
143        /// This property is not atomic.
144        ///
145        /// # Safety
146        ///
147        /// - The returned block's argument 1 must be a valid pointer.
148        /// - The returned block's argument 2 must be a valid pointer or null.
149        /// - This might not be thread-safe.
150        #[unsafe(method(perSubscriptionDeleteBlock))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn perSubscriptionDeleteBlock(
153            &self,
154        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKSubscriptionID>, *mut NSError)>;
155
156        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
157        /// Setter for [`perSubscriptionDeleteBlock`][Self::perSubscriptionDeleteBlock].
158        ///
159        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
160        ///
161        /// # Safety
162        ///
163        /// This might not be thread-safe.
164        #[unsafe(method(setPerSubscriptionDeleteBlock:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn setPerSubscriptionDeleteBlock(
167            &self,
168            per_subscription_delete_block: Option<
169                &block2::DynBlock<dyn Fn(NonNull<CKSubscriptionID>, *mut NSError)>,
170            >,
171        );
172
173        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
174        /// This block is called when the operation completes.
175        ///
176        ///
177        /// The
178        ///
179        /// ```text
180        ///  -[NSOperation completionBlock]
181        /// ```
182        ///
183        /// will also be called if both are set.
184        /// If the error is
185        /// `CKErrorPartialFailure,`the error's userInfo dictionary contains a dictionary of subscriptionIDs to errors keyed off of
186        /// `CKPartialErrorsByItemIDKey.``savedSubscriptions,``deletedSubscriptionIDs`and any
187        /// `CKPartialErrorsByItemIDKey`errors are repeats of the data sent back in previous
188        /// `perSubscriptionSaveBlock`and
189        /// `perSubscriptionDeleteBlock`invocations
190        /// Each
191        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
192        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
193        /// should not be concurrently used outside of blocks assigned to this operation.
194        ///
195        /// This property is not atomic.
196        ///
197        /// # Safety
198        ///
199        /// - The returned block's argument 1 must be a valid pointer or null.
200        /// - The returned block's argument 2 must be a valid pointer or null.
201        /// - The returned block's argument 3 must be a valid pointer or null.
202        /// - This might not be thread-safe.
203        #[unsafe(method(modifySubscriptionsCompletionBlock))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn modifySubscriptionsCompletionBlock(
206            &self,
207        ) -> *mut block2::DynBlock<
208            dyn Fn(*mut NSArray<CKSubscription>, *mut NSArray<CKSubscriptionID>, *mut NSError),
209        >;
210
211        #[cfg(all(feature = "CKSubscription", feature = "block2"))]
212        /// Setter for [`modifySubscriptionsCompletionBlock`][Self::modifySubscriptionsCompletionBlock].
213        ///
214        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
215        ///
216        /// # Safety
217        ///
218        /// This might not be thread-safe.
219        #[unsafe(method(setModifySubscriptionsCompletionBlock:))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn setModifySubscriptionsCompletionBlock(
222            &self,
223            modify_subscriptions_completion_block: Option<
224                &block2::DynBlock<
225                    dyn Fn(
226                        *mut NSArray<CKSubscription>,
227                        *mut NSArray<CKSubscriptionID>,
228                        *mut NSError,
229                    ),
230                >,
231            >,
232        );
233    );
234}
235
236/// Methods declared on superclass `NSObject`.
237#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
238impl CKModifySubscriptionsOperation {
239    extern_methods!(
240        #[unsafe(method(new))]
241        #[unsafe(method_family = new)]
242        pub unsafe fn new() -> Retained<Self>;
243    );
244}