icrate 0.0.1

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AuthenticationServices::*;
use crate::Foundation::*;

extern_static!(ASCredentialIdentityStoreErrorDomain: &'static NSErrorDomain);

ns_error_enum!(
    #[underlying(NSInteger)]
    pub enum ASCredentialIdentityStoreErrorCode {
        ASCredentialIdentityStoreErrorCodeInternalError = 0,
        ASCredentialIdentityStoreErrorCodeStoreDisabled = 1,
        ASCredentialIdentityStoreErrorCodeStoreBusy = 2,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ASCredentialIdentityStore;

    unsafe impl ClassType for ASCredentialIdentityStore {
        type Super = NSObject;
    }
);

extern_methods!(
    unsafe impl ASCredentialIdentityStore {
        #[method_id(@__retain_semantics Other sharedStore)]
        pub unsafe fn sharedStore() -> Id<ASCredentialIdentityStore, Shared>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;

        #[method(getCredentialIdentityStoreStateWithCompletion:)]
        pub unsafe fn getCredentialIdentityStoreStateWithCompletion(
            &self,
            completion: &Block<(NonNull<ASCredentialIdentityStoreState>,), ()>,
        );

        #[method(saveCredentialIdentities:completion:)]
        pub unsafe fn saveCredentialIdentities_completion(
            &self,
            credentialIdentities: &NSArray<ASPasswordCredentialIdentity>,
            completion: Option<&Block<(Bool, *mut NSError), ()>>,
        );

        #[method(removeCredentialIdentities:completion:)]
        pub unsafe fn removeCredentialIdentities_completion(
            &self,
            credentialIdentities: &NSArray<ASPasswordCredentialIdentity>,
            completion: Option<&Block<(Bool, *mut NSError), ()>>,
        );

        #[method(removeAllCredentialIdentitiesWithCompletion:)]
        pub unsafe fn removeAllCredentialIdentitiesWithCompletion(
            &self,
            completion: Option<&Block<(Bool, *mut NSError), ()>>,
        );

        #[method(replaceCredentialIdentitiesWithIdentities:completion:)]
        pub unsafe fn replaceCredentialIdentitiesWithIdentities_completion(
            &self,
            newCredentialIdentities: &NSArray<ASPasswordCredentialIdentity>,
            completion: Option<&Block<(Bool, *mut NSError), ()>>,
        );
    }
);