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