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