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        #[deprecated]
55        #[unsafe(method(recordZoneID))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn recordZoneID(&self) -> Option<Retained<CKRecordZoneID>>;
58
59        #[cfg(feature = "CKRecordZoneID")]
60        /// Setter for [`recordZoneID`][Self::recordZoneID].
61        #[deprecated]
62        #[unsafe(method(setRecordZoneID:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setRecordZoneID(&self, record_zone_id: Option<&CKRecordZoneID>);
65
66        #[cfg(feature = "CKServerChangeToken")]
67        #[deprecated]
68        #[unsafe(method(previousServerChangeToken))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn previousServerChangeToken(&self) -> Option<Retained<CKServerChangeToken>>;
71
72        #[cfg(feature = "CKServerChangeToken")]
73        /// Setter for [`previousServerChangeToken`][Self::previousServerChangeToken].
74        #[deprecated]
75        #[unsafe(method(setPreviousServerChangeToken:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn setPreviousServerChangeToken(
78            &self,
79            previous_server_change_token: Option<&CKServerChangeToken>,
80        );
81
82        #[deprecated]
83        #[unsafe(method(resultsLimit))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn resultsLimit(&self) -> NSUInteger;
86
87        /// Setter for [`resultsLimit`][Self::resultsLimit].
88        #[deprecated]
89        #[unsafe(method(setResultsLimit:))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn setResultsLimit(&self, results_limit: NSUInteger);
92
93        #[cfg(feature = "CKRecord")]
94        /// Declares which user-defined keys should be fetched and added to the resulting CKRecords.
95        ///
96        ///
97        /// If nil, declares the entire record should be downloaded. If set to an empty array, declares that no user fields should be downloaded.
98        /// Defaults to
99        /// `nil.`
100        #[deprecated]
101        #[unsafe(method(desiredKeys))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn desiredKeys(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
104
105        #[cfg(feature = "CKRecord")]
106        /// Setter for [`desiredKeys`][Self::desiredKeys].
107        #[deprecated]
108        #[unsafe(method(setDesiredKeys:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setDesiredKeys(&self, desired_keys: Option<&NSArray<CKRecordFieldKey>>);
111
112        #[cfg(all(feature = "CKRecord", feature = "block2"))]
113        /// Each
114        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
115        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
116        /// should not be concurrently used outside of blocks assigned to this operation.
117        #[deprecated]
118        #[unsafe(method(recordChangedBlock))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn recordChangedBlock(&self)
121            -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecord>)>;
122
123        #[cfg(all(feature = "CKRecord", feature = "block2"))]
124        /// Setter for [`recordChangedBlock`][Self::recordChangedBlock].
125        #[deprecated]
126        #[unsafe(method(setRecordChangedBlock:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setRecordChangedBlock(
129            &self,
130            record_changed_block: Option<&block2::DynBlock<dyn Fn(NonNull<CKRecord>)>>,
131        );
132
133        #[cfg(all(feature = "CKRecordID", feature = "block2"))]
134        /// Each
135        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
136        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
137        /// should not be concurrently used outside of blocks assigned to this operation.
138        #[deprecated]
139        #[unsafe(method(recordWithIDWasDeletedBlock))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn recordWithIDWasDeletedBlock(
142            &self,
143        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordID>)>;
144
145        #[cfg(all(feature = "CKRecordID", feature = "block2"))]
146        /// Setter for [`recordWithIDWasDeletedBlock`][Self::recordWithIDWasDeletedBlock].
147        #[deprecated]
148        #[unsafe(method(setRecordWithIDWasDeletedBlock:))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn setRecordWithIDWasDeletedBlock(
151            &self,
152            record_with_id_was_deleted_block: Option<
153                &block2::DynBlock<dyn Fn(NonNull<CKRecordID>)>,
154            >,
155        );
156
157        /// If true, then the server wasn't able to return all the changes in this response.
158        ///
159        ///
160        /// Will be set before fetchRecordChangesCompletionBlock is called.
161        /// Another CKFetchRecordChangesOperation operation should be run with the updated serverChangeToken token from this operation.
162        #[deprecated]
163        #[unsafe(method(moreComing))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn moreComing(&self) -> bool;
166
167        #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
168        /// This block is called when the operation completes.
169        ///
170        ///
171        /// Clients are responsible for saving the change token at the end of the operation and passing it in to the next call to
172        /// `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.
173        /// The
174        /// `clientChangeTokenData`from the most recent
175        /// `CKModifyRecordsOperation`is also returned, or nil if none was provided.
176        /// If the server returns a
177        /// `CKErrorChangeTokenExpired`error, the
178        /// `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
179        /// `previousServerChangeToken.`Each
180        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
181        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
182        /// should not be concurrently used outside of blocks assigned to this operation.
183        #[deprecated]
184        #[unsafe(method(fetchRecordChangesCompletionBlock))]
185        #[unsafe(method_family = none)]
186        pub unsafe fn fetchRecordChangesCompletionBlock(
187            &self,
188        ) -> *mut block2::DynBlock<dyn Fn(*mut CKServerChangeToken, *mut NSData, *mut NSError)>;
189
190        #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
191        /// Setter for [`fetchRecordChangesCompletionBlock`][Self::fetchRecordChangesCompletionBlock].
192        #[deprecated]
193        #[unsafe(method(setFetchRecordChangesCompletionBlock:))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn setFetchRecordChangesCompletionBlock(
196            &self,
197            fetch_record_changes_completion_block: Option<
198                &block2::DynBlock<dyn Fn(*mut CKServerChangeToken, *mut NSData, *mut NSError)>,
199            >,
200        );
201    );
202}
203
204/// Methods declared on superclass `NSObject`.
205#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
206impl CKFetchRecordChangesOperation {
207    extern_methods!(
208        #[unsafe(method(new))]
209        #[unsafe(method_family = new)]
210        pub unsafe fn new() -> Retained<Self>;
211    );
212}