objc2_cloud_kit/generated/CKFetchRecordZonesOperation.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/ckfetchrecordzonesoperation?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 CKFetchRecordZonesOperation;
16);
17
18#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
19extern_conformance!(
20 unsafe impl NSObjectProtocol for CKFetchRecordZonesOperation {}
21);
22
23#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
24impl CKFetchRecordZonesOperation {
25 extern_methods!(
26 #[unsafe(method(fetchAllRecordZonesOperation))]
27 #[unsafe(method_family = none)]
28 pub unsafe fn fetchAllRecordZonesOperation() -> Retained<Self>;
29
30 #[unsafe(method(init))]
31 #[unsafe(method_family = init)]
32 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34 #[cfg(feature = "CKRecordZoneID")]
35 #[unsafe(method(initWithRecordZoneIDs:))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn initWithRecordZoneIDs(
38 this: Allocated<Self>,
39 zone_i_ds: &NSArray<CKRecordZoneID>,
40 ) -> Retained<Self>;
41
42 #[cfg(feature = "CKRecordZoneID")]
43 /// This property is not atomic.
44 ///
45 /// # Safety
46 ///
47 /// This might not be thread-safe.
48 #[unsafe(method(recordZoneIDs))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn recordZoneIDs(&self) -> Option<Retained<NSArray<CKRecordZoneID>>>;
51
52 #[cfg(feature = "CKRecordZoneID")]
53 /// Setter for [`recordZoneIDs`][Self::recordZoneIDs].
54 ///
55 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
56 ///
57 /// # Safety
58 ///
59 /// This might not be thread-safe.
60 #[unsafe(method(setRecordZoneIDs:))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn setRecordZoneIDs(&self, record_zone_i_ds: Option<&NSArray<CKRecordZoneID>>);
63
64 #[cfg(all(
65 feature = "CKRecordZone",
66 feature = "CKRecordZoneID",
67 feature = "block2"
68 ))]
69 /// Called on success or failure for each record zone.
70 ///
71 ///
72 /// Each
73 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
74 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
75 /// should not be concurrently used outside of blocks assigned to this operation.
76 ///
77 /// This property is not atomic.
78 ///
79 /// # Safety
80 ///
81 /// - The returned block's argument 1 must be a valid pointer.
82 /// - The returned block's argument 2 must be a valid pointer or null.
83 /// - The returned block's argument 3 must be a valid pointer or null.
84 /// - This might not be thread-safe.
85 #[unsafe(method(perRecordZoneCompletionBlock))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn perRecordZoneCompletionBlock(
88 &self,
89 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>, *mut CKRecordZone, *mut NSError)>;
90
91 #[cfg(all(
92 feature = "CKRecordZone",
93 feature = "CKRecordZoneID",
94 feature = "block2"
95 ))]
96 /// Setter for [`perRecordZoneCompletionBlock`][Self::perRecordZoneCompletionBlock].
97 ///
98 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
99 ///
100 /// # Safety
101 ///
102 /// This might not be thread-safe.
103 #[unsafe(method(setPerRecordZoneCompletionBlock:))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn setPerRecordZoneCompletionBlock(
106 &self,
107 per_record_zone_completion_block: Option<
108 &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>, *mut CKRecordZone, *mut NSError)>,
109 >,
110 );
111
112 #[cfg(all(
113 feature = "CKRecordZone",
114 feature = "CKRecordZoneID",
115 feature = "block2"
116 ))]
117 /// This block is called when the operation completes.
118 ///
119 ///
120 /// The
121 ///
122 /// ```text
123 /// -[NSOperation completionBlock]
124 /// ```
125 ///
126 /// will also be called if both are set.
127 /// If the error is
128 /// `CKErrorPartialFailure,`the error's userInfo dictionary contains a dictionary of zoneIDs to errors keyed off of
129 /// `CKPartialErrorsByItemIDKey.``recordZonesByZoneID`and any
130 /// `CKPartialErrorsByItemIDKey`errors are repeats of the data sent back in previous
131 /// `perRecordZoneCompletionBlock`invocations
132 /// Each
133 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
134 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
135 /// should not be concurrently used outside of blocks assigned to this operation.
136 ///
137 /// This property is not atomic.
138 ///
139 /// # Safety
140 ///
141 /// - The returned block's argument 1 must be a valid pointer or null.
142 /// - The returned block's argument 2 must be a valid pointer or null.
143 /// - This might not be thread-safe.
144 #[unsafe(method(fetchRecordZonesCompletionBlock))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn fetchRecordZonesCompletionBlock(
147 &self,
148 ) -> *mut block2::DynBlock<
149 dyn Fn(*mut NSDictionary<CKRecordZoneID, CKRecordZone>, *mut NSError),
150 >;
151
152 #[cfg(all(
153 feature = "CKRecordZone",
154 feature = "CKRecordZoneID",
155 feature = "block2"
156 ))]
157 /// Setter for [`fetchRecordZonesCompletionBlock`][Self::fetchRecordZonesCompletionBlock].
158 ///
159 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
160 ///
161 /// # Safety
162 ///
163 /// This might not be thread-safe.
164 #[unsafe(method(setFetchRecordZonesCompletionBlock:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn setFetchRecordZonesCompletionBlock(
167 &self,
168 fetch_record_zones_completion_block: Option<
169 &block2::DynBlock<
170 dyn Fn(*mut NSDictionary<CKRecordZoneID, CKRecordZone>, *mut NSError),
171 >,
172 >,
173 );
174 );
175}
176
177/// Methods declared on superclass `NSObject`.
178#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
179impl CKFetchRecordZonesOperation {
180 extern_methods!(
181 #[unsafe(method(new))]
182 #[unsafe(method_family = new)]
183 pub unsafe fn new() -> Retained<Self>;
184 );
185}