objc2_intents/generated/
INSendPaymentIntent.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    /// [Apple's documentation](https://developer.apple.com/documentation/intents/insendpaymentintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INSendPaymentIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INSendPaymentIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INSendPaymentIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INSendPaymentIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INSendPaymentIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INSendPaymentIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INSendPaymentIntent {
45    extern_methods!(
46        #[cfg(all(feature = "INCurrencyAmount", feature = "INPerson"))]
47        #[unsafe(method(initWithPayee:currencyAmount:note:))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn initWithPayee_currencyAmount_note(
50            this: Allocated<Self>,
51            payee: Option<&INPerson>,
52            currency_amount: Option<&INCurrencyAmount>,
53            note: Option<&NSString>,
54        ) -> Retained<Self>;
55
56        #[cfg(feature = "INPerson")]
57        #[unsafe(method(payee))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn payee(&self) -> Option<Retained<INPerson>>;
60
61        #[cfg(feature = "INCurrencyAmount")]
62        #[unsafe(method(currencyAmount))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn currencyAmount(&self) -> Option<Retained<INCurrencyAmount>>;
65
66        #[unsafe(method(note))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn note(&self) -> Option<Retained<NSString>>;
69    );
70}
71
72/// Methods declared on superclass `NSObject`.
73#[cfg(feature = "INIntent")]
74impl INSendPaymentIntent {
75    extern_methods!(
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        #[unsafe(method(new))]
81        #[unsafe(method_family = new)]
82        pub unsafe fn new() -> Retained<Self>;
83    );
84}
85
86extern_protocol!(
87    /// Protocol to declare support for handling an INSendPaymentIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
88    ///
89    /// The minimum requirement for an implementing class is that it should be able to handle the intent. The resolution and confirmation methods are optional. The handling method is always called last, after resolving and confirming the intent.
90    ///
91    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/insendpaymentintenthandling?language=objc)
92    pub unsafe trait INSendPaymentIntentHandling: NSObjectProtocol {
93        #[cfg(all(
94            feature = "INIntent",
95            feature = "INIntentResponse",
96            feature = "INSendPaymentIntentResponse",
97            feature = "block2"
98        ))]
99        /// Handling method - Execute the task represented by the INSendPaymentIntent that's passed in
100        ///
101        /// Called to actually execute the intent. The app must return a response for this intent.
102        ///
103        ///
104        /// Parameter `intent`: The input intent
105        ///
106        /// Parameter `completion`: The response handling block takes a INSendPaymentIntentResponse containing the details of the result of having executed the intent
107        ///
108        ///
109        /// See: INSendPaymentIntentResponse
110        #[unsafe(method(handleSendPayment:completion:))]
111        #[unsafe(method_family = none)]
112        unsafe fn handleSendPayment_completion(
113            &self,
114            intent: &INSendPaymentIntent,
115            completion: &block2::DynBlock<dyn Fn(NonNull<INSendPaymentIntentResponse>)>,
116        );
117
118        #[cfg(all(
119            feature = "INIntent",
120            feature = "INIntentResponse",
121            feature = "INSendPaymentIntentResponse",
122            feature = "block2"
123        ))]
124        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
125        ///
126        /// Called prior to asking the app to handle the intent. The app should return a response object that contains additional information about the intent, which may be relevant for the system to show the user prior to handling. If unimplemented, the system will assume the intent is valid following resolution, and will assume there is no additional information relevant to this intent.
127        ///
128        ///
129        /// Parameter `intent`: The input intent
130        ///
131        /// Parameter `completion`: The response block contains an INSendPaymentIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
132        ///
133        ///
134        /// See: INSendPaymentIntentResponse
135        #[optional]
136        #[unsafe(method(confirmSendPayment:completion:))]
137        #[unsafe(method_family = none)]
138        unsafe fn confirmSendPayment_completion(
139            &self,
140            intent: &INSendPaymentIntent,
141            completion: &block2::DynBlock<dyn Fn(NonNull<INSendPaymentIntentResponse>)>,
142        );
143
144        #[cfg(all(
145            feature = "INIntent",
146            feature = "INIntentResolutionResult",
147            feature = "INPersonResolutionResult",
148            feature = "block2"
149        ))]
150        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
151        ///
152        /// Called to make sure the app extension is capable of handling this intent in its current form. This method is for validating if the intent needs any further fleshing out.
153        ///
154        ///
155        /// Parameter `intent`: The input intent
156        ///
157        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
158        ///
159        ///
160        /// See: INIntentResolutionResult
161        #[deprecated = "resolvePayeeForSendPayment:withCompletion: is deprecated. Use resolvePayeeForSendPayment:completion: instead"]
162        #[optional]
163        #[unsafe(method(resolvePayeeForSendPayment:withCompletion:))]
164        #[unsafe(method_family = none)]
165        unsafe fn resolvePayeeForSendPayment_withCompletion(
166            &self,
167            intent: &INSendPaymentIntent,
168            completion: &block2::DynBlock<dyn Fn(NonNull<INPersonResolutionResult>)>,
169        );
170
171        #[cfg(all(
172            feature = "INIntent",
173            feature = "INIntentResolutionResult",
174            feature = "INPersonResolutionResult",
175            feature = "INSendPaymentPayeeResolutionResult",
176            feature = "block2"
177        ))]
178        #[optional]
179        #[unsafe(method(resolvePayeeForSendPayment:completion:))]
180        #[unsafe(method_family = none)]
181        unsafe fn resolvePayeeForSendPayment_completion(
182            &self,
183            intent: &INSendPaymentIntent,
184            completion: &block2::DynBlock<dyn Fn(NonNull<INSendPaymentPayeeResolutionResult>)>,
185        );
186
187        #[cfg(all(
188            feature = "INCurrencyAmountResolutionResult",
189            feature = "INIntent",
190            feature = "INIntentResolutionResult",
191            feature = "block2"
192        ))]
193        #[deprecated = "resolveCurrencyAmountForSendPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForSendPayment:completion: instead"]
194        #[optional]
195        #[unsafe(method(resolveCurrencyAmountForSendPayment:withCompletion:))]
196        #[unsafe(method_family = none)]
197        unsafe fn resolveCurrencyAmountForSendPayment_withCompletion(
198            &self,
199            intent: &INSendPaymentIntent,
200            completion: &block2::DynBlock<dyn Fn(NonNull<INCurrencyAmountResolutionResult>)>,
201        );
202
203        #[cfg(all(
204            feature = "INCurrencyAmountResolutionResult",
205            feature = "INIntent",
206            feature = "INIntentResolutionResult",
207            feature = "INSendPaymentCurrencyAmountResolutionResult",
208            feature = "block2"
209        ))]
210        #[optional]
211        #[unsafe(method(resolveCurrencyAmountForSendPayment:completion:))]
212        #[unsafe(method_family = none)]
213        unsafe fn resolveCurrencyAmountForSendPayment_completion(
214            &self,
215            intent: &INSendPaymentIntent,
216            completion: &block2::DynBlock<
217                dyn Fn(NonNull<INSendPaymentCurrencyAmountResolutionResult>),
218            >,
219        );
220
221        #[cfg(all(
222            feature = "INIntent",
223            feature = "INIntentResolutionResult",
224            feature = "INStringResolutionResult",
225            feature = "block2"
226        ))]
227        #[optional]
228        #[unsafe(method(resolveNoteForSendPayment:withCompletion:))]
229        #[unsafe(method_family = none)]
230        unsafe fn resolveNoteForSendPayment_withCompletion(
231            &self,
232            intent: &INSendPaymentIntent,
233            completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
234        );
235    }
236);