objc2_authentication_services/generated/ASWebAuthenticationSessionCallback.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// An object used to evaluate navigation events in an authentication session. When the session navigates
11 /// to a matching URL, it will pass the URL to the session completion handler.
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsessioncallback?language=objc)
14 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct ASWebAuthenticationSessionCallback;
17);
18
19unsafe impl Send for ASWebAuthenticationSessionCallback {}
20
21unsafe impl Sync for ASWebAuthenticationSessionCallback {}
22
23extern_conformance!(
24 unsafe impl NSObjectProtocol for ASWebAuthenticationSessionCallback {}
25);
26
27impl ASWebAuthenticationSessionCallback {
28 extern_methods!(
29 /// Creates a callback object that matches against URLs with the given custom scheme.
30 ///
31 /// Parameter `customScheme`: The custom scheme that the app expects in the callback URL.
32 #[unsafe(method(callbackWithCustomScheme:))]
33 #[unsafe(method_family = none)]
34 pub unsafe fn callbackWithCustomScheme(custom_scheme: &NSString) -> Retained<Self>;
35
36 /// Creates a callback object that matches against HTTPS URLs with the given host and path.
37 ///
38 /// Parameter `host`: The host that the app expects in the callback URL. The host must be associated with the
39 /// app using associated web credentials domains.
40 ///
41 /// Parameter `path`: The path that the app expects in the callback URL.
42 #[unsafe(method(callbackWithHTTPSHost:path:))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn callbackWithHTTPSHost_path(
45 host: &NSString,
46 path: &NSString,
47 ) -> Retained<Self>;
48
49 #[unsafe(method(init))]
50 #[unsafe(method_family = init)]
51 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
52
53 #[unsafe(method(new))]
54 #[unsafe(method_family = new)]
55 pub unsafe fn new() -> Retained<Self>;
56
57 /// Check whether a given main-frame navigation URL matches the callback expected by the client app. Handles all URL-based callback strategies, including custom schemes and HTTPS navigations.
58 /// This is mainly meant for web browsers adopting the ASWebAuthenticationWebBrowser API, but may also be useful for other apps for debugging purposes.
59 ///
60 /// Parameter `url`: The URL to check.
61 #[unsafe(method(matchesURL:))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn matchesURL(&self, url: &NSURL) -> bool;
64 );
65}