objc2_pass_kit/generated/PKIdentityAuthorizationController.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 /// Used to request information from an identity document stored as a Wallet pass.
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentityauthorizationcontroller?language=objc)
14 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct PKIdentityAuthorizationController;
17);
18
19extern_conformance!(
20 unsafe impl NSObjectProtocol for PKIdentityAuthorizationController {}
21);
22
23impl PKIdentityAuthorizationController {
24 extern_methods!(
25 #[cfg(all(feature = "PKIdentityDocumentDescriptor", feature = "block2"))]
26 /// Determines if a document can be requested, taking into account the entitlement of the
27 /// calling process as well as the state of this device.
28 #[unsafe(method(checkCanRequestDocument:completion:))]
29 #[unsafe(method_family = none)]
30 pub unsafe fn checkCanRequestDocument_completion(
31 &self,
32 descriptor: &ProtocolObject<dyn PKIdentityDocumentDescriptor>,
33 completion: &block2::DynBlock<dyn Fn(Bool)>,
34 );
35
36 #[cfg(all(
37 feature = "PKIdentityDocument",
38 feature = "PKIdentityRequest",
39 feature = "block2"
40 ))]
41 /// Requests identity document information from the user. The user will be prompted to approve
42 /// the request before any data is released.
43 /// If the user approves, the document will be returned through the completion handler.
44 /// If the user does not approve, PKIdentityErrorUserCancelled will be returned through
45 /// the completion handler.
46 /// If the request is cancelled by the calling app through cancelRequest, PKIdentityErrorAppCancelled
47 /// will be returned.
48 /// Only one request can be in progress at a time, otherwise PKIdentityErrorRequestAlreadyInProgress
49 /// will be returned.
50 #[unsafe(method(requestDocument:completion:))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn requestDocument_completion(
53 &self,
54 request: &PKIdentityRequest,
55 completion: &block2::DynBlock<dyn Fn(*mut PKIdentityDocument, *mut NSError)>,
56 );
57
58 /// If there is a request in progress through requestDocument, this will cancel that request
59 /// if possible. If the request is cancelled, PKIdentityErrorAppCancelled will be returned in the
60 /// requestDocument:completion: completion handler. Cancellation is not guaranteed; even if
61 /// this method is called, it is possible that requestDocument:completion: will return a document
62 /// response if a response was already in flight.
63 #[unsafe(method(cancelRequest))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn cancelRequest(&self);
66 );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl PKIdentityAuthorizationController {
71 extern_methods!(
72 #[unsafe(method(init))]
73 #[unsafe(method_family = init)]
74 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76 #[unsafe(method(new))]
77 #[unsafe(method_family = new)]
78 pub unsafe fn new() -> Retained<Self>;
79 );
80}