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