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

typed_extensible_enum!(
    pub type ASAuthorizationProviderAuthorizationOperation = NSString;
);

extern_static!(
    ASAuthorizationProviderAuthorizationOperationConfigurationRemoved:
        &'static ASAuthorizationProviderAuthorizationOperation
);

extern_protocol!(
    pub struct ASAuthorizationProviderExtensionAuthorizationRequestHandler;

    unsafe impl ProtocolType for ASAuthorizationProviderExtensionAuthorizationRequestHandler {
        #[method(beginAuthorizationWithRequest:)]
        pub unsafe fn beginAuthorizationWithRequest(
            &self,
            request: &ASAuthorizationProviderExtensionAuthorizationRequest,
        );

        #[optional]
        #[method(cancelAuthorizationWithRequest:)]
        pub unsafe fn cancelAuthorizationWithRequest(
            &self,
            request: &ASAuthorizationProviderExtensionAuthorizationRequest,
        );
    }
);

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

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

extern_methods!(
    unsafe impl ASAuthorizationProviderExtensionAuthorizationRequest {
        #[method(doNotHandle)]
        pub unsafe fn doNotHandle(&self);

        #[method(cancel)]
        pub unsafe fn cancel(&self);

        #[method(complete)]
        pub unsafe fn complete(&self);

        #[method(completeWithHTTPAuthorizationHeaders:)]
        pub unsafe fn completeWithHTTPAuthorizationHeaders(
            &self,
            httpAuthorizationHeaders: &NSDictionary<NSString, NSString>,
        );

        #[method(completeWithHTTPResponse:httpBody:)]
        pub unsafe fn completeWithHTTPResponse_httpBody(
            &self,
            httpResponse: &NSHTTPURLResponse,
            httpBody: Option<&NSData>,
        );

        #[method(completeWithAuthorizationResult:)]
        pub unsafe fn completeWithAuthorizationResult(
            &self,
            authorizationResult: &ASAuthorizationProviderExtensionAuthorizationResult,
        );

        #[method(completeWithError:)]
        pub unsafe fn completeWithError(&self, error: &NSError);

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

        #[method_id(@__retain_semantics Other url)]
        pub unsafe fn url(&self) -> Id<NSURL, Shared>;

        #[method_id(@__retain_semantics Other requestedOperation)]
        pub unsafe fn requestedOperation(
            &self,
        ) -> Id<ASAuthorizationProviderAuthorizationOperation, Shared>;

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

        #[method_id(@__retain_semantics Other httpBody)]
        pub unsafe fn httpBody(&self) -> Id<NSData, Shared>;

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

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

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

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

        #[method(isCallerManaged)]
        pub unsafe fn isCallerManaged(&self) -> bool;

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

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

        #[method(isUserInterfaceEnabled)]
        pub unsafe fn isUserInterfaceEnabled(&self) -> bool;
    }
);