objc2-accounts 0.3.2

Bindings to the Accounts 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/accounts/acaccountcredential?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
    pub struct ACAccountCredential;
);

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

impl ACAccountCredential {
    extern_methods!(
        /// # Safety
        ///
        /// - `token` might not allow `None`.
        /// - `secret` might not allow `None`.
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(initWithOAuthToken:tokenSecret:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithOAuthToken_tokenSecret(
            this: Allocated<Self>,
            token: Option<&NSString>,
            secret: Option<&NSString>,
        ) -> Option<Retained<Self>>;

        /// # Safety
        ///
        /// - `token` might not allow `None`.
        /// - `refresh_token` might not allow `None`.
        /// - `expiry_date` might not allow `None`.
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(initWithOAuth2Token:refreshToken:expiryDate:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithOAuth2Token_refreshToken_expiryDate(
            this: Allocated<Self>,
            token: Option<&NSString>,
            refresh_token: Option<&NSString>,
            expiry_date: Option<&NSDate>,
        ) -> Option<Retained<Self>>;

        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(oauthToken))]
        #[unsafe(method_family = none)]
        pub unsafe fn oauthToken(&self) -> Retained<NSString>;

        /// Setter for [`oauthToken`][Self::oauthToken].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
        #[unsafe(method(setOauthToken:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOauthToken(&self, oauth_token: Option<&NSString>);
    );
}

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