use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait ASWebAuthenticationSessionRequestDelegate: NSObjectProtocol {
#[optional]
#[unsafe(method(authenticationSessionRequest:didCompleteWithCallbackURL:))]
#[unsafe(method_family = none)]
unsafe fn authenticationSessionRequest_didCompleteWithCallbackURL(
&self,
authentication_session_request: &ASWebAuthenticationSessionRequest,
callback_url: &NSURL,
);
#[optional]
#[unsafe(method(authenticationSessionRequest:didCancelWithError:))]
#[unsafe(method_family = none)]
unsafe fn authenticationSessionRequest_didCancelWithError(
&self,
authentication_session_request: &ASWebAuthenticationSessionRequest,
error: &NSError,
);
}
);
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct ASWebAuthenticationSessionRequest;
);
extern_conformance!(
unsafe impl NSCoding for ASWebAuthenticationSessionRequest {}
);
extern_conformance!(
unsafe impl NSCopying for ASWebAuthenticationSessionRequest {}
);
unsafe impl CopyingHelper for ASWebAuthenticationSessionRequest {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for ASWebAuthenticationSessionRequest {}
);
extern_conformance!(
unsafe impl NSSecureCoding for ASWebAuthenticationSessionRequest {}
);
impl ASWebAuthenticationSessionRequest {
extern_methods!(
#[unsafe(method(UUID))]
#[unsafe(method_family = none)]
pub unsafe fn UUID(&self) -> Retained<NSUUID>;
#[unsafe(method(URL))]
#[unsafe(method_family = none)]
pub unsafe fn URL(&self) -> Retained<NSURL>;
#[deprecated = "Use `callback` to match all callback types."]
#[unsafe(method(callbackURLScheme))]
#[unsafe(method_family = none)]
pub unsafe fn callbackURLScheme(&self) -> Option<Retained<NSString>>;
#[unsafe(method(shouldUseEphemeralSession))]
#[unsafe(method_family = none)]
pub unsafe fn shouldUseEphemeralSession(&self) -> bool;
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn ASWebAuthenticationSessionRequestDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn ASWebAuthenticationSessionRequestDelegate>>,
);
#[unsafe(method(additionalHeaderFields))]
#[unsafe(method_family = none)]
pub unsafe fn additionalHeaderFields(
&self,
) -> Option<Retained<NSDictionary<NSString, NSString>>>;
#[cfg(feature = "ASWebAuthenticationSessionCallback")]
#[unsafe(method(callback))]
#[unsafe(method_family = none)]
pub unsafe fn callback(&self) -> Option<Retained<ASWebAuthenticationSessionCallback>>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(cancelWithError:))]
#[unsafe(method_family = none)]
pub unsafe fn cancelWithError(&self, error: &NSError);
#[unsafe(method(completeWithCallbackURL:))]
#[unsafe(method_family = none)]
pub unsafe fn completeWithCallbackURL(&self, url: &NSURL);
);
}