objc2_cloud_kit/generated/
CKModifyRecordZonesOperation.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/ckmodifyrecordzonesoperation?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 CKModifyRecordZonesOperation;
16);
17
18#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
19extern_conformance!(
20    unsafe impl NSObjectProtocol for CKModifyRecordZonesOperation {}
21);
22
23#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
24impl CKModifyRecordZonesOperation {
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(all(feature = "CKRecordZone", feature = "CKRecordZoneID"))]
31        #[unsafe(method(initWithRecordZonesToSave:recordZoneIDsToDelete:))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn initWithRecordZonesToSave_recordZoneIDsToDelete(
34            this: Allocated<Self>,
35            record_zones_to_save: Option<&NSArray<CKRecordZone>>,
36            record_zone_i_ds_to_delete: Option<&NSArray<CKRecordZoneID>>,
37        ) -> Retained<Self>;
38
39        #[cfg(feature = "CKRecordZone")]
40        /// This property is not atomic.
41        ///
42        /// # Safety
43        ///
44        /// This might not be thread-safe.
45        #[unsafe(method(recordZonesToSave))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn recordZonesToSave(&self) -> Option<Retained<NSArray<CKRecordZone>>>;
48
49        #[cfg(feature = "CKRecordZone")]
50        /// Setter for [`recordZonesToSave`][Self::recordZonesToSave].
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(setRecordZonesToSave:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn setRecordZonesToSave(
60            &self,
61            record_zones_to_save: Option<&NSArray<CKRecordZone>>,
62        );
63
64        #[cfg(feature = "CKRecordZoneID")]
65        /// This property is not atomic.
66        ///
67        /// # Safety
68        ///
69        /// This might not be thread-safe.
70        #[unsafe(method(recordZoneIDsToDelete))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn recordZoneIDsToDelete(&self) -> Option<Retained<NSArray<CKRecordZoneID>>>;
73
74        #[cfg(feature = "CKRecordZoneID")]
75        /// Setter for [`recordZoneIDsToDelete`][Self::recordZoneIDsToDelete].
76        ///
77        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
78        ///
79        /// # Safety
80        ///
81        /// This might not be thread-safe.
82        #[unsafe(method(setRecordZoneIDsToDelete:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setRecordZoneIDsToDelete(
85            &self,
86            record_zone_i_ds_to_delete: Option<&NSArray<CKRecordZoneID>>,
87        );
88
89        #[cfg(all(
90            feature = "CKRecordZone",
91            feature = "CKRecordZoneID",
92            feature = "block2"
93        ))]
94        /// Called on success or failure of a record zone save
95        ///
96        ///
97        /// Each
98        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
99        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
100        /// should not be concurrently used outside of blocks assigned to this operation.
101        ///
102        /// This property is not atomic.
103        ///
104        /// # Safety
105        ///
106        /// - The returned block's argument 1 must be a valid pointer.
107        /// - The returned block's argument 2 must be a valid pointer or null.
108        /// - The returned block's argument 3 must be a valid pointer or null.
109        /// - This might not be thread-safe.
110        #[unsafe(method(perRecordZoneSaveBlock))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn perRecordZoneSaveBlock(
113            &self,
114        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>, *mut CKRecordZone, *mut NSError)>;
115
116        #[cfg(all(
117            feature = "CKRecordZone",
118            feature = "CKRecordZoneID",
119            feature = "block2"
120        ))]
121        /// Setter for [`perRecordZoneSaveBlock`][Self::perRecordZoneSaveBlock].
122        ///
123        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
124        ///
125        /// # Safety
126        ///
127        /// This might not be thread-safe.
128        #[unsafe(method(setPerRecordZoneSaveBlock:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn setPerRecordZoneSaveBlock(
131            &self,
132            per_record_zone_save_block: Option<
133                &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>, *mut CKRecordZone, *mut NSError)>,
134            >,
135        );
136
137        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
138        /// Called on success or failure of a record zone deletion
139        ///
140        ///
141        /// Each
142        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
143        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
144        /// should not be concurrently used outside of blocks assigned to this operation.
145        ///
146        /// This property is not atomic.
147        ///
148        /// # Safety
149        ///
150        /// - The returned block's argument 1 must be a valid pointer.
151        /// - The returned block's argument 2 must be a valid pointer or null.
152        /// - This might not be thread-safe.
153        #[unsafe(method(perRecordZoneDeleteBlock))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn perRecordZoneDeleteBlock(
156            &self,
157        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>, *mut NSError)>;
158
159        #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
160        /// Setter for [`perRecordZoneDeleteBlock`][Self::perRecordZoneDeleteBlock].
161        ///
162        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
163        ///
164        /// # Safety
165        ///
166        /// This might not be thread-safe.
167        #[unsafe(method(setPerRecordZoneDeleteBlock:))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn setPerRecordZoneDeleteBlock(
170            &self,
171            per_record_zone_delete_block: Option<
172                &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>, *mut NSError)>,
173            >,
174        );
175
176        #[cfg(all(
177            feature = "CKRecordZone",
178            feature = "CKRecordZoneID",
179            feature = "block2"
180        ))]
181        /// This block is called when the operation completes.
182        ///
183        ///
184        /// The
185        ///
186        /// ```text
187        ///  -[NSOperation completionBlock]
188        /// ```
189        ///
190        /// will also be called if both are set.
191        /// If the error is
192        /// `CKErrorPartialFailure,`the error's userInfo dictionary contains a dictionary of recordZoneIDs to errors keyed off of
193        /// `CKPartialErrorsByItemIDKey.``savedRecordZones,``deletedRecordZoneIDs`and any
194        /// `CKPartialErrorsByItemIDKey`errors are repeats of the data sent back in previous
195        /// `perRecordZoneSaveBlock`and
196        /// `perRecordZoneDeleteBlock`invocations
197        /// Each
198        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
199        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
200        /// should not be concurrently used outside of blocks assigned to this operation.
201        ///
202        /// This property is not atomic.
203        ///
204        /// # Safety
205        ///
206        /// - The returned block's argument 1 must be a valid pointer or null.
207        /// - The returned block's argument 2 must be a valid pointer or null.
208        /// - The returned block's argument 3 must be a valid pointer or null.
209        /// - This might not be thread-safe.
210        #[unsafe(method(modifyRecordZonesCompletionBlock))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn modifyRecordZonesCompletionBlock(
213            &self,
214        ) -> *mut block2::DynBlock<
215            dyn Fn(*mut NSArray<CKRecordZone>, *mut NSArray<CKRecordZoneID>, *mut NSError),
216        >;
217
218        #[cfg(all(
219            feature = "CKRecordZone",
220            feature = "CKRecordZoneID",
221            feature = "block2"
222        ))]
223        /// Setter for [`modifyRecordZonesCompletionBlock`][Self::modifyRecordZonesCompletionBlock].
224        ///
225        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
226        ///
227        /// # Safety
228        ///
229        /// This might not be thread-safe.
230        #[unsafe(method(setModifyRecordZonesCompletionBlock:))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn setModifyRecordZonesCompletionBlock(
233            &self,
234            modify_record_zones_completion_block: Option<
235                &block2::DynBlock<
236                    dyn Fn(*mut NSArray<CKRecordZone>, *mut NSArray<CKRecordZoneID>, *mut NSError),
237                >,
238            >,
239        );
240    );
241}
242
243/// Methods declared on superclass `NSObject`.
244#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
245impl CKModifyRecordZonesOperation {
246    extern_methods!(
247        #[unsafe(method(new))]
248        #[unsafe(method_family = new)]
249        pub unsafe fn new() -> Retained<Self>;
250    );
251}