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"))]
21unsafe impl NSObjectProtocol for CKFetchWebAuthTokenOperation {}
22
23#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
24impl CKFetchWebAuthTokenOperation {
25    extern_methods!(
26        #[unsafe(method(init))]
27        #[unsafe(method_family = init)]
28        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
29
30        #[unsafe(method(initWithAPIToken:))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn initWithAPIToken(
33            this: Allocated<Self>,
34            api_token: &NSString,
35        ) -> Retained<Self>;
36
37        /// APIToken is expected to be set before you begin this operation.
38        #[unsafe(method(APIToken))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn APIToken(&self) -> Option<Retained<NSString>>;
41
42        /// Setter for [`APIToken`][Self::APIToken].
43        #[unsafe(method(setAPIToken:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setAPIToken(&self, api_token: Option<&NSString>);
46
47        #[cfg(feature = "block2")]
48        /// This block is called when the operation completes.
49        ///
50        ///
51        /// The
52        ///
53        /// ```text
54        ///  -[NSOperation completionBlock]
55        /// ```
56        ///
57        /// will also be called if both are set.
58        /// Each
59        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
60        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
61        /// should not be concurrently used outside of blocks assigned to this operation.
62        #[unsafe(method(fetchWebAuthTokenCompletionBlock))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn fetchWebAuthTokenCompletionBlock(
65            &self,
66        ) -> *mut block2::Block<dyn Fn(*mut NSString, *mut NSError)>;
67
68        #[cfg(feature = "block2")]
69        /// Setter for [`fetchWebAuthTokenCompletionBlock`][Self::fetchWebAuthTokenCompletionBlock].
70        #[unsafe(method(setFetchWebAuthTokenCompletionBlock:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setFetchWebAuthTokenCompletionBlock(
73            &self,
74            fetch_web_auth_token_completion_block: Option<
75                &block2::Block<dyn Fn(*mut NSString, *mut NSError)>,
76            >,
77        );
78    );
79}
80
81/// Methods declared on superclass `NSObject`.
82#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
83impl CKFetchWebAuthTokenOperation {
84    extern_methods!(
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new() -> Retained<Self>;
88    );
89}