objc2-authentication-services 0.3.2

Bindings to the AuthenticationServices framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationsinglesignoncredential?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ASAuthorizationSingleSignOnCredential;
);

#[cfg(feature = "ASAuthorizationCredential")]
extern_conformance!(
    unsafe impl ASAuthorizationCredential for ASAuthorizationSingleSignOnCredential {}
);

extern_conformance!(
    unsafe impl NSCoding for ASAuthorizationSingleSignOnCredential {}
);

extern_conformance!(
    unsafe impl NSCopying for ASAuthorizationSingleSignOnCredential {}
);

unsafe impl CopyingHelper for ASAuthorizationSingleSignOnCredential {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for ASAuthorizationSingleSignOnCredential {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for ASAuthorizationSingleSignOnCredential {}
);

impl ASAuthorizationSingleSignOnCredential {
    extern_methods!(
        /// A state returned from the AuthenticationServices extension.
        #[unsafe(method(state))]
        #[unsafe(method_family = none)]
        pub unsafe fn state(&self) -> Option<Retained<NSString>>;

        /// An access token used to access other systems with the authorized scopes.
        #[unsafe(method(accessToken))]
        #[unsafe(method_family = none)]
        pub unsafe fn accessToken(&self) -> Option<Retained<NSData>>;

        /// A JSON Web Token (JWT) used to communicate information about the identity of the user in a secure way to the app.
        #[unsafe(method(identityToken))]
        #[unsafe(method_family = none)]
        pub unsafe fn identityToken(&self) -> Option<Retained<NSData>>;

        #[cfg(feature = "ASAuthorization")]
        /// This value will contain a list of scopes for which the user provided authorization.  These may contain a subset of the requested scopes on
        ///
        /// See: ASAuthorizationOpenIDRequest.  The application should query this value to identify which scopes were returned as it maybe different from ones requested.
        #[unsafe(method(authorizedScopes))]
        #[unsafe(method_family = none)]
        pub unsafe fn authorizedScopes(&self) -> Retained<NSArray<ASAuthorizationScope>>;

        /// The complete AuthenticationServices extension response with the additional outputs used by the specific technology used by the Authorization Server instance and AuthenticationServices Extension.
        ///
        /// Note: for some operations all properties can be null and the response will indicate just successful result of the operation.
        #[unsafe(method(authenticatedResponse))]
        #[unsafe(method_family = none)]
        pub unsafe fn authenticatedResponse(&self) -> Option<Retained<NSHTTPURLResponse>>;

        /// Private SecKeys returned from the AuthenticationServices extension.
        #[unsafe(method(privateKeys))]
        #[unsafe(method_family = none)]
        pub unsafe fn privateKeys(&self) -> Retained<NSArray>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}