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/asauthorizationsinglesignonprovider?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ASAuthorizationSingleSignOnProvider;
);

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

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

impl ASAuthorizationSingleSignOnProvider {
    extern_methods!(
        /// To get the right extension the identity provider main URL has to be provided. The URL is even part of the extension using assosiated domains mechanism or can be configured by MDM profile.
        #[unsafe(method(authorizationProviderWithIdentityProviderURL:))]
        #[unsafe(method_family = none)]
        pub unsafe fn authorizationProviderWithIdentityProviderURL(url: &NSURL) -> Retained<Self>;

        #[cfg(all(
            feature = "ASAuthorizationOpenIDRequest",
            feature = "ASAuthorizationRequest",
            feature = "ASAuthorizationSingleSignOnRequest"
        ))]
        #[unsafe(method(createRequest))]
        #[unsafe(method_family = none)]
        pub unsafe fn createRequest(&self) -> Retained<ASAuthorizationSingleSignOnRequest>;

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

        #[unsafe(method(url))]
        #[unsafe(method_family = none)]
        pub unsafe fn url(&self) -> Retained<NSURL>;

        /// Returns YES if the configured provider is capable of performing authorization within a given configuration.
        #[unsafe(method(canPerformAuthorization))]
        #[unsafe(method_family = none)]
        pub unsafe fn canPerformAuthorization(&self) -> bool;
    );
}