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/asauthorizationappleidrequest?language=objc)
    #[unsafe(super(ASAuthorizationOpenIDRequest, ASAuthorizationRequest, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "ASAuthorizationOpenIDRequest",
        feature = "ASAuthorizationRequest"
    ))]
    pub struct ASAuthorizationAppleIDRequest;
);

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

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

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

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

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

#[cfg(all(
    feature = "ASAuthorizationOpenIDRequest",
    feature = "ASAuthorizationRequest"
))]
impl ASAuthorizationAppleIDRequest {
    extern_methods!(
        /// If you have been previously vended a 'user' value through ASAuthorization response, you may set it here to provide additional context to identity provider.
        ///
        ///
        /// See: ASAuthorizationAppleIDCredential doc for the description of this property in context of response.
        #[unsafe(method(user))]
        #[unsafe(method_family = none)]
        pub unsafe fn user(&self) -> Option<Retained<NSString>>;

        /// Setter for [`user`][Self::user].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setUser:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUser(&self, user: Option<&NSString>);
    );
}

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