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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationsinglesignonrequest?language=objc)
    #[unsafe(super(ASAuthorizationOpenIDRequest, ASAuthorizationRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "ASAuthorizationOpenIDRequest",
        feature = "ASAuthorizationRequest"
    ))]
    pub struct ASAuthorizationSingleSignOnRequest;
);

#[cfg(all(
    feature = "ASAuthorizationOpenIDRequest",
    feature = "ASAuthorizationRequest"
))]
extern_conformance!(
    unsafe impl NSCoding for ASAuthorizationSingleSignOnRequest {}
);

#[cfg(all(
    feature = "ASAuthorizationOpenIDRequest",
    feature = "ASAuthorizationRequest"
))]
extern_conformance!(
    unsafe impl NSCopying for ASAuthorizationSingleSignOnRequest {}
);

#[cfg(all(
    feature = "ASAuthorizationOpenIDRequest",
    feature = "ASAuthorizationRequest"
))]
unsafe impl CopyingHelper for ASAuthorizationSingleSignOnRequest {
    type Result = Self;
}

#[cfg(all(
    feature = "ASAuthorizationOpenIDRequest",
    feature = "ASAuthorizationRequest"
))]
extern_conformance!(
    unsafe impl NSObjectProtocol for ASAuthorizationSingleSignOnRequest {}
);

#[cfg(all(
    feature = "ASAuthorizationOpenIDRequest",
    feature = "ASAuthorizationRequest"
))]
extern_conformance!(
    unsafe impl NSSecureCoding for ASAuthorizationSingleSignOnRequest {}
);

#[cfg(all(
    feature = "ASAuthorizationOpenIDRequest",
    feature = "ASAuthorizationRequest"
))]
impl ASAuthorizationSingleSignOnRequest {
    extern_methods!(
        /// Parameters required by the specific Authorization Server which should be used by the selected Authorization Services extension for authorization.
        #[unsafe(method(authorizationOptions))]
        #[unsafe(method_family = none)]
        pub unsafe fn authorizationOptions(&self) -> Retained<NSArray<NSURLQueryItem>>;

        /// Setter for [`authorizationOptions`][Self::authorizationOptions].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAuthorizationOptions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAuthorizationOptions(
            &self,
            authorization_options: &NSArray<NSURLQueryItem>,
        );

        /// Enables or disables the authorization user interface.
        ///
        /// The default values is YES. If user interface is not enabled, then the authorization will fail with
        ///
        /// See: ASAuthorizationErrorNotInteractive if it attempts to display the authorization user interface.
        #[unsafe(method(isUserInterfaceEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isUserInterfaceEnabled(&self) -> bool;

        /// Setter for [`isUserInterfaceEnabled`][Self::isUserInterfaceEnabled].
        #[unsafe(method(setUserInterfaceEnabled:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUserInterfaceEnabled(&self, user_interface_enabled: bool);
    );
}

/// Methods declared on superclass `ASAuthorizationRequest`.
#[cfg(all(
    feature = "ASAuthorizationOpenIDRequest",
    feature = "ASAuthorizationRequest"
))]
impl ASAuthorizationSingleSignOnRequest {
    extern_methods!(
        #[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>;
    );
}