objc2_pass_kit/generated/
PKAddShareablePassConfiguration.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::*;
6#[cfg(feature = "objc2-core-graphics")]
7use objc2_core_graphics::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkshareablepassmetadatapreview?language=objc)
14    #[unsafe(super(PKAddPassMetadataPreview, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "PKAddSecureElementPassConfiguration")]
17    pub struct PKShareablePassMetadataPreview;
18);
19
20#[cfg(feature = "PKAddSecureElementPassConfiguration")]
21extern_conformance!(
22    unsafe impl NSObjectProtocol for PKShareablePassMetadataPreview {}
23);
24
25#[cfg(feature = "PKAddSecureElementPassConfiguration")]
26impl PKShareablePassMetadataPreview {
27    extern_methods!(
28        #[unsafe(method(initWithTemplateIdentifier:))]
29        #[unsafe(method_family = init)]
30        pub unsafe fn initWithTemplateIdentifier(
31            this: Allocated<Self>,
32            template_identifier: &NSString,
33        ) -> Retained<Self>;
34
35        #[unsafe(method(previewWithTemplateIdentifier:))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn previewWithTemplateIdentifier(
38            template_identifier: &NSString,
39        ) -> Retained<Self>;
40
41        #[unsafe(method(ownerDisplayName))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn ownerDisplayName(&self) -> Option<Retained<NSString>>;
44
45        /// Setter for [`ownerDisplayName`][Self::ownerDisplayName].
46        #[unsafe(method(setOwnerDisplayName:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn setOwnerDisplayName(&self, owner_display_name: Option<&NSString>);
49
50        #[unsafe(method(provisioningTemplateIdentifier))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn provisioningTemplateIdentifier(&self) -> Option<Retained<NSString>>;
53    );
54}
55
56/// Methods declared on superclass `PKAddPassMetadataPreview`.
57#[cfg(feature = "PKAddSecureElementPassConfiguration")]
58impl PKShareablePassMetadataPreview {
59    extern_methods!(
60        #[cfg(feature = "objc2-core-graphics")]
61        /// Initializer preview object to represent the pass being added to Wallet.which requires a CGImage of the pass's card art and a localized description.
62        /// - Properties:
63        /// - passThumbnail: CGImage representing the card artwork of the pass to be presented during provisioning.
64        /// - localizedDescription: Localized description of the pass.
65        #[unsafe(method(initWithPassThumbnail:localizedDescription:))]
66        #[unsafe(method_family = init)]
67        pub unsafe fn initWithPassThumbnail_localizedDescription(
68            this: Allocated<Self>,
69            pass_thumbnail: &CGImage,
70            description: &NSString,
71        ) -> Retained<Self>;
72
73        #[cfg(feature = "objc2-core-graphics")]
74        #[unsafe(method(previewWithPassThumbnail:localizedDescription:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn previewWithPassThumbnail_localizedDescription(
77            pass_thumbnail: &CGImage,
78            description: &NSString,
79        ) -> Retained<Self>;
80
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new() -> Retained<Self>;
88    );
89}
90
91extern_class!(
92    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkshareablepassmetadata?language=objc)
93    #[unsafe(super(NSObject))]
94    #[derive(Debug, PartialEq, Eq, Hash)]
95    pub struct PKShareablePassMetadata;
96);
97
98extern_conformance!(
99    unsafe impl NSObjectProtocol for PKShareablePassMetadata {}
100);
101
102impl PKShareablePassMetadata {
103    extern_methods!(
104        #[cfg(feature = "objc2-core-graphics")]
105        #[deprecated = "Use initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardConfigurationIdentifier:passPreviewMetadata:"]
106        #[unsafe(method(initWithProvisioningCredentialIdentifier:cardConfigurationIdentifier:sharingInstanceIdentifier:passThumbnailImage:ownerDisplayName:localizedDescription:))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn initWithProvisioningCredentialIdentifier_cardConfigurationIdentifier_sharingInstanceIdentifier_passThumbnailImage_ownerDisplayName_localizedDescription(
109            this: Allocated<Self>,
110            credential_identifier: &NSString,
111            card_configuration_identifier: &NSString,
112            sharing_instance_identifier: &NSString,
113            pass_thumbnail_image: &CGImage,
114            owner_display_name: &NSString,
115            localized_description: &NSString,
116        ) -> Option<Retained<Self>>;
117
118        #[cfg(feature = "objc2-core-graphics")]
119        #[deprecated = "Use initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardTemplateIdentifier:passPreviewMetadata:"]
120        #[unsafe(method(initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:passThumbnailImage:ownerDisplayName:localizedDescription:accountHash:templateIdentifier:relyingPartyIdentifier:requiresUnifiedAccessCapableDevice:))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn initWithProvisioningCredentialIdentifier_sharingInstanceIdentifier_passThumbnailImage_ownerDisplayName_localizedDescription_accountHash_templateIdentifier_relyingPartyIdentifier_requiresUnifiedAccessCapableDevice(
123            this: Allocated<Self>,
124            credential_identifier: &NSString,
125            sharing_instance_identifier: &NSString,
126            pass_thumbnail_image: &CGImage,
127            owner_display_name: &NSString,
128            localized_description: &NSString,
129            account_hash: &NSString,
130            template_identifier: &NSString,
131            relying_party_identifier: &NSString,
132            requires_unified_access_capable_device: bool,
133        ) -> Retained<Self>;
134
135        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
136        #[unsafe(method(initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardTemplateIdentifier:preview:))]
137        #[unsafe(method_family = init)]
138        pub unsafe fn initWithProvisioningCredentialIdentifier_sharingInstanceIdentifier_cardTemplateIdentifier_preview(
139            this: Allocated<Self>,
140            credential_identifier: &NSString,
141            sharing_instance_identifier: &NSString,
142            template_identifier: &NSString,
143            preview: &PKShareablePassMetadataPreview,
144        ) -> Retained<Self>;
145
146        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
147        #[unsafe(method(initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardConfigurationIdentifier:preview:))]
148        #[unsafe(method_family = init)]
149        pub unsafe fn initWithProvisioningCredentialIdentifier_sharingInstanceIdentifier_cardConfigurationIdentifier_preview(
150            this: Allocated<Self>,
151            credential_identifier: &NSString,
152            sharing_instance_identifier: &NSString,
153            template_identifier: &NSString,
154            preview: &PKShareablePassMetadataPreview,
155        ) -> Retained<Self>;
156
157        #[unsafe(method(credentialIdentifier))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn credentialIdentifier(&self) -> Retained<NSString>;
160
161        #[unsafe(method(sharingInstanceIdentifier))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn sharingInstanceIdentifier(&self) -> Retained<NSString>;
164
165        #[deprecated]
166        #[unsafe(method(templateIdentifier))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn templateIdentifier(&self) -> Retained<NSString>;
169
170        #[unsafe(method(cardTemplateIdentifier))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn cardTemplateIdentifier(&self) -> Retained<NSString>;
173
174        #[unsafe(method(cardConfigurationIdentifier))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn cardConfigurationIdentifier(&self) -> Retained<NSString>;
177
178        #[unsafe(method(requiresUnifiedAccessCapableDevice))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn requiresUnifiedAccessCapableDevice(&self) -> bool;
181
182        /// Setter for [`requiresUnifiedAccessCapableDevice`][Self::requiresUnifiedAccessCapableDevice].
183        #[unsafe(method(setRequiresUnifiedAccessCapableDevice:))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn setRequiresUnifiedAccessCapableDevice(
186            &self,
187            requires_unified_access_capable_device: bool,
188        );
189
190        #[unsafe(method(serverEnvironmentIdentifier))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn serverEnvironmentIdentifier(&self) -> Retained<NSString>;
193
194        /// Setter for [`serverEnvironmentIdentifier`][Self::serverEnvironmentIdentifier].
195        #[unsafe(method(setServerEnvironmentIdentifier:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn setServerEnvironmentIdentifier(
198            &self,
199            server_environment_identifier: &NSString,
200        );
201
202        #[cfg(feature = "PKAddSecureElementPassConfiguration")]
203        #[unsafe(method(preview))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn preview(&self) -> Retained<PKShareablePassMetadataPreview>;
206
207        #[cfg(feature = "objc2-core-graphics")]
208        #[deprecated]
209        #[unsafe(method(passThumbnailImage))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn passThumbnailImage(&self) -> Retained<CGImage>;
212
213        #[deprecated]
214        #[unsafe(method(localizedDescription))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn localizedDescription(&self) -> Retained<NSString>;
217
218        #[deprecated]
219        #[unsafe(method(ownerDisplayName))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn ownerDisplayName(&self) -> Retained<NSString>;
222
223        #[unsafe(method(accountHash))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn accountHash(&self) -> Retained<NSString>;
226
227        /// Setter for [`accountHash`][Self::accountHash].
228        #[unsafe(method(setAccountHash:))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn setAccountHash(&self, account_hash: &NSString);
231
232        #[unsafe(method(relyingPartyIdentifier))]
233        #[unsafe(method_family = none)]
234        pub unsafe fn relyingPartyIdentifier(&self) -> Retained<NSString>;
235
236        /// Setter for [`relyingPartyIdentifier`][Self::relyingPartyIdentifier].
237        #[unsafe(method(setRelyingPartyIdentifier:))]
238        #[unsafe(method_family = none)]
239        pub unsafe fn setRelyingPartyIdentifier(&self, relying_party_identifier: &NSString);
240    );
241}
242
243/// Methods declared on superclass `NSObject`.
244impl PKShareablePassMetadata {
245    extern_methods!(
246        #[unsafe(method(init))]
247        #[unsafe(method_family = init)]
248        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
249
250        #[unsafe(method(new))]
251        #[unsafe(method_family = new)]
252        pub unsafe fn new() -> Retained<Self>;
253    );
254}
255
256/// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddshareablepassconfigurationprimaryaction?language=objc)
257// NS_ENUM
258#[repr(transparent)]
259#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
260pub struct PKAddShareablePassConfigurationPrimaryAction(pub NSUInteger);
261impl PKAddShareablePassConfigurationPrimaryAction {
262    #[doc(alias = "PKAddShareablePassConfigurationPrimaryActionAdd")]
263    pub const Add: Self = Self(0);
264    #[doc(alias = "PKAddShareablePassConfigurationPrimaryActionShare")]
265    pub const Share: Self = Self(1);
266}
267
268unsafe impl Encode for PKAddShareablePassConfigurationPrimaryAction {
269    const ENCODING: Encoding = NSUInteger::ENCODING;
270}
271
272unsafe impl RefEncode for PKAddShareablePassConfigurationPrimaryAction {
273    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
274}
275
276extern_class!(
277    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddshareablepassconfiguration?language=objc)
278    #[unsafe(super(PKAddSecureElementPassConfiguration, NSObject))]
279    #[derive(Debug, PartialEq, Eq, Hash)]
280    #[cfg(feature = "PKAddSecureElementPassConfiguration")]
281    pub struct PKAddShareablePassConfiguration;
282);
283
284#[cfg(feature = "PKAddSecureElementPassConfiguration")]
285extern_conformance!(
286    unsafe impl NSObjectProtocol for PKAddShareablePassConfiguration {}
287);
288
289#[cfg(feature = "PKAddSecureElementPassConfiguration")]
290impl PKAddShareablePassConfiguration {
291    extern_methods!(
292        #[cfg(feature = "block2")]
293        #[deprecated = "Use configurationForPassMetadata:primaryAction:completion:"]
294        #[unsafe(method(configurationForPassMetadata:provisioningPolicyIdentifier:primaryAction:completion:))]
295        #[unsafe(method_family = none)]
296        pub unsafe fn configurationForPassMetadata_provisioningPolicyIdentifier_primaryAction_completion(
297            pass_metadata: &NSArray<PKShareablePassMetadata>,
298            provisioning_policy_identifier: &NSString,
299            action: PKAddShareablePassConfigurationPrimaryAction,
300            completion: &block2::DynBlock<
301                dyn Fn(*mut PKAddShareablePassConfiguration, *mut NSError),
302            >,
303        );
304
305        #[cfg(feature = "block2")]
306        #[unsafe(method(configurationForPassMetadata:primaryAction:completion:))]
307        #[unsafe(method_family = none)]
308        pub unsafe fn configurationForPassMetadata_primaryAction_completion(
309            pass_metadata: &NSArray<PKShareablePassMetadata>,
310            action: PKAddShareablePassConfigurationPrimaryAction,
311            completion: &block2::DynBlock<
312                dyn Fn(*mut PKAddShareablePassConfiguration, *mut NSError),
313            >,
314        );
315
316        #[unsafe(method(primaryAction))]
317        #[unsafe(method_family = none)]
318        pub unsafe fn primaryAction(&self) -> PKAddShareablePassConfigurationPrimaryAction;
319
320        #[unsafe(method(credentialsMetadata))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn credentialsMetadata(&self) -> Retained<NSArray<PKShareablePassMetadata>>;
323
324        #[deprecated = "provisioningPolicyIdentifier has been deprecated. You can stop setting this property in the init with no repercussions."]
325        #[unsafe(method(provisioningPolicyIdentifier))]
326        #[unsafe(method_family = none)]
327        pub unsafe fn provisioningPolicyIdentifier(&self) -> Retained<NSString>;
328    );
329}
330
331/// Methods declared on superclass `PKAddSecureElementPassConfiguration`.
332#[cfg(feature = "PKAddSecureElementPassConfiguration")]
333impl PKAddShareablePassConfiguration {
334    extern_methods!(
335        #[unsafe(method(init))]
336        #[unsafe(method_family = init)]
337        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
338
339        #[unsafe(method(new))]
340        #[unsafe(method_family = new)]
341        pub unsafe fn new() -> Retained<Self>;
342    );
343}