objc2_cloud_kit/generated/CKFetchShareParticipantsOperation.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/ckfetchshareparticipantsoperation?language=objc)
12 #[unsafe(super(CKOperation, NSOperation, NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 #[cfg(feature = "CKOperation")]
15 pub struct CKFetchShareParticipantsOperation;
16);
17
18#[cfg(feature = "CKOperation")]
19extern_conformance!(
20 unsafe impl NSObjectProtocol for CKFetchShareParticipantsOperation {}
21);
22
23#[cfg(feature = "CKOperation")]
24impl CKFetchShareParticipantsOperation {
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(feature = "CKUserIdentityLookupInfo")]
31 #[unsafe(method(initWithUserIdentityLookupInfos:))]
32 #[unsafe(method_family = init)]
33 pub unsafe fn initWithUserIdentityLookupInfos(
34 this: Allocated<Self>,
35 user_identity_lookup_infos: &NSArray<CKUserIdentityLookupInfo>,
36 ) -> Retained<Self>;
37
38 #[cfg(feature = "CKUserIdentityLookupInfo")]
39 /// This property is not atomic.
40 ///
41 /// # Safety
42 ///
43 /// This might not be thread-safe.
44 #[unsafe(method(userIdentityLookupInfos))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn userIdentityLookupInfos(
47 &self,
48 ) -> Option<Retained<NSArray<CKUserIdentityLookupInfo>>>;
49
50 #[cfg(feature = "CKUserIdentityLookupInfo")]
51 /// Setter for [`userIdentityLookupInfos`][Self::userIdentityLookupInfos].
52 ///
53 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
54 ///
55 /// # Safety
56 ///
57 /// This might not be thread-safe.
58 #[unsafe(method(setUserIdentityLookupInfos:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setUserIdentityLookupInfos(
61 &self,
62 user_identity_lookup_infos: Option<&NSArray<CKUserIdentityLookupInfo>>,
63 );
64
65 #[cfg(all(feature = "CKShareParticipant", feature = "block2"))]
66 /// Called once for each share participant created from a submitted user identity lookup info.
67 ///
68 ///
69 /// If the replacement callback
70 /// `perShareParticipantCompletionBlock`is set, this callback block is ignored.
71 /// Each
72 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
73 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
74 /// should not be concurrently used outside of blocks assigned to this operation.
75 ///
76 /// This property is not atomic.
77 ///
78 /// # Safety
79 ///
80 /// - The returned block's argument must be a valid pointer.
81 /// - This might not be thread-safe.
82 #[deprecated = "Use perShareParticipantCompletionBlock instead, which surfaces per-share-participant errors"]
83 #[unsafe(method(shareParticipantFetchedBlock))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn shareParticipantFetchedBlock(
86 &self,
87 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKShareParticipant>)>;
88
89 #[cfg(all(feature = "CKShareParticipant", feature = "block2"))]
90 /// Setter for [`shareParticipantFetchedBlock`][Self::shareParticipantFetchedBlock].
91 ///
92 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
93 ///
94 /// # Safety
95 ///
96 /// This might not be thread-safe.
97 #[deprecated = "Use perShareParticipantCompletionBlock instead, which surfaces per-share-participant errors"]
98 #[unsafe(method(setShareParticipantFetchedBlock:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn setShareParticipantFetchedBlock(
101 &self,
102 share_participant_fetched_block: Option<
103 &block2::DynBlock<dyn Fn(NonNull<CKShareParticipant>)>,
104 >,
105 );
106
107 #[cfg(all(
108 feature = "CKShareParticipant",
109 feature = "CKUserIdentityLookupInfo",
110 feature = "block2"
111 ))]
112 /// Called once for each lookup info.
113 ///
114 ///
115 /// Each
116 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
117 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
118 /// should not be concurrently used outside of blocks assigned to this operation.
119 ///
120 /// This property is not atomic.
121 ///
122 /// # Safety
123 ///
124 /// - The returned block's argument 1 must be a valid pointer.
125 /// - The returned block's argument 2 must be a valid pointer or null.
126 /// - The returned block's argument 3 must be a valid pointer or null.
127 /// - This might not be thread-safe.
128 #[unsafe(method(perShareParticipantCompletionBlock))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn perShareParticipantCompletionBlock(
131 &self,
132 ) -> *mut block2::DynBlock<
133 dyn Fn(NonNull<CKUserIdentityLookupInfo>, *mut CKShareParticipant, *mut NSError),
134 >;
135
136 #[cfg(all(
137 feature = "CKShareParticipant",
138 feature = "CKUserIdentityLookupInfo",
139 feature = "block2"
140 ))]
141 /// Setter for [`perShareParticipantCompletionBlock`][Self::perShareParticipantCompletionBlock].
142 ///
143 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
144 ///
145 /// # Safety
146 ///
147 /// This might not be thread-safe.
148 #[unsafe(method(setPerShareParticipantCompletionBlock:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn setPerShareParticipantCompletionBlock(
151 &self,
152 per_share_participant_completion_block: Option<
153 &block2::DynBlock<
154 dyn Fn(
155 NonNull<CKUserIdentityLookupInfo>,
156 *mut CKShareParticipant,
157 *mut NSError,
158 ),
159 >,
160 >,
161 );
162
163 #[cfg(feature = "block2")]
164 /// This block is called when the operation completes.
165 ///
166 ///
167 /// The
168 ///
169 /// ```text
170 /// -[NSOperation completionBlock]
171 /// ```
172 ///
173 /// will also be called if both are set.
174 /// If the error is
175 /// `CKErrorPartialFailure,`the error's userInfo dictionary contains a dictionary of lookup infos to errors keyed off of
176 /// `CKPartialErrorsByItemIDKey.`These errors are repeats of those sent back in previous
177 /// `perShareParticipantCompletionBlock`invocations
178 /// Each
179 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
180 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
181 /// should not be concurrently used outside of blocks assigned to this operation.
182 ///
183 /// This property is not atomic.
184 ///
185 /// # Safety
186 ///
187 /// - The returned block's argument must be a valid pointer or null.
188 /// - This might not be thread-safe.
189 #[unsafe(method(fetchShareParticipantsCompletionBlock))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn fetchShareParticipantsCompletionBlock(
192 &self,
193 ) -> *mut block2::DynBlock<dyn Fn(*mut NSError)>;
194
195 #[cfg(feature = "block2")]
196 /// Setter for [`fetchShareParticipantsCompletionBlock`][Self::fetchShareParticipantsCompletionBlock].
197 ///
198 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
199 ///
200 /// # Safety
201 ///
202 /// This might not be thread-safe.
203 #[unsafe(method(setFetchShareParticipantsCompletionBlock:))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn setFetchShareParticipantsCompletionBlock(
206 &self,
207 fetch_share_participants_completion_block: Option<
208 &block2::DynBlock<dyn Fn(*mut NSError)>,
209 >,
210 );
211 );
212}
213
214/// Methods declared on superclass `NSObject`.
215#[cfg(feature = "CKOperation")]
216impl CKFetchShareParticipantsOperation {
217 extern_methods!(
218 #[unsafe(method(new))]
219 #[unsafe(method_family = new)]
220 pub unsafe fn new() -> Retained<Self>;
221 );
222}