objc2_pass_kit/generated/
PKIdentityRequest.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    /// Request for information from an identity document stored as a Wallet pass.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentityrequest?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct PKIdentityRequest;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for PKIdentityRequest {}
21);
22
23impl PKIdentityRequest {
24    extern_methods!(
25        #[cfg(feature = "PKIdentityDocumentDescriptor")]
26        /// A descriptor describing the identity document to request.
27        #[unsafe(method(descriptor))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn descriptor(
30            &self,
31        ) -> Option<Retained<ProtocolObject<dyn PKIdentityDocumentDescriptor>>>;
32
33        #[cfg(feature = "PKIdentityDocumentDescriptor")]
34        /// Setter for [`descriptor`][Self::descriptor].
35        #[unsafe(method(setDescriptor:))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn setDescriptor(
38            &self,
39            descriptor: Option<&ProtocolObject<dyn PKIdentityDocumentDescriptor>>,
40        );
41
42        /// A caller-specified nonce that will be included in the signed response payload.
43        /// This is treated as opaque by the PKIdentityAuthorizationController, and has a
44        /// maximum allowed size of 64 bytes.
45        #[unsafe(method(nonce))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn nonce(&self) -> Option<Retained<NSData>>;
48
49        /// Setter for [`nonce`][Self::nonce].
50        #[unsafe(method(setNonce:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setNonce(&self, nonce: Option<&NSData>);
53
54        /// Identifies the merchant making the request, as previously agreed with Apple.
55        /// This must match one of the merchant identifiers in the application's entitlement.
56        /// This property must be set when requestDocument is invoked.
57        #[unsafe(method(merchantIdentifier))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn merchantIdentifier(&self) -> Option<Retained<NSString>>;
60
61        /// Setter for [`merchantIdentifier`][Self::merchantIdentifier].
62        #[unsafe(method(setMerchantIdentifier:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setMerchantIdentifier(&self, merchant_identifier: Option<&NSString>);
65    );
66}
67
68/// Methods declared on superclass `NSObject`.
69impl PKIdentityRequest {
70    extern_methods!(
71        #[unsafe(method(init))]
72        #[unsafe(method_family = init)]
73        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
74
75        #[unsafe(method(new))]
76        #[unsafe(method_family = new)]
77        pub unsafe fn new() -> Retained<Self>;
78    );
79}