objc2_cloud_kit/generated/CKFetchWebAuthTokenOperation.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 /// This operation will fetch a web auth token given an API token obtained from the CloudKit Dashboard for your container
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckfetchwebauthtokenoperation?language=objc)
14 #[unsafe(super(CKDatabaseOperation, CKOperation, NSOperation, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
17 pub struct CKFetchWebAuthTokenOperation;
18);
19
20#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
21extern_conformance!(
22 unsafe impl NSObjectProtocol for CKFetchWebAuthTokenOperation {}
23);
24
25#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
26impl CKFetchWebAuthTokenOperation {
27 extern_methods!(
28 #[unsafe(method(init))]
29 #[unsafe(method_family = init)]
30 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
31
32 #[unsafe(method(initWithAPIToken:))]
33 #[unsafe(method_family = init)]
34 pub unsafe fn initWithAPIToken(
35 this: Allocated<Self>,
36 api_token: &NSString,
37 ) -> Retained<Self>;
38
39 /// APIToken is expected to be set before you begin this operation.
40 ///
41 /// This property is not atomic.
42 ///
43 /// # Safety
44 ///
45 /// This might not be thread-safe.
46 #[unsafe(method(APIToken))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn APIToken(&self) -> Option<Retained<NSString>>;
49
50 /// Setter for [`APIToken`][Self::APIToken].
51 ///
52 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
53 ///
54 /// # Safety
55 ///
56 /// This might not be thread-safe.
57 #[unsafe(method(setAPIToken:))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn setAPIToken(&self, api_token: Option<&NSString>);
60
61 #[cfg(feature = "block2")]
62 /// This block is called when the operation completes.
63 ///
64 ///
65 /// The
66 ///
67 /// ```text
68 /// -[NSOperation completionBlock]
69 /// ```
70 ///
71 /// will also be called if both are set.
72 /// Each
73 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
74 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
75 /// should not be concurrently used outside of blocks assigned to this operation.
76 ///
77 /// This property is not atomic.
78 ///
79 /// # Safety
80 ///
81 /// - The returned block's argument 1 must be a valid pointer or null.
82 /// - The returned block's argument 2 must be a valid pointer or null.
83 /// - This might not be thread-safe.
84 #[unsafe(method(fetchWebAuthTokenCompletionBlock))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn fetchWebAuthTokenCompletionBlock(
87 &self,
88 ) -> *mut block2::DynBlock<dyn Fn(*mut NSString, *mut NSError)>;
89
90 #[cfg(feature = "block2")]
91 /// Setter for [`fetchWebAuthTokenCompletionBlock`][Self::fetchWebAuthTokenCompletionBlock].
92 ///
93 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
94 ///
95 /// # Safety
96 ///
97 /// This might not be thread-safe.
98 #[unsafe(method(setFetchWebAuthTokenCompletionBlock:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn setFetchWebAuthTokenCompletionBlock(
101 &self,
102 fetch_web_auth_token_completion_block: Option<
103 &block2::DynBlock<dyn Fn(*mut NSString, *mut NSError)>,
104 >,
105 );
106 );
107}
108
109/// Methods declared on superclass `NSObject`.
110#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
111impl CKFetchWebAuthTokenOperation {
112 extern_methods!(
113 #[unsafe(method(new))]
114 #[unsafe(method_family = new)]
115 pub unsafe fn new() -> Retained<Self>;
116 );
117}