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!(
    /// An ASOneTimeCodeCredentialIdentity is used to describe an identity that can use a service upon successful one time code based authentication.
    /// Use this class to save entries into ASCredentialIdentityStore.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asonetimecodecredentialidentity?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ASOneTimeCodeCredentialIdentity;
);

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

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

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

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

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

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

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

        #[cfg(feature = "ASCredentialServiceIdentifier")]
        /// Initializes an instance of ASOneTimeCodeCredentialIdentity.
        ///
        /// Parameter `serviceIdentifier`: The service identifier for which this credential identity is valid.
        ///
        /// Parameter `label`: A user-provided label to identify the one time code.
        ///
        /// Parameter `recordIdentifier`: An optional string to uniquely identify this record in your local database.
        #[unsafe(method(initWithServiceIdentifier:label:recordIdentifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithServiceIdentifier_label_recordIdentifier(
            this: Allocated<Self>,
            service_identifier: &ASCredentialServiceIdentifier,
            label: &NSString,
            record_identifier: Option<&NSString>,
        ) -> Retained<Self>;

        /// A label to identify the one time code, typically supplied by the user.
        /// This string will be shown in the AutoFill suggestion for this one time code credential.
        #[unsafe(method(label))]
        #[unsafe(method_family = none)]
        pub unsafe fn label(&self) -> Retained<NSString>;
    );
}

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