objc2_pass_kit/generated/
PKAddIdentityDocumentConfiguration.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
10/// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddidentitydocumenttype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct PKAddIdentityDocumentType(pub NSInteger);
15impl PKAddIdentityDocumentType {
16    #[doc(alias = "PKAddIdentityDocumentTypeIDCard")]
17    pub const IDCard: Self = Self(0);
18    #[doc(alias = "PKAddIdentityDocumentTypeMDL")]
19    pub const MDL: Self = Self(1);
20    #[doc(alias = "PKAddIdentityDocumentTypePhotoID")]
21    pub const PhotoID: Self = Self(2);
22}
23
24unsafe impl Encode for PKAddIdentityDocumentType {
25    const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for PKAddIdentityDocumentType {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_class!(
33    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentitydocumentmetadata?language=objc)
34    #[unsafe(super(NSObject))]
35    #[derive(Debug, PartialEq, Eq, Hash)]
36    pub struct PKIdentityDocumentMetadata;
37);
38
39extern_conformance!(
40    unsafe impl NSObjectProtocol for PKIdentityDocumentMetadata {}
41);
42
43impl PKIdentityDocumentMetadata {
44    extern_methods!(
45        #[unsafe(method(init))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49        #[unsafe(method(new))]
50        #[unsafe(method_family = new)]
51        pub unsafe fn new() -> Retained<Self>;
52
53        /// credentialIdentifier: A unique identifier for provisioning credential data.
54        #[unsafe(method(credentialIdentifier))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn credentialIdentifier(&self) -> Retained<NSString>;
57
58        /// sharingInstanceIdentifier: A unique identifier that refers to an instance of sharing of credentials to a user's device initiated from another user, device, or web.
59        #[unsafe(method(sharingInstanceIdentifier))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn sharingInstanceIdentifier(&self) -> Retained<NSString>;
62
63        /// cardTemplateIdentifier: Identifier referencing a card template registered by developers in web portal - identifies a combination of cardProfileIdentifier, cardConfigurationIdentifier, and cardArtBundleName.
64        /// Returns empty string if no identifier is set.
65        #[unsafe(method(cardTemplateIdentifier))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn cardTemplateIdentifier(&self) -> Retained<NSString>;
68
69        /// cardConfigurationIdentifier: Identifier referencing a card configuration registered by developers.
70        /// Returns empty string if no identifier is set.
71        #[unsafe(method(cardConfigurationIdentifier))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn cardConfigurationIdentifier(&self) -> Retained<NSString>;
74
75        /// serverEnvironmentIdentifier: Identifier referencing the target server environment Apple Pay servers should reach out to to provision this pass.
76        /// If not present, the default Apply Pay server environment will be used and an empty string will be returned.
77        #[unsafe(method(serverEnvironmentIdentifier))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn serverEnvironmentIdentifier(&self) -> Retained<NSString>;
80
81        /// Setter for [`serverEnvironmentIdentifier`][Self::serverEnvironmentIdentifier].
82        #[unsafe(method(setServerEnvironmentIdentifier:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setServerEnvironmentIdentifier(
85            &self,
86            server_environment_identifier: &NSString,
87        );
88
89        /// issuingCountryCode: identifies the issuing country of the identity document
90        #[unsafe(method(issuingCountryCode))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn issuingCountryCode(&self) -> Retained<NSString>;
93
94        /// identityDocumentType: identifies the type of the identity document
95        #[unsafe(method(documentType))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn documentType(&self) -> PKAddIdentityDocumentType;
98    );
99}
100
101extern_class!(
102    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddidentitydocumentmetadata?language=objc)
103    #[unsafe(super(PKIdentityDocumentMetadata, NSObject))]
104    #[derive(Debug, PartialEq, Eq, Hash)]
105    pub struct PKAddIdentityDocumentMetadata;
106);
107
108extern_conformance!(
109    unsafe impl NSObjectProtocol for PKAddIdentityDocumentMetadata {}
110);
111
112impl PKAddIdentityDocumentMetadata {
113    extern_methods!(
114        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
115        /// Initialize with parameters configured by issuer's server to indicate the specific product instance to provision.
116        /// - Properties:
117        /// - provisioningCredentialIdentifier: Identifies this user's instance for provisioning.
118        /// - sharingInstanceIdentifier: A short lived token to prevent replay-ability.
119        /// - cardTemplateIdentifier: An identifier for a legacy product on our Apple Pay servers.
120        /// - preview: Object containing information to represent the pass to provision in our UI.
121        /// - issuingCountryCode:  identifies the issuing country of the identity document
122        /// - identityDocumentType: identifies the type of the identity document
123        /// - preview: Object containing information to represent the pass to provision in our UI.
124        #[unsafe(method(initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardTemplateIdentifier:issuingCountryCode:documentType:preview:))]
125        #[unsafe(method_family = init)]
126        pub unsafe fn initWithProvisioningCredentialIdentifier_sharingInstanceIdentifier_cardTemplateIdentifier_issuingCountryCode_documentType_preview(
127            this: Allocated<Self>,
128            credential_identifier: &NSString,
129            sharing_instance_identifier: &NSString,
130            template_identifier: &NSString,
131            issuing_country_code: &NSString,
132            document_type: PKAddIdentityDocumentType,
133            preview: &PKAddPassMetadataPreview,
134        ) -> Retained<Self>;
135
136        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
137        /// preview: A preview object containing the necessary information to represent the pass during provisioning.
138        #[unsafe(method(preview))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn preview(&self) -> Retained<PKAddPassMetadataPreview>;
141    );
142}
143
144/// Methods declared on superclass `PKIdentityDocumentMetadata`.
145impl PKAddIdentityDocumentMetadata {
146    extern_methods!(
147        #[unsafe(method(init))]
148        #[unsafe(method_family = init)]
149        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
150
151        #[unsafe(method(new))]
152        #[unsafe(method_family = new)]
153        pub unsafe fn new() -> Retained<Self>;
154    );
155}
156
157extern_class!(
158    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkjapanindividualnumbercardmetadata?language=objc)
159    #[unsafe(super(PKIdentityDocumentMetadata, NSObject))]
160    #[derive(Debug, PartialEq, Eq, Hash)]
161    pub struct PKJapanIndividualNumberCardMetadata;
162);
163
164extern_conformance!(
165    unsafe impl NSObjectProtocol for PKJapanIndividualNumberCardMetadata {}
166);
167
168impl PKJapanIndividualNumberCardMetadata {
169    extern_methods!(
170        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
171        /// Initialize with parameters configured by issuer's server to indicate the specific product instance to provision.
172        /// - Properties:
173        /// - provisioningCredentialIdentifier: Identifies this user's instance for provisioning.
174        /// - sharingInstanceIdentifier: A short lived token to prevent replay-ability.
175        /// - cardTemplateIdentifier: An identifier for a legacy product on our Apple Pay servers.
176        /// - preview: Object containing information to represent the pass to provision in our UI.
177        #[unsafe(method(initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardTemplateIdentifier:preview:))]
178        #[unsafe(method_family = init)]
179        pub unsafe fn initWithProvisioningCredentialIdentifier_sharingInstanceIdentifier_cardTemplateIdentifier_preview(
180            this: Allocated<Self>,
181            credential_identifier: &NSString,
182            sharing_instance_identifier: &NSString,
183            template_identifier: &NSString,
184            preview: &PKAddPassMetadataPreview,
185        ) -> Retained<Self>;
186
187        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
188        /// Initialize with parameters configured by issuer's server to indicate the specific product instance to provision.
189        /// - Properties:
190        /// - provisioningCredentialIdentifier: Identifies this user's instance for provisioning.
191        /// - sharingInstanceIdentifier: A short lived token to prevent replay-ability.
192        /// - cardConfigurationIdentifier: An identifier for a product on our Apple Pay servers.
193        /// - preview: Object containing information to represent the pass to provision in our UI.
194        #[unsafe(method(initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardConfigurationIdentifier:preview:))]
195        #[unsafe(method_family = init)]
196        pub unsafe fn initWithProvisioningCredentialIdentifier_sharingInstanceIdentifier_cardConfigurationIdentifier_preview(
197            this: Allocated<Self>,
198            credential_identifier: &NSString,
199            sharing_instance_identifier: &NSString,
200            card_configuration_identifier: &NSString,
201            preview: &PKAddPassMetadataPreview,
202        ) -> Retained<Self>;
203
204        /// Raw authentication password used to protect authentication functionality.
205        /// If configured in the pass, this functionality allows users to present their identity credentials to external parties.
206        #[unsafe(method(authenticationPassword))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn authenticationPassword(&self) -> Option<Retained<NSString>>;
209
210        /// Setter for [`authenticationPassword`][Self::authenticationPassword].
211        ///
212        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
213        #[unsafe(method(setAuthenticationPassword:))]
214        #[unsafe(method_family = none)]
215        pub unsafe fn setAuthenticationPassword(&self, authentication_password: Option<&NSString>);
216
217        /// Raw signing password used to protect signing functionality.
218        /// If configured in the pass, this functionality allows users to digitally sign with external parties or print officially signed documents.
219        #[unsafe(method(signingPassword))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn signingPassword(&self) -> Option<Retained<NSString>>;
222
223        /// Setter for [`signingPassword`][Self::signingPassword].
224        ///
225        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
226        #[unsafe(method(setSigningPassword:))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn setSigningPassword(&self, signing_password: Option<&NSString>);
229
230        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
231        /// preview: A preview object containing the necessary information to represent the pass during provisioning.
232        #[unsafe(method(preview))]
233        #[unsafe(method_family = none)]
234        pub unsafe fn preview(&self) -> Retained<PKAddPassMetadataPreview>;
235
236        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
237        /// Setter for [`preview`][Self::preview].
238        #[unsafe(method(setPreview:))]
239        #[unsafe(method_family = none)]
240        pub unsafe fn setPreview(&self, preview: &PKAddPassMetadataPreview);
241    );
242}
243
244/// Methods declared on superclass `PKIdentityDocumentMetadata`.
245impl PKJapanIndividualNumberCardMetadata {
246    extern_methods!(
247        #[unsafe(method(init))]
248        #[unsafe(method_family = init)]
249        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
250
251        #[unsafe(method(new))]
252        #[unsafe(method_family = new)]
253        pub unsafe fn new() -> Retained<Self>;
254    );
255}
256
257extern_class!(
258    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddidentitydocumentconfiguration?language=objc)
259    #[unsafe(super(PKAddSecureElementPassConfiguration, NSObject))]
260    #[derive(Debug, PartialEq, Eq, Hash)]
261    #[cfg(feature = "PKAddSecureElementPassConfiguration")]
262    pub struct PKAddIdentityDocumentConfiguration;
263);
264
265#[cfg(feature = "PKAddSecureElementPassConfiguration")]
266extern_conformance!(
267    unsafe impl NSObjectProtocol for PKAddIdentityDocumentConfiguration {}
268);
269
270#[cfg(feature = "PKAddSecureElementPassConfiguration")]
271impl PKAddIdentityDocumentConfiguration {
272    extern_methods!(
273        #[cfg(feature = "block2")]
274        /// Initialize identity document configuration with corresponding identity document metadata.
275        /// - Parameters:
276        /// - metadata: Set of configured metadata defining the required information to add the corresponding pass to Wallet.
277        /// - completion: Returns the identity document configuration if successful, otherwise returns an error.
278        #[unsafe(method(configurationForMetadata:completion:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn configurationForMetadata_completion(
281            metadata: &PKIdentityDocumentMetadata,
282            completion: &block2::DynBlock<
283                dyn Fn(*mut PKAddIdentityDocumentConfiguration, *mut NSError),
284            >,
285        );
286
287        /// metadata: Set of configured metadata defining the required information to add the corresponding pass to Wallet.
288        #[unsafe(method(metadata))]
289        #[unsafe(method_family = none)]
290        pub unsafe fn metadata(&self) -> Retained<PKIdentityDocumentMetadata>;
291    );
292}
293
294/// Methods declared on superclass `PKAddSecureElementPassConfiguration`.
295#[cfg(feature = "PKAddSecureElementPassConfiguration")]
296impl PKAddIdentityDocumentConfiguration {
297    extern_methods!(
298        #[unsafe(method(init))]
299        #[unsafe(method_family = init)]
300        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
301
302        #[unsafe(method(new))]
303        #[unsafe(method_family = new)]
304        pub unsafe fn new() -> Retained<Self>;
305    );
306}