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
//! 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/asaccountauthenticationmodificationextensioncontext?language=objc)
#[unsafe(super(NSExtensionContext, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct ASAccountAuthenticationModificationExtensionContext;
);
extern_conformance!(
unsafe impl NSObjectProtocol for ASAccountAuthenticationModificationExtensionContext {}
);
impl ASAccountAuthenticationModificationExtensionContext {
extern_methods!(
#[cfg(all(feature = "ASAuthorizationAppleIDCredential", feature = "block2"))]
/// Retrieves a Sign in with Apple credential from the system.
///
/// Parameter `state`: Can be specified to enhance security. State is returned in the ASAuthorizationAppleIDCredential.
///
/// Parameter `nonce`: Can be specified to enhance security. The returned identityToken on the ASAuthorizationAppleIDCredential can be exchanged with the server for the nonce.
///
/// Calling this method will cause the system Sign in with Apple upgrade sheet
/// to appear. If extension UI is showing when this method is called, the extension UI will be
/// dismissed before the sheet is presented.
#[unsafe(method(getSignInWithAppleUpgradeAuthorizationWithState:nonce:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn getSignInWithAppleUpgradeAuthorizationWithState_nonce_completionHandler(
&self,
state: Option<&NSString>,
nonce: Option<&NSString>,
completion_handler: &block2::DynBlock<
dyn Fn(*mut ASAuthorizationAppleIDCredential, *mut NSError),
>,
);
/// Confirms successful completion of a Sign in with Apple upgrade.
///
/// Parameter `userInfo`: For upgrades invoked within the extension's containing app, any
/// information the extension wants to pass back to the app.
///
/// Once a Sign in with Apple upgrade is completed, the system will delete
/// the password-based credential from the Keychain, if it is saved there.
///
/// # Safety
///
/// `user_info` generic should be of the correct type.
#[unsafe(method(completeUpgradeToSignInWithAppleWithUserInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn completeUpgradeToSignInWithAppleWithUserInfo(
&self,
user_info: Option<&NSDictionary>,
);
#[cfg(feature = "ASPasswordCredential")]
/// Confirms successful completion of a strong password upgrade.
///
/// Parameter `updatedCredential`: contains the account username and new password.
///
/// Parameter `userInfo`: For upgrades invoked within the extension's containing app, any
/// information the extension wants to pass back to the app.
///
/// # Safety
///
/// `user_info` generic should be of the correct type.
#[unsafe(method(completeChangePasswordRequestWithUpdatedCredential:userInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn completeChangePasswordRequestWithUpdatedCredential_userInfo(
&self,
updated_credential: &ASPasswordCredential,
user_info: Option<&NSDictionary>,
);
/// Used to either ask for user interaction in a request or to fail a request.
#[unsafe(method(cancelRequestWithError:))]
#[unsafe(method_family = none)]
pub unsafe fn cancelRequestWithError(&self, error: &NSError);
);
}
/// Methods declared on superclass `NSObject`.
impl ASAccountAuthenticationModificationExtensionContext {
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>;
);
}