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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationscope?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type ASAuthorizationScope = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationscopefullname?language=objc)
    pub static ASAuthorizationScopeFullName: &'static ASAuthorizationScope;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationscopeemail?language=objc)
    pub static ASAuthorizationScopeEmail: &'static ASAuthorizationScope;
}

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

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

impl ASAuthorization {
    extern_methods!(
        #[cfg(feature = "ASAuthorizationProvider")]
        /// Provider which was used to generate this authorization response.
        #[unsafe(method(provider))]
        #[unsafe(method_family = none)]
        pub unsafe fn provider(&self) -> Retained<ProtocolObject<dyn ASAuthorizationProvider>>;

        #[cfg(feature = "ASAuthorizationCredential")]
        /// The credential that was returned by the authorization provider. Authorization provider type should be used to determine how to introspect the credential.
        #[unsafe(method(credential))]
        #[unsafe(method_family = none)]
        pub unsafe fn credential(&self) -> Retained<ProtocolObject<dyn ASAuthorizationCredential>>;

        #[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>;
    );
}