objc2_cloud_kit/generated/
CKFetchRecordChangesOperation.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    /// Use CKFetchRecordZoneChangesOperation instead of this class.
12    ///
13    /// Any serverChangeTokens saved from a CKFetchRecordChangesOperation are usable as a serverRecordZoneChangeToken in CKFetchRecordZoneChangesOperation
14    ///
15    /// This operation will fetch records changes in the given record zone.
16    ///
17    /// If a change token from a previous
18    /// `CKFetchRecordChangesOperation`is passed in, only the records that have changed since that token will be fetched.
19    /// If this is your first fetch or if you wish to re-fetch all records, pass nil for the change token.
20    /// Change tokens are opaque tokens and clients should not infer any behavior based on their content
21    ///
22    /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckfetchrecordchangesoperation?language=objc)
23    #[unsafe(super(CKDatabaseOperation, CKOperation, NSOperation, NSObject))]
24    #[derive(Debug, PartialEq, Eq, Hash)]
25    #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
26    #[deprecated]
27    pub struct CKFetchRecordChangesOperation;
28);
29
30#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
31extern_conformance!(
32    unsafe impl NSObjectProtocol for CKFetchRecordChangesOperation {}
33);
34
35#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
36impl CKFetchRecordChangesOperation {
37    extern_methods!(
38        #[deprecated]
39        #[unsafe(method(init))]
40        #[unsafe(method_family = init)]
41        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
42
43        #[cfg(all(feature = "CKRecordZoneID", feature = "CKServerChangeToken"))]
44        #[deprecated]
45        #[unsafe(method(initWithRecordZoneID:previousServerChangeToken:))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn initWithRecordZoneID_previousServerChangeToken(
48            this: Allocated<Self>,
49            record_zone_id: &CKRecordZoneID,
50            previous_server_change_token: Option<&CKServerChangeToken>,
51        ) -> Retained<Self>;
52
53        #[cfg(feature = "CKRecordZoneID")]
54        /// This property is not atomic.
55        ///
56        /// # Safety
57        ///
58        /// This might not be thread-safe.
59        #[deprecated]
60        #[unsafe(method(recordZoneID))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn recordZoneID(&self) -> Option<Retained<CKRecordZoneID>>;
63
64        #[cfg(feature = "CKRecordZoneID")]
65        /// Setter for [`recordZoneID`][Self::recordZoneID].
66        ///
67        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
68        ///
69        /// # Safety
70        ///
71        /// This might not be thread-safe.
72        #[deprecated]
73        #[unsafe(method(setRecordZoneID:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn setRecordZoneID(&self, record_zone_id: Option<&CKRecordZoneID>);
76
77        #[cfg(feature = "CKServerChangeToken")]
78        /// This property is not atomic.
79        ///
80        /// # Safety
81        ///
82        /// This might not be thread-safe.
83        #[deprecated]
84        #[unsafe(method(previousServerChangeToken))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn previousServerChangeToken(&self) -> Option<Retained<CKServerChangeToken>>;
87
88        #[cfg(feature = "CKServerChangeToken")]
89        /// Setter for [`previousServerChangeToken`][Self::previousServerChangeToken].
90        ///
91        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
92        ///
93        /// # Safety
94        ///
95        /// This might not be thread-safe.
96        #[deprecated]
97        #[unsafe(method(setPreviousServerChangeToken:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn setPreviousServerChangeToken(
100            &self,
101            previous_server_change_token: Option<&CKServerChangeToken>,
102        );
103
104        /// This property is not atomic.
105        ///
106        /// # Safety
107        ///
108        /// This might not be thread-safe.
109        #[deprecated]
110        #[unsafe(method(resultsLimit))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn resultsLimit(&self) -> NSUInteger;
113
114        /// Setter for [`resultsLimit`][Self::resultsLimit].
115        ///
116        /// # Safety
117        ///
118        /// This might not be thread-safe.
119        #[deprecated]
120        #[unsafe(method(setResultsLimit:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn setResultsLimit(&self, results_limit: NSUInteger);
123
124        #[cfg(feature = "CKRecord")]
125        /// Declares which user-defined keys should be fetched and added to the resulting CKRecords.
126        ///
127        ///
128        /// If nil, declares the entire record should be downloaded. If set to an empty array, declares that no user fields should be downloaded.
129        /// Defaults to
130        /// `nil.`
131        ///
132        /// This property is not atomic.
133        ///
134        /// # Safety
135        ///
136        /// This might not be thread-safe.
137        #[deprecated]
138        #[unsafe(method(desiredKeys))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn desiredKeys(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
141
142        #[cfg(feature = "CKRecord")]
143        /// Setter for [`desiredKeys`][Self::desiredKeys].
144        ///
145        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
146        ///
147        /// # Safety
148        ///
149        /// This might not be thread-safe.
150        #[deprecated]
151        #[unsafe(method(setDesiredKeys:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setDesiredKeys(&self, desired_keys: Option<&NSArray<CKRecordFieldKey>>);
154
155        #[cfg(all(feature = "CKRecord", feature = "block2"))]
156        /// Each
157        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
158        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
159        /// should not be concurrently used outside of blocks assigned to this operation.
160        ///
161        /// This property is not atomic.
162        ///
163        /// # Safety
164        ///
165        /// - The returned block's argument must be a valid pointer.
166        /// - This might not be thread-safe.
167        #[deprecated]
168        #[unsafe(method(recordChangedBlock))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn recordChangedBlock(&self)
171            -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecord>)>;
172
173        #[cfg(all(feature = "CKRecord", feature = "block2"))]
174        /// Setter for [`recordChangedBlock`][Self::recordChangedBlock].
175        ///
176        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
177        ///
178        /// # Safety
179        ///
180        /// This might not be thread-safe.
181        #[deprecated]
182        #[unsafe(method(setRecordChangedBlock:))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn setRecordChangedBlock(
185            &self,
186            record_changed_block: Option<&block2::DynBlock<dyn Fn(NonNull<CKRecord>)>>,
187        );
188
189        #[cfg(all(feature = "CKRecordID", feature = "block2"))]
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 must be a valid pointer.
200        /// - This might not be thread-safe.
201        #[deprecated]
202        #[unsafe(method(recordWithIDWasDeletedBlock))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn recordWithIDWasDeletedBlock(
205            &self,
206        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordID>)>;
207
208        #[cfg(all(feature = "CKRecordID", feature = "block2"))]
209        /// Setter for [`recordWithIDWasDeletedBlock`][Self::recordWithIDWasDeletedBlock].
210        ///
211        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
212        ///
213        /// # Safety
214        ///
215        /// This might not be thread-safe.
216        #[deprecated]
217        #[unsafe(method(setRecordWithIDWasDeletedBlock:))]
218        #[unsafe(method_family = none)]
219        pub unsafe fn setRecordWithIDWasDeletedBlock(
220            &self,
221            record_with_id_was_deleted_block: Option<
222                &block2::DynBlock<dyn Fn(NonNull<CKRecordID>)>,
223            >,
224        );
225
226        /// If true, then the server wasn't able to return all the changes in this response.
227        ///
228        ///
229        /// Will be set before fetchRecordChangesCompletionBlock is called.
230        /// Another CKFetchRecordChangesOperation operation should be run with the updated serverChangeToken token from this operation.
231        ///
232        /// This property is not atomic.
233        ///
234        /// # Safety
235        ///
236        /// This might not be thread-safe.
237        #[deprecated]
238        #[unsafe(method(moreComing))]
239        #[unsafe(method_family = none)]
240        pub unsafe fn moreComing(&self) -> bool;
241
242        #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
243        /// This block is called when the operation completes.
244        ///
245        ///
246        /// Clients are responsible for saving the change token at the end of the operation and passing it in to the next call to
247        /// `CKFetchRecordChangesOperation.`Note that a fetch can fail partway. If that happens, an updated change token may be returned in the completion block so that already fetched records don't need to be re-downloaded on a subsequent operation.
248        /// The
249        /// `clientChangeTokenData`from the most recent
250        /// `CKModifyRecordsOperation`is also returned, or nil if none was provided.
251        /// If the server returns a
252        /// `CKErrorChangeTokenExpired`error, the
253        /// `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
254        /// `previousServerChangeToken.`Each
255        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
256        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
257        /// should not be concurrently used outside of blocks assigned to this operation.
258        ///
259        /// This property is not atomic.
260        ///
261        /// # Safety
262        ///
263        /// - The returned block's argument 1 must be a valid pointer or null.
264        /// - The returned block's argument 2 must be a valid pointer or null.
265        /// - The returned block's argument 3 must be a valid pointer or null.
266        /// - This might not be thread-safe.
267        #[deprecated]
268        #[unsafe(method(fetchRecordChangesCompletionBlock))]
269        #[unsafe(method_family = none)]
270        pub unsafe fn fetchRecordChangesCompletionBlock(
271            &self,
272        ) -> *mut block2::DynBlock<dyn Fn(*mut CKServerChangeToken, *mut NSData, *mut NSError)>;
273
274        #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
275        /// Setter for [`fetchRecordChangesCompletionBlock`][Self::fetchRecordChangesCompletionBlock].
276        ///
277        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
278        ///
279        /// # Safety
280        ///
281        /// This might not be thread-safe.
282        #[deprecated]
283        #[unsafe(method(setFetchRecordChangesCompletionBlock:))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn setFetchRecordChangesCompletionBlock(
286            &self,
287            fetch_record_changes_completion_block: Option<
288                &block2::DynBlock<dyn Fn(*mut CKServerChangeToken, *mut NSData, *mut NSError)>,
289            >,
290        );
291    );
292}
293
294/// Methods declared on superclass `NSObject`.
295#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
296impl CKFetchRecordChangesOperation {
297    extern_methods!(
298        #[unsafe(method(new))]
299        #[unsafe(method_family = new)]
300        pub unsafe fn new() -> Retained<Self>;
301    );
302}