objc2_cloud_kit/generated/
CKFetchDatabaseChangesOperation.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    /// This operation will fetch changes to record zones within a database
12    ///
13    ///
14    /// If a change anchor from a previous
15    /// `CKFetchDatabaseChangesOperation`is passed in, only the zones that have changed since that anchor will be returned.
16    /// This per-database
17    /// `serverChangeToken`is not to be confused with the per-recordZone
18    /// `serverChangeToken`from
19    /// `CKFetchRecordZoneChangesOperation.`If this is your first fetch or if you wish to re-fetch all zones, pass nil for the change token.
20    /// Change token are opaque tokens and clients should not infer any behavior based on their content.
21    /// `CKFetchDatabaseChangesOperation`is supported in a
22    /// `privateCloudDatabase`and
23    /// `sharedCloudDatabase`
24    ///
25    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckfetchdatabasechangesoperation?language=objc)
26    #[unsafe(super(CKDatabaseOperation, CKOperation, NSOperation, NSObject))]
27    #[derive(Debug, PartialEq, Eq, Hash)]
28    #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
29    pub struct CKFetchDatabaseChangesOperation;
30);
31
32#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for CKFetchDatabaseChangesOperation {}
35);
36
37#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
38impl CKFetchDatabaseChangesOperation {
39    extern_methods!(
40        #[unsafe(method(init))]
41        #[unsafe(method_family = init)]
42        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
43
44        #[cfg(feature = "CKServerChangeToken")]
45        #[unsafe(method(initWithPreviousServerChangeToken:))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn initWithPreviousServerChangeToken(
48            this: Allocated<Self>,
49            previous_server_change_token: Option<&CKServerChangeToken>,
50        ) -> Retained<Self>;
51
52        #[cfg(feature = "CKServerChangeToken")]
53        /// This property is not atomic.
54        ///
55        /// # Safety
56        ///
57        /// This might not be thread-safe.
58        #[unsafe(method(previousServerChangeToken))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn previousServerChangeToken(&self) -> Option<Retained<CKServerChangeToken>>;
61
62        #[cfg(feature = "CKServerChangeToken")]
63        /// Setter for [`previousServerChangeToken`][Self::previousServerChangeToken].
64        ///
65        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
66        ///
67        /// # Safety
68        ///
69        /// This might not be thread-safe.
70        #[unsafe(method(setPreviousServerChangeToken:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setPreviousServerChangeToken(
73            &self,
74            previous_server_change_token: Option<&CKServerChangeToken>,
75        );
76
77        /// This property is not atomic.
78        ///
79        /// # Safety
80        ///
81        /// This might not be thread-safe.
82        #[unsafe(method(resultsLimit))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn resultsLimit(&self) -> NSUInteger;
85
86        /// Setter for [`resultsLimit`][Self::resultsLimit].
87        ///
88        /// # Safety
89        ///
90        /// This might not be thread-safe.
91        #[unsafe(method(setResultsLimit:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setResultsLimit(&self, results_limit: NSUInteger);
94
95        /// When set to YES, this operation will send repeated requests to the server until all record zone changes have been fetched.
96        ///
97        /// `changeTokenUpdatedBlock`will be invoked periodically, to give clients an updated change token so that already-fetched record zone changes don't need to be re-fetched on a subsequent operation.
98        /// When set to NO, it is the responsibility of the caller to issue subsequent fetch-changes operations when moreComing is YES in a
99        /// `fetchDatabaseChangesCompletionBlock`invocation.
100        /// `fetchAllChanges`is
101        /// `YES`by default
102        /// Each
103        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
104        /// Blocks assigned to this operation may share mutable state with other blocks assigned to this operation, but any such mutable state
105        /// should not be concurrently used outside of blocks assigned to this operation.
106        ///
107        /// This property is not atomic.
108        ///
109        /// # Safety
110        ///
111        /// This might not be thread-safe.
112        #[unsafe(method(fetchAllChanges))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn fetchAllChanges(&self) -> bool;
115
116        /// Setter for [`fetchAllChanges`][Self::fetchAllChanges].
117        ///
118        /// # Safety
119        ///
120        /// This might not be thread-safe.
121        #[unsafe(method(setFetchAllChanges:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn setFetchAllChanges(&self, fetch_all_changes: bool);
124
125        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
126        /// Each
127        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
128        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
129        /// should not be concurrently used outside of blocks assigned to this operation.
130        ///
131        /// This property is not atomic.
132        ///
133        /// # Safety
134        ///
135        /// - The returned block's argument must be a valid pointer.
136        /// - This might not be thread-safe.
137        #[unsafe(method(recordZoneWithIDChangedBlock))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn recordZoneWithIDChangedBlock(
140            &self,
141        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>;
142
143        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
144        /// Setter for [`recordZoneWithIDChangedBlock`][Self::recordZoneWithIDChangedBlock].
145        ///
146        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
147        ///
148        /// # Safety
149        ///
150        /// This might not be thread-safe.
151        #[unsafe(method(setRecordZoneWithIDChangedBlock:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setRecordZoneWithIDChangedBlock(
154            &self,
155            record_zone_with_id_changed_block: Option<
156                &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>,
157            >,
158        );
159
160        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
161        /// Each
162        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
163        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
164        /// should not be concurrently used outside of blocks assigned to this operation.
165        ///
166        /// This property is not atomic.
167        ///
168        /// # Safety
169        ///
170        /// - The returned block's argument must be a valid pointer.
171        /// - This might not be thread-safe.
172        #[unsafe(method(recordZoneWithIDWasDeletedBlock))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn recordZoneWithIDWasDeletedBlock(
175            &self,
176        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>;
177
178        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
179        /// Setter for [`recordZoneWithIDWasDeletedBlock`][Self::recordZoneWithIDWasDeletedBlock].
180        ///
181        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
182        ///
183        /// # Safety
184        ///
185        /// This might not be thread-safe.
186        #[unsafe(method(setRecordZoneWithIDWasDeletedBlock:))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn setRecordZoneWithIDWasDeletedBlock(
189            &self,
190            record_zone_with_id_was_deleted_block: Option<
191                &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>,
192            >,
193        );
194
195        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
196        /// If this block is set it will be called instead of
197        /// `recordZoneWithIDWasDeletedBlock`if the user deleted this zone via the iCloud storage UI.
198        ///
199        ///
200        /// This is an indication that the user wanted all data deleted, so local cached data should be wiped and not re-uploaded to the server.
201        /// Each
202        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
203        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
204        /// should not be concurrently used outside of blocks assigned to this operation.
205        ///
206        /// This property is not atomic.
207        ///
208        /// # Safety
209        ///
210        /// - The returned block's argument must be a valid pointer.
211        /// - This might not be thread-safe.
212        #[unsafe(method(recordZoneWithIDWasPurgedBlock))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn recordZoneWithIDWasPurgedBlock(
215            &self,
216        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>;
217
218        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
219        /// Setter for [`recordZoneWithIDWasPurgedBlock`][Self::recordZoneWithIDWasPurgedBlock].
220        ///
221        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
222        ///
223        /// # Safety
224        ///
225        /// This might not be thread-safe.
226        #[unsafe(method(setRecordZoneWithIDWasPurgedBlock:))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn setRecordZoneWithIDWasPurgedBlock(
229            &self,
230            record_zone_with_id_was_purged_block: Option<
231                &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>,
232            >,
233        );
234
235        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
236        /// If this block is set it will be called instead of
237        /// `recordZoneWithIDWasDeletedBlock`if the user chose to reset all encrypted data for their account.
238        ///
239        ///
240        /// This is an indication that the user had to reset encrypted data during account recovery, so local cached data should be re-uploaded to the server to minimize data loss.
241        /// Each
242        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
243        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
244        /// should not be concurrently used outside of blocks assigned to this operation.
245        ///
246        /// This property is not atomic.
247        ///
248        /// # Safety
249        ///
250        /// - The returned block's argument must be a valid pointer.
251        /// - This might not be thread-safe.
252        #[unsafe(method(recordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock))]
253        #[unsafe(method_family = none)]
254        pub unsafe fn recordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock(
255            &self,
256        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>;
257
258        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
259        /// Setter for [`recordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock`][Self::recordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock].
260        ///
261        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
262        ///
263        /// # Safety
264        ///
265        /// This might not be thread-safe.
266        #[unsafe(method(setRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock:))]
267        #[unsafe(method_family = none)]
268        pub unsafe fn setRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock(
269            &self,
270            record_zone_with_id_was_deleted_due_to_user_encrypted_data_reset_block: Option<
271                &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>,
272            >,
273        );
274
275        #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
276        /// Each
277        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
278        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
279        /// should not be concurrently used outside of blocks assigned to this operation.
280        ///
281        /// This property is not atomic.
282        ///
283        /// # Safety
284        ///
285        /// - The returned block's argument must be a valid pointer.
286        /// - This might not be thread-safe.
287        #[unsafe(method(changeTokenUpdatedBlock))]
288        #[unsafe(method_family = none)]
289        pub unsafe fn changeTokenUpdatedBlock(
290            &self,
291        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKServerChangeToken>)>;
292
293        #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
294        /// Setter for [`changeTokenUpdatedBlock`][Self::changeTokenUpdatedBlock].
295        ///
296        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
297        ///
298        /// # Safety
299        ///
300        /// This might not be thread-safe.
301        #[unsafe(method(setChangeTokenUpdatedBlock:))]
302        #[unsafe(method_family = none)]
303        pub unsafe fn setChangeTokenUpdatedBlock(
304            &self,
305            change_token_updated_block: Option<
306                &block2::DynBlock<dyn Fn(NonNull<CKServerChangeToken>)>,
307            >,
308        );
309
310        #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
311        /// This block is called when the operation completes.
312        ///
313        ///
314        /// Clients are responsible for saving the change token at the end of the operation and passing it in to the next call to
315        /// `CKFetchDatabaseChangesOperation.`If the server returns a
316        /// `CKErrorChangeTokenExpired`error, the
317        /// `previousServerChangeToken`value was too old and the client should toss its local cache and re-fetch the changes in this record zone starting with a nil
318        /// `previousServerChangeToken.`If
319        /// `moreComing`is true then the server wasn't able to return all the changes in this response. Another
320        /// `CKFetchDatabaseChangesOperation`operation should be run with the
321        /// `previousServerChangeToken`token from this operation.
322        /// Each
323        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
324        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
325        /// should not be concurrently used outside of blocks assigned to this operation.
326        ///
327        /// This property is not atomic.
328        ///
329        /// # Safety
330        ///
331        /// - The returned block's argument 1 must be a valid pointer or null.
332        /// - The returned block's argument 3 must be a valid pointer or null.
333        /// - This might not be thread-safe.
334        #[unsafe(method(fetchDatabaseChangesCompletionBlock))]
335        #[unsafe(method_family = none)]
336        pub unsafe fn fetchDatabaseChangesCompletionBlock(
337            &self,
338        ) -> *mut block2::DynBlock<dyn Fn(*mut CKServerChangeToken, Bool, *mut NSError)>;
339
340        #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
341        /// Setter for [`fetchDatabaseChangesCompletionBlock`][Self::fetchDatabaseChangesCompletionBlock].
342        ///
343        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
344        ///
345        /// # Safety
346        ///
347        /// This might not be thread-safe.
348        #[unsafe(method(setFetchDatabaseChangesCompletionBlock:))]
349        #[unsafe(method_family = none)]
350        pub unsafe fn setFetchDatabaseChangesCompletionBlock(
351            &self,
352            fetch_database_changes_completion_block: Option<
353                &block2::DynBlock<dyn Fn(*mut CKServerChangeToken, Bool, *mut NSError)>,
354            >,
355        );
356    );
357}
358
359/// Methods declared on superclass `NSObject`.
360#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
361impl CKFetchDatabaseChangesOperation {
362    extern_methods!(
363        #[unsafe(method(new))]
364        #[unsafe(method_family = new)]
365        pub unsafe fn new() -> Retained<Self>;
366    );
367}