objc2_authentication_services/generated/
ASCredentialProviderExtensionContext.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/authenticationservices/ascredentialproviderextensioncontext?language=objc)
12    #[unsafe(super(NSExtensionContext, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct ASCredentialProviderExtensionContext;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for ASCredentialProviderExtensionContext {}
19);
20
21impl ASCredentialProviderExtensionContext {
22    extern_methods!(
23        #[cfg(all(feature = "ASPasswordCredential", feature = "block2"))]
24        /// Complete the request by providing the user selected credential.
25        ///
26        /// Parameter `credential`: the credential that the user has selected.
27        ///
28        /// Parameter `completionHandler`: optionally contains any work which the extension may need to perform after the request has been completed,
29        /// as a background-priority task. The `expired` parameter will be YES if the system decides to prematurely terminate a previous
30        /// non-expiration invocation of the completionHandler.
31        ///
32        /// Calling this method will eventually dismiss the associated view controller.
33        #[unsafe(method(completeRequestWithSelectedCredential:completionHandler:))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn completeRequestWithSelectedCredential_completionHandler(
36            &self,
37            credential: &ASPasswordCredential,
38            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
39        );
40
41        #[cfg(all(feature = "ASPasskeyAssertionCredential", feature = "block2"))]
42        /// Complete the assertion request by providing the user selected passkey credential.
43        ///
44        /// Parameter `credential`: the credential that the user has selected. Includes assertion response.
45        ///
46        /// Parameter `completionHandler`: optionally contains any work which the extension may need to perform after the request has been completed,
47        /// as a background-priority task. The `expired` parameter will be YES if the system decides to prematurely terminate a previous
48        /// non-expiration invocation of the completionHandler.
49        ///
50        /// Calling this method will eventually dismiss the associated view controller.
51        #[unsafe(method(completeAssertionRequestWithSelectedPasskeyCredential:completionHandler:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn completeAssertionRequestWithSelectedPasskeyCredential_completionHandler(
54            &self,
55            credential: &ASPasskeyAssertionCredential,
56            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
57        );
58
59        #[cfg(all(feature = "ASPasskeyRegistrationCredential", feature = "block2"))]
60        /// Complete the registration request by providing the newly created passkey credential.
61        ///
62        /// Parameter `credential`: the credential that was created in response to the registration request.
63        ///
64        /// Parameter `completionHandler`: optionally contains any work which the extension may need to perform after the request has been completed,
65        /// as a background-priority task. The `expired` parameter will be YES if the system decides to prematurely terminate a previous
66        /// non-expiration invocation of the completionHandler.
67        ///
68        /// Calling this method will eventually dismiss the associated view controller.
69        #[unsafe(method(completeRegistrationRequestWithSelectedPasskeyCredential:completionHandler:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn completeRegistrationRequestWithSelectedPasskeyCredential_completionHandler(
72            &self,
73            credential: &ASPasskeyRegistrationCredential,
74            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
75        );
76
77        #[cfg(all(feature = "ASOneTimeCodeCredential", feature = "block2"))]
78        /// Complete the request by providing the user selected one time code credential.
79        ///
80        /// Parameter `credential`: the credential that the user has selected.
81        ///
82        /// Parameter `completionHandler`: optionally contains any work which the extension may need to perform after the request has been completed,
83        /// as a background-priority task. The `expired` parameter will be YES if the system decides to prematurely terminate a previous
84        /// non-expiration invocation of the completionHandler.
85        ///
86        /// Calling this method will eventually dismiss the associated view controller.
87        #[unsafe(method(completeOneTimeCodeRequestWithSelectedCredential:completionHandler:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn completeOneTimeCodeRequestWithSelectedCredential_completionHandler(
90            &self,
91            credential: &ASOneTimeCodeCredential,
92            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
93        );
94
95        /// Complete the request to configure the extension.
96        ///
97        /// Calling this method will eventually dismiss the associated view controller.
98        #[unsafe(method(completeExtensionConfigurationRequest))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn completeExtensionConfigurationRequest(&self);
101
102        #[cfg(feature = "block2")]
103        #[unsafe(method(completeRequestReturningItems:completionHandler:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn completeRequestReturningItems_completionHandler(
106            &self,
107            items: Option<&NSArray>,
108            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
109        );
110
111        /// Cancels the request.
112        ///
113        /// Parameter `error`: error's domain should be ASExtensionErrorDomain and the code should be a value of type ASExtensionErrorCode.
114        ///
115        /// The extension should call this method when the user cancels the action or a failure occurs.
116        #[unsafe(method(cancelRequestWithError:))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn cancelRequestWithError(&self, error: &NSError);
119    );
120}
121
122/// Methods declared on superclass `NSObject`.
123impl ASCredentialProviderExtensionContext {
124    extern_methods!(
125        #[unsafe(method(init))]
126        #[unsafe(method_family = init)]
127        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
128
129        #[unsafe(method(new))]
130        #[unsafe(method_family = new)]
131        pub unsafe fn new() -> Retained<Self>;
132    );
133}