objc2_intents/generated/
INRequestPaymentIntentResponse.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/intents/inrequestpaymentintentresponsecode?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct INRequestPaymentIntentResponseCode(pub NSInteger);
15impl INRequestPaymentIntentResponseCode {
16    #[doc(alias = "INRequestPaymentIntentResponseCodeUnspecified")]
17    pub const Unspecified: Self = Self(0);
18    #[doc(alias = "INRequestPaymentIntentResponseCodeReady")]
19    pub const Ready: Self = Self(1);
20    #[doc(alias = "INRequestPaymentIntentResponseCodeInProgress")]
21    pub const InProgress: Self = Self(2);
22    #[doc(alias = "INRequestPaymentIntentResponseCodeSuccess")]
23    pub const Success: Self = Self(3);
24    #[doc(alias = "INRequestPaymentIntentResponseCodeFailure")]
25    pub const Failure: Self = Self(4);
26    #[doc(alias = "INRequestPaymentIntentResponseCodeFailureRequiringAppLaunch")]
27    pub const FailureRequiringAppLaunch: Self = Self(5);
28    #[doc(alias = "INRequestPaymentIntentResponseCodeFailureCredentialsUnverified")]
29    pub const FailureCredentialsUnverified: Self = Self(6);
30    #[doc(alias = "INRequestPaymentIntentResponseCodeFailurePaymentsAmountBelowMinimum")]
31    pub const FailurePaymentsAmountBelowMinimum: Self = Self(7);
32    #[doc(alias = "INRequestPaymentIntentResponseCodeFailurePaymentsAmountAboveMaximum")]
33    pub const FailurePaymentsAmountAboveMaximum: Self = Self(8);
34    #[doc(alias = "INRequestPaymentIntentResponseCodeFailurePaymentsCurrencyUnsupported")]
35    pub const FailurePaymentsCurrencyUnsupported: Self = Self(9);
36    #[doc(alias = "INRequestPaymentIntentResponseCodeFailureNoBankAccount")]
37    pub const FailureNoBankAccount: Self = Self(10);
38    #[doc(alias = "INRequestPaymentIntentResponseCodeFailureNotEligible")]
39    pub const FailureNotEligible: Self = Self(11);
40    #[doc(alias = "INRequestPaymentIntentResponseCodeFailureTermsAndConditionsAcceptanceRequired")]
41    pub const FailureTermsAndConditionsAcceptanceRequired: Self = Self(12);
42}
43
44unsafe impl Encode for INRequestPaymentIntentResponseCode {
45    const ENCODING: Encoding = NSInteger::ENCODING;
46}
47
48unsafe impl RefEncode for INRequestPaymentIntentResponseCode {
49    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
50}
51
52extern_class!(
53    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inrequestpaymentintentresponse?language=objc)
54    #[unsafe(super(INIntentResponse, NSObject))]
55    #[derive(Debug, PartialEq, Eq, Hash)]
56    #[cfg(feature = "INIntentResponse")]
57    pub struct INRequestPaymentIntentResponse;
58);
59
60#[cfg(feature = "INIntentResponse")]
61extern_conformance!(
62    unsafe impl NSCoding for INRequestPaymentIntentResponse {}
63);
64
65#[cfg(feature = "INIntentResponse")]
66extern_conformance!(
67    unsafe impl NSCopying for INRequestPaymentIntentResponse {}
68);
69
70#[cfg(feature = "INIntentResponse")]
71unsafe impl CopyingHelper for INRequestPaymentIntentResponse {
72    type Result = Self;
73}
74
75#[cfg(feature = "INIntentResponse")]
76extern_conformance!(
77    unsafe impl NSObjectProtocol for INRequestPaymentIntentResponse {}
78);
79
80#[cfg(feature = "INIntentResponse")]
81extern_conformance!(
82    unsafe impl NSSecureCoding for INRequestPaymentIntentResponse {}
83);
84
85#[cfg(feature = "INIntentResponse")]
86impl INRequestPaymentIntentResponse {
87    extern_methods!(
88        #[unsafe(method(init))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92        #[unsafe(method(initWithCode:userActivity:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithCode_userActivity(
95            this: Allocated<Self>,
96            code: INRequestPaymentIntentResponseCode,
97            user_activity: Option<&NSUserActivity>,
98        ) -> Retained<Self>;
99
100        #[unsafe(method(code))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn code(&self) -> INRequestPaymentIntentResponseCode;
103
104        #[cfg(feature = "INPaymentRecord")]
105        #[unsafe(method(paymentRecord))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn paymentRecord(&self) -> Option<Retained<INPaymentRecord>>;
108
109        #[cfg(feature = "INPaymentRecord")]
110        /// Setter for [`paymentRecord`][Self::paymentRecord].
111        ///
112        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
113        #[unsafe(method(setPaymentRecord:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setPaymentRecord(&self, payment_record: Option<&INPaymentRecord>);
116    );
117}
118
119/// Methods declared on superclass `NSObject`.
120#[cfg(feature = "INIntentResponse")]
121impl INRequestPaymentIntentResponse {
122    extern_methods!(
123        #[unsafe(method(new))]
124        #[unsafe(method_family = new)]
125        pub unsafe fn new() -> Retained<Self>;
126    );
127}