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

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

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

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

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

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

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

impl ASPasswordCredential {
    extern_methods!(
        /// Initializes an ASPasswordCredential object.
        ///
        /// Parameter `user`: the user.
        ///
        /// Parameter `password`: the password.
        #[unsafe(method(initWithUser:password:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithUser_password(
            this: Allocated<Self>,
            user: &NSString,
            password: &NSString,
        ) -> Retained<Self>;

        /// Creates and initializes a new ASPasswordCredential object.
        ///
        /// Parameter `user`: the user.
        ///
        /// Parameter `password`: the password.
        #[unsafe(method(credentialWithUser:password:))]
        #[unsafe(method_family = none)]
        pub unsafe fn credentialWithUser_password(
            user: &NSString,
            password: &NSString,
        ) -> Retained<Self>;

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

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

/// Methods declared on superclass `NSObject`.
impl ASPasswordCredential {
    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>;
    );
}