objc2_cloud_kit/generated/
CKFetchRecordsOperation.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/ckfetchrecordsoperation?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 CKFetchRecordsOperation;
16);
17
18#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
19unsafe impl NSObjectProtocol for CKFetchRecordsOperation {}
20
21#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
22impl CKFetchRecordsOperation {
23    extern_methods!(
24        #[unsafe(method(init))]
25        #[unsafe(method_family = init)]
26        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
27
28        #[cfg(feature = "CKRecordID")]
29        #[unsafe(method(initWithRecordIDs:))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn initWithRecordIDs(
32            this: Allocated<Self>,
33            record_i_ds: &NSArray<CKRecordID>,
34        ) -> Retained<Self>;
35
36        #[unsafe(method(fetchCurrentUserRecordOperation))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn fetchCurrentUserRecordOperation() -> Retained<Self>;
39
40        #[cfg(feature = "CKRecordID")]
41        #[unsafe(method(recordIDs))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn recordIDs(&self) -> Option<Retained<NSArray<CKRecordID>>>;
44
45        #[cfg(feature = "CKRecordID")]
46        /// Setter for [`recordIDs`][Self::recordIDs].
47        #[unsafe(method(setRecordIDs:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setRecordIDs(&self, record_i_ds: Option<&NSArray<CKRecordID>>);
50
51        #[cfg(feature = "CKRecord")]
52        /// Declares which user-defined keys should be fetched and added to the resulting CKRecords.
53        ///
54        ///
55        /// If nil, declares the entire record should be downloaded. If set to an empty array, declares that no user fields should be downloaded.
56        /// Defaults to
57        /// `nil.`
58        #[unsafe(method(desiredKeys))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn desiredKeys(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
61
62        #[cfg(feature = "CKRecord")]
63        /// Setter for [`desiredKeys`][Self::desiredKeys].
64        #[unsafe(method(setDesiredKeys:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setDesiredKeys(&self, desired_keys: Option<&NSArray<CKRecordFieldKey>>);
67
68        #[cfg(all(feature = "CKRecordID", feature = "block2"))]
69        /// Indicates the progress for each record.
70        ///
71        ///
72        /// This method is called at least once with a progress of 1.0 for every record. Intermediate progress is only reported for records that contain assets.
73        /// It is possible for progress to regress when a retry is automatically triggered.
74        /// Each
75        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
76        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
77        /// should not be concurrently used outside of blocks assigned to this operation.
78        #[unsafe(method(perRecordProgressBlock))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn perRecordProgressBlock(
81            &self,
82        ) -> *mut block2::Block<dyn Fn(NonNull<CKRecordID>, c_double)>;
83
84        #[cfg(all(feature = "CKRecordID", feature = "block2"))]
85        /// Setter for [`perRecordProgressBlock`][Self::perRecordProgressBlock].
86        #[unsafe(method(setPerRecordProgressBlock:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setPerRecordProgressBlock(
89            &self,
90            per_record_progress_block: Option<
91                &block2::Block<dyn Fn(NonNull<CKRecordID>, c_double)>,
92            >,
93        );
94
95        #[cfg(all(feature = "CKRecord", feature = "CKRecordID", feature = "block2"))]
96        /// Called on success or failure for each record.
97        ///
98        ///
99        /// Each
100        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
101        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
102        /// should not be concurrently used outside of blocks assigned to this operation.
103        #[unsafe(method(perRecordCompletionBlock))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn perRecordCompletionBlock(
106            &self,
107        ) -> *mut block2::Block<dyn Fn(*mut CKRecord, *mut CKRecordID, *mut NSError)>;
108
109        #[cfg(all(feature = "CKRecord", feature = "CKRecordID", feature = "block2"))]
110        /// Setter for [`perRecordCompletionBlock`][Self::perRecordCompletionBlock].
111        #[unsafe(method(setPerRecordCompletionBlock:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn setPerRecordCompletionBlock(
114            &self,
115            per_record_completion_block: Option<
116                &block2::Block<dyn Fn(*mut CKRecord, *mut CKRecordID, *mut NSError)>,
117            >,
118        );
119
120        #[cfg(all(feature = "CKRecord", feature = "CKRecordID", feature = "block2"))]
121        /// This block is called when the operation completes.
122        ///
123        ///
124        /// The
125        ///
126        /// ```text
127        ///  -[NSOperation completionBlock]
128        /// ```
129        ///
130        /// will also be called if both are set.
131        /// If the error is
132        /// `CKErrorPartialFailure,`the error's userInfo dictionary contains a dictionary of recordIDs to errors keyed off of
133        /// `CKPartialErrorsByItemIDKey.``recordsByRecordID`and any
134        /// `CKPartialErrorsByItemIDKey`errors are repeats of the data sent back in previous
135        /// `perRecordCompletionBlock`invocations
136        /// Each
137        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
138        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
139        /// should not be concurrently used outside of blocks assigned to this operation.
140        #[unsafe(method(fetchRecordsCompletionBlock))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn fetchRecordsCompletionBlock(
143            &self,
144        ) -> *mut block2::Block<dyn Fn(*mut NSDictionary<CKRecordID, CKRecord>, *mut NSError)>;
145
146        #[cfg(all(feature = "CKRecord", feature = "CKRecordID", feature = "block2"))]
147        /// Setter for [`fetchRecordsCompletionBlock`][Self::fetchRecordsCompletionBlock].
148        #[unsafe(method(setFetchRecordsCompletionBlock:))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn setFetchRecordsCompletionBlock(
151            &self,
152            fetch_records_completion_block: Option<
153                &block2::Block<dyn Fn(*mut NSDictionary<CKRecordID, CKRecord>, *mut NSError)>,
154            >,
155        );
156    );
157}
158
159/// Methods declared on superclass `NSObject`.
160#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
161impl CKFetchRecordsOperation {
162    extern_methods!(
163        #[unsafe(method(new))]
164        #[unsafe(method_family = new)]
165        pub unsafe fn new() -> Retained<Self>;
166    );
167}