objc2_authentication_services/generated/ASAccountAuthenticationModificationExtensionContext.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/asaccountauthenticationmodificationextensioncontext?language=objc)
12 #[unsafe(super(NSExtensionContext, NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct ASAccountAuthenticationModificationExtensionContext;
15);
16
17extern_conformance!(
18 unsafe impl NSObjectProtocol for ASAccountAuthenticationModificationExtensionContext {}
19);
20
21impl ASAccountAuthenticationModificationExtensionContext {
22 extern_methods!(
23 #[cfg(all(feature = "ASAuthorizationAppleIDCredential", feature = "block2"))]
24 /// Retrieves a Sign in with Apple credential from the system.
25 ///
26 /// Parameter `state`: Can be specified to enhance security. State is returned in the ASAuthorizationAppleIDCredential.
27 ///
28 /// Parameter `nonce`: Can be specified to enhance security. The returned identityToken on the ASAuthorizationAppleIDCredential can be exchanged with the server for the nonce.
29 ///
30 /// Calling this method will cause the system Sign in with Apple upgrade sheet
31 /// to appear. If extension UI is showing when this method is called, the extension UI will be
32 /// dismissed before the sheet is presented.
33 #[unsafe(method(getSignInWithAppleUpgradeAuthorizationWithState:nonce:completionHandler:))]
34 #[unsafe(method_family = none)]
35 pub unsafe fn getSignInWithAppleUpgradeAuthorizationWithState_nonce_completionHandler(
36 &self,
37 state: Option<&NSString>,
38 nonce: Option<&NSString>,
39 completion_handler: &block2::DynBlock<
40 dyn Fn(*mut ASAuthorizationAppleIDCredential, *mut NSError),
41 >,
42 );
43
44 /// Confirms successful completion of a Sign in with Apple upgrade.
45 ///
46 /// Parameter `userInfo`: For upgrades invoked within the extension's containing app, any
47 /// information the extension wants to pass back to the app.
48 ///
49 /// Once a Sign in with Apple upgrade is completed, the system will delete
50 /// the password-based credential from the Keychain, if it is saved there.
51 ///
52 /// # Safety
53 ///
54 /// `user_info` generic should be of the correct type.
55 #[unsafe(method(completeUpgradeToSignInWithAppleWithUserInfo:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn completeUpgradeToSignInWithAppleWithUserInfo(
58 &self,
59 user_info: Option<&NSDictionary>,
60 );
61
62 #[cfg(feature = "ASPasswordCredential")]
63 /// Confirms successful completion of a strong password upgrade.
64 ///
65 /// Parameter `updatedCredential`: contains the account username and new password.
66 ///
67 /// Parameter `userInfo`: For upgrades invoked within the extension's containing app, any
68 /// information the extension wants to pass back to the app.
69 ///
70 /// # Safety
71 ///
72 /// `user_info` generic should be of the correct type.
73 #[unsafe(method(completeChangePasswordRequestWithUpdatedCredential:userInfo:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn completeChangePasswordRequestWithUpdatedCredential_userInfo(
76 &self,
77 updated_credential: &ASPasswordCredential,
78 user_info: Option<&NSDictionary>,
79 );
80
81 /// Used to either ask for user interaction in a request or to fail a request.
82 #[unsafe(method(cancelRequestWithError:))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn cancelRequestWithError(&self, error: &NSError);
85 );
86}
87
88/// Methods declared on superclass `NSObject`.
89impl ASAccountAuthenticationModificationExtensionContext {
90 extern_methods!(
91 #[unsafe(method(init))]
92 #[unsafe(method_family = init)]
93 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95 #[unsafe(method(new))]
96 #[unsafe(method_family = new)]
97 pub unsafe fn new() -> Retained<Self>;
98 );
99}