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