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::Foundation::*;

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

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

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

        #[method_id(@__retain_semantics Other credentialsForProtectionSpace:)]
        pub unsafe fn credentialsForProtectionSpace(
            &self,
            space: &NSURLProtectionSpace,
        ) -> Option<Id<NSDictionary<NSString, NSURLCredential>, Shared>>;

        #[method_id(@__retain_semantics Other allCredentials)]
        pub unsafe fn allCredentials(
            &self,
        ) -> Id<NSDictionary<NSURLProtectionSpace, NSDictionary<NSString, NSURLCredential>>, Shared>;

        #[method(setCredential:forProtectionSpace:)]
        pub unsafe fn setCredential_forProtectionSpace(
            &self,
            credential: &NSURLCredential,
            space: &NSURLProtectionSpace,
        );

        #[method(removeCredential:forProtectionSpace:)]
        pub unsafe fn removeCredential_forProtectionSpace(
            &self,
            credential: &NSURLCredential,
            space: &NSURLProtectionSpace,
        );

        #[method(removeCredential:forProtectionSpace:options:)]
        pub unsafe fn removeCredential_forProtectionSpace_options(
            &self,
            credential: &NSURLCredential,
            space: &NSURLProtectionSpace,
            options: Option<&NSDictionary<NSString, Object>>,
        );

        #[method_id(@__retain_semantics Other defaultCredentialForProtectionSpace:)]
        pub unsafe fn defaultCredentialForProtectionSpace(
            &self,
            space: &NSURLProtectionSpace,
        ) -> Option<Id<NSURLCredential, Shared>>;

        #[method(setDefaultCredential:forProtectionSpace:)]
        pub unsafe fn setDefaultCredential_forProtectionSpace(
            &self,
            credential: &NSURLCredential,
            space: &NSURLProtectionSpace,
        );
    }
);

extern_methods!(
    /// NSURLSessionTaskAdditions
    unsafe impl NSURLCredentialStorage {
        #[method(getCredentialsForProtectionSpace:task:completionHandler:)]
        pub unsafe fn getCredentialsForProtectionSpace_task_completionHandler(
            &self,
            protectionSpace: &NSURLProtectionSpace,
            task: &NSURLSessionTask,
            completionHandler: &Block<(*mut NSDictionary<NSString, NSURLCredential>,), ()>,
        );

        #[method(setCredential:forProtectionSpace:task:)]
        pub unsafe fn setCredential_forProtectionSpace_task(
            &self,
            credential: &NSURLCredential,
            protectionSpace: &NSURLProtectionSpace,
            task: &NSURLSessionTask,
        );

        #[method(removeCredential:forProtectionSpace:options:task:)]
        pub unsafe fn removeCredential_forProtectionSpace_options_task(
            &self,
            credential: &NSURLCredential,
            protectionSpace: &NSURLProtectionSpace,
            options: Option<&NSDictionary<NSString, Object>>,
            task: &NSURLSessionTask,
        );

        #[method(getDefaultCredentialForProtectionSpace:task:completionHandler:)]
        pub unsafe fn getDefaultCredentialForProtectionSpace_task_completionHandler(
            &self,
            space: &NSURLProtectionSpace,
            task: &NSURLSessionTask,
            completionHandler: &Block<(*mut NSURLCredential,), ()>,
        );

        #[method(setDefaultCredential:forProtectionSpace:task:)]
        pub unsafe fn setDefaultCredential_forProtectionSpace_task(
            &self,
            credential: &NSURLCredential,
            protectionSpace: &NSURLProtectionSpace,
            task: &NSURLSessionTask,
        );
    }
);

extern_static!(NSURLCredentialStorageChangedNotification: &'static NSNotificationName);

extern_static!(NSURLCredentialStorageRemoveSynchronizableCredentials: &'static NSString);