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

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

extern_conformance!(
    unsafe impl NSCoding for ASOneTimeCodeCredential {}
);

extern_conformance!(
    unsafe impl NSCopying for ASOneTimeCodeCredential {}
);

unsafe impl CopyingHelper for ASOneTimeCodeCredential {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for ASOneTimeCodeCredential {}
);

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

        /// Creates and initializes a new ASOneTimeCodeCredential object.
        ///
        /// Parameter `code`: the one time code.
        #[unsafe(method(credentialWithCode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn credentialWithCode(code: &NSString) -> Retained<Self>;

        /// Initializes an ASOneTimeCodeCredential object.
        ///
        /// Parameter `code`: the one time code.
        #[unsafe(method(initWithCode:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCode(this: Allocated<Self>, code: &NSString) -> Retained<Self>;

        /// The code of this credential.
        ///
        /// Returns: The code string.
        #[unsafe(method(code))]
        #[unsafe(method_family = none)]
        pub unsafe fn code(&self) -> Retained<NSString>;
    );
}

/// Methods declared on superclass `NSObject`.
impl ASOneTimeCodeCredential {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}