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