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

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

impl ASAuthorizationProviderExtensionUserLoginConfiguration {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

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

        /// The user name to use when authenticating with the identity provider.
        #[unsafe(method(loginUserName))]
        #[unsafe(method_family = none)]
        pub unsafe fn loginUserName(&self) -> Retained<NSString>;

        /// Setter for [`loginUserName`][Self::loginUserName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLoginUserName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLoginUserName(&self, login_user_name: &NSString);

        /// Creates an instance with the required values.
        ///
        /// Parameter `loginUserName`: The login user name to use.
        #[unsafe(method(initWithLoginUserName:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLoginUserName(
            this: Allocated<Self>,
            login_user_name: &NSString,
        ) -> Retained<Self>;

        /// Sets custom claims to be added to the embedded assertion request header.
        ///
        /// Parameter `claims`: The claims to be added. It must serialize as valid JSON to be accepted.
        ///
        /// Parameter `error`: Nil or an NSError indicating why the claims were rejected.
        ///
        /// Returns: YES when successful and NO when claims are rejected.
        ///
        /// # Safety
        ///
        /// `claims` generic should be of the correct type.
        #[unsafe(method(setCustomAssertionRequestHeaderClaims:returningError:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCustomAssertionRequestHeaderClaims_returningError(
            &self,
            claims: &NSDictionary<NSString, AnyObject>,
        ) -> Result<(), Retained<NSError>>;

        /// Sets custom claims to be added to the embedded assertion request body.
        ///
        /// Parameter `claims`: The claims to be added. It must serialize as valid JSON to be accepted.
        ///
        /// Parameter `error`: Nil or an NSError indicating why the claims were rejected.
        ///
        /// Returns: YES when successful and NO when claims are rejected.
        ///
        /// # Safety
        ///
        /// `claims` generic should be of the correct type.
        #[unsafe(method(setCustomAssertionRequestBodyClaims:returningError:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCustomAssertionRequestBodyClaims_returningError(
            &self,
            claims: &NSDictionary<NSString, AnyObject>,
        ) -> Result<(), Retained<NSError>>;

        /// Sets custom claims to be added to the login request header.
        ///
        /// Parameter `claims`: The claims to be added. It must serialize as valid JSON to be accepted.
        ///
        /// Parameter `error`: Nil or an NSError indicating why the claims were rejected.
        ///
        /// Returns: YES when successful and NO when claims are rejected.
        ///
        /// # Safety
        ///
        /// `claims` generic should be of the correct type.
        #[unsafe(method(setCustomLoginRequestHeaderClaims:returningError:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCustomLoginRequestHeaderClaims_returningError(
            &self,
            claims: &NSDictionary<NSString, AnyObject>,
        ) -> Result<(), Retained<NSError>>;

        /// Sets custom claims to be added to the login request body.
        ///
        /// Parameter `claims`: The claims to be added. It must serialize as valid JSON to be accepted.
        ///
        /// Parameter `error`: Nil or an NSError indicating why the claims were rejected.
        ///
        /// Returns: YES when successful and NO when claims are rejected.
        ///
        /// # Safety
        ///
        /// `claims` generic should be of the correct type.
        #[unsafe(method(setCustomLoginRequestBodyClaims:returningError:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCustomLoginRequestBodyClaims_returningError(
            &self,
            claims: &NSDictionary<NSString, AnyObject>,
        ) -> Result<(), Retained<NSError>>;
    );
}