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        #[unsafe(method(completeUpgradeToSignInWithAppleWithUserInfo:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn completeUpgradeToSignInWithAppleWithUserInfo(
54            &self,
55            user_info: Option<&NSDictionary>,
56        );
57
58        #[cfg(feature = "ASPasswordCredential")]
59        /// Confirms successful completion of a strong password upgrade.
60        ///
61        /// Parameter `updatedCredential`: contains the account username and new password.
62        ///
63        /// Parameter `userInfo`: For upgrades invoked within the extension's containing app, any
64        /// information the extension wants to pass back to the app.
65        #[unsafe(method(completeChangePasswordRequestWithUpdatedCredential:userInfo:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn completeChangePasswordRequestWithUpdatedCredential_userInfo(
68            &self,
69            updated_credential: &ASPasswordCredential,
70            user_info: Option<&NSDictionary>,
71        );
72
73        /// Used to either ask for user interaction in a request or to fail a request.
74        #[unsafe(method(cancelRequestWithError:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn cancelRequestWithError(&self, error: &NSError);
77    );
78}
79
80/// Methods declared on superclass `NSObject`.
81impl ASAccountAuthenticationModificationExtensionContext {
82    extern_methods!(
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub unsafe fn new() -> Retained<Self>;
90    );
91}