objc2_cloud_kit/generated/CKFetchShareMetadataOperation.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 /// Fetch the
12 /// `CKShareMetadata`for a share URL.
13 ///
14 ///
15 /// Since you can't know what container this share is in before you fetch its metadata, you may run this operation in any container you have access to
16 ///
17 /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckfetchsharemetadataoperation?language=objc)
18 #[unsafe(super(CKOperation, NSOperation, NSObject))]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 #[cfg(feature = "CKOperation")]
21 pub struct CKFetchShareMetadataOperation;
22);
23
24#[cfg(feature = "CKOperation")]
25unsafe impl NSObjectProtocol for CKFetchShareMetadataOperation {}
26
27#[cfg(feature = "CKOperation")]
28impl CKFetchShareMetadataOperation {
29 extern_methods!(
30 #[unsafe(method(init))]
31 #[unsafe(method_family = init)]
32 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34 #[unsafe(method(initWithShareURLs:))]
35 #[unsafe(method_family = init)]
36 pub unsafe fn initWithShareURLs(
37 this: Allocated<Self>,
38 share_ur_ls: &NSArray<NSURL>,
39 ) -> Retained<Self>;
40
41 #[unsafe(method(shareURLs))]
42 #[unsafe(method_family = none)]
43 pub unsafe fn shareURLs(&self) -> Option<Retained<NSArray<NSURL>>>;
44
45 /// Setter for [`shareURLs`][Self::shareURLs].
46 #[unsafe(method(setShareURLs:))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn setShareURLs(&self, share_ur_ls: Option<&NSArray<NSURL>>);
49
50 /// If set to YES, the resulting
51 /// `CKShareMetadata`will have a
52 /// `rootRecord`object filled out.
53 ///
54 ///
55 /// Defaults to
56 /// `NO.`The resulting
57 /// `CKShareMetadata`will have a
58 /// `rootRecordID`property regardless of the value of this property.
59 #[unsafe(method(shouldFetchRootRecord))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn shouldFetchRootRecord(&self) -> bool;
62
63 /// Setter for [`shouldFetchRootRecord`][Self::shouldFetchRootRecord].
64 #[unsafe(method(setShouldFetchRootRecord:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setShouldFetchRootRecord(&self, should_fetch_root_record: bool);
67
68 #[cfg(feature = "CKRecord")]
69 /// Declares which user-defined keys should be fetched and added to the resulting
70 /// `rootRecord.`
71 ///
72 /// Only consulted if
73 /// `shouldFetchRootRecord`is
74 /// `YES.`If nil, declares the entire root record should be downloaded. If set to an empty array, declares that no user fields should be downloaded.
75 /// Defaults to
76 /// `nil.`
77 #[unsafe(method(rootRecordDesiredKeys))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn rootRecordDesiredKeys(&self) -> Option<Retained<NSArray<CKRecordFieldKey>>>;
80
81 #[cfg(feature = "CKRecord")]
82 /// Setter for [`rootRecordDesiredKeys`][Self::rootRecordDesiredKeys].
83 #[unsafe(method(setRootRecordDesiredKeys:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn setRootRecordDesiredKeys(
86 &self,
87 root_record_desired_keys: Option<&NSArray<CKRecordFieldKey>>,
88 );
89
90 #[cfg(all(feature = "CKShareMetadata", feature = "block2"))]
91 /// Called once for each share URL that the server processed
92 ///
93 ///
94 /// Each
95 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
96 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
97 /// should not be concurrently used outside of blocks assigned to this operation.
98 #[unsafe(method(perShareMetadataBlock))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn perShareMetadataBlock(
101 &self,
102 ) -> *mut block2::Block<dyn Fn(NonNull<NSURL>, *mut CKShareMetadata, *mut NSError)>;
103
104 #[cfg(all(feature = "CKShareMetadata", feature = "block2"))]
105 /// Setter for [`perShareMetadataBlock`][Self::perShareMetadataBlock].
106 #[unsafe(method(setPerShareMetadataBlock:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn setPerShareMetadataBlock(
109 &self,
110 per_share_metadata_block: Option<
111 &block2::Block<dyn Fn(NonNull<NSURL>, *mut CKShareMetadata, *mut NSError)>,
112 >,
113 );
114
115 #[cfg(feature = "block2")]
116 /// This block is called when the operation completes.
117 ///
118 ///
119 /// The
120 ///
121 /// ```text
122 /// -[NSOperation completionBlock]
123 /// ```
124 ///
125 /// will also be called if both are set.
126 /// If the error is
127 /// `CKErrorPartialFailure,`the error's userInfo dictionary contains a dictionary of shareURLs to errors keyed off of
128 /// `CKPartialErrorsByItemIDKey.`These errors are repeats of those sent back in previous
129 /// `perShareMetadataBlock`invocations
130 /// Each
131 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
132 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
133 /// should not be concurrently used outside of blocks assigned to this operation.
134 #[unsafe(method(fetchShareMetadataCompletionBlock))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn fetchShareMetadataCompletionBlock(
137 &self,
138 ) -> *mut block2::Block<dyn Fn(*mut NSError)>;
139
140 #[cfg(feature = "block2")]
141 /// Setter for [`fetchShareMetadataCompletionBlock`][Self::fetchShareMetadataCompletionBlock].
142 #[unsafe(method(setFetchShareMetadataCompletionBlock:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn setFetchShareMetadataCompletionBlock(
145 &self,
146 fetch_share_metadata_completion_block: Option<&block2::Block<dyn Fn(*mut NSError)>>,
147 );
148 );
149}
150
151/// Methods declared on superclass `NSObject`.
152#[cfg(feature = "CKOperation")]
153impl CKFetchShareMetadataOperation {
154 extern_methods!(
155 #[unsafe(method(new))]
156 #[unsafe(method_family = new)]
157 pub unsafe fn new() -> Retained<Self>;
158 );
159}