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