use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(INIntent, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "INIntent")]
pub struct INRequestPaymentIntent;
);
#[cfg(feature = "INIntent")]
extern_conformance!(
unsafe impl NSCoding for INRequestPaymentIntent {}
);
#[cfg(feature = "INIntent")]
extern_conformance!(
unsafe impl NSCopying for INRequestPaymentIntent {}
);
#[cfg(feature = "INIntent")]
unsafe impl CopyingHelper for INRequestPaymentIntent {
type Result = Self;
}
#[cfg(feature = "INIntent")]
extern_conformance!(
unsafe impl NSObjectProtocol for INRequestPaymentIntent {}
);
#[cfg(feature = "INIntent")]
extern_conformance!(
unsafe impl NSSecureCoding for INRequestPaymentIntent {}
);
#[cfg(feature = "INIntent")]
impl INRequestPaymentIntent {
extern_methods!(
#[cfg(all(feature = "INCurrencyAmount", feature = "INPerson"))]
#[unsafe(method(initWithPayer:currencyAmount:note:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPayer_currencyAmount_note(
this: Allocated<Self>,
payer: Option<&INPerson>,
currency_amount: Option<&INCurrencyAmount>,
note: Option<&NSString>,
) -> Retained<Self>;
#[cfg(feature = "INPerson")]
#[unsafe(method(payer))]
#[unsafe(method_family = none)]
pub unsafe fn payer(&self) -> Option<Retained<INPerson>>;
#[cfg(feature = "INCurrencyAmount")]
#[unsafe(method(currencyAmount))]
#[unsafe(method_family = none)]
pub unsafe fn currencyAmount(&self) -> Option<Retained<INCurrencyAmount>>;
#[unsafe(method(note))]
#[unsafe(method_family = none)]
pub unsafe fn note(&self) -> Option<Retained<NSString>>;
);
}
#[cfg(feature = "INIntent")]
impl INRequestPaymentIntent {
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_protocol!(
pub unsafe trait INRequestPaymentIntentHandling: NSObjectProtocol {
#[cfg(all(
feature = "INIntent",
feature = "INIntentResponse",
feature = "INRequestPaymentIntentResponse",
feature = "block2"
))]
#[unsafe(method(handleRequestPayment:completion:))]
#[unsafe(method_family = none)]
unsafe fn handleRequestPayment_completion(
&self,
intent: &INRequestPaymentIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INRequestPaymentIntentResponse>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResponse",
feature = "INRequestPaymentIntentResponse",
feature = "block2"
))]
#[optional]
#[unsafe(method(confirmRequestPayment:completion:))]
#[unsafe(method_family = none)]
unsafe fn confirmRequestPayment_completion(
&self,
intent: &INRequestPaymentIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INRequestPaymentIntentResponse>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INPersonResolutionResult",
feature = "block2"
))]
#[deprecated = "resolvePayerForRequestPayment:withCompletion: is deprecated. Use resolvePayerForRequestPayment:completion: instead"]
#[optional]
#[unsafe(method(resolvePayerForRequestPayment:withCompletion:))]
#[unsafe(method_family = none)]
unsafe fn resolvePayerForRequestPayment_withCompletion(
&self,
intent: &INRequestPaymentIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INPersonResolutionResult>)>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INPersonResolutionResult",
feature = "INRequestPaymentPayerResolutionResult",
feature = "block2"
))]
#[optional]
#[unsafe(method(resolvePayerForRequestPayment:completion:))]
#[unsafe(method_family = none)]
unsafe fn resolvePayerForRequestPayment_completion(
&self,
intent: &INRequestPaymentIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INRequestPaymentPayerResolutionResult>)>,
);
#[cfg(all(
feature = "INCurrencyAmountResolutionResult",
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "block2"
))]
#[deprecated = "resolveCurrencyAmountForRequestPayment:withCompletion: is deprecated. Use resolveCurrencyAmountForRequestPayment:completion: instead"]
#[optional]
#[unsafe(method(resolveCurrencyAmountForRequestPayment:withCompletion:))]
#[unsafe(method_family = none)]
unsafe fn resolveCurrencyAmountForRequestPayment_withCompletion(
&self,
intent: &INRequestPaymentIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INCurrencyAmountResolutionResult>)>,
);
#[cfg(all(
feature = "INCurrencyAmountResolutionResult",
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INRequestPaymentCurrencyAmountResolutionResult",
feature = "block2"
))]
#[optional]
#[unsafe(method(resolveCurrencyAmountForRequestPayment:completion:))]
#[unsafe(method_family = none)]
unsafe fn resolveCurrencyAmountForRequestPayment_completion(
&self,
intent: &INRequestPaymentIntent,
completion: &block2::DynBlock<
dyn Fn(NonNull<INRequestPaymentCurrencyAmountResolutionResult>),
>,
);
#[cfg(all(
feature = "INIntent",
feature = "INIntentResolutionResult",
feature = "INStringResolutionResult",
feature = "block2"
))]
#[optional]
#[unsafe(method(resolveNoteForRequestPayment:withCompletion:))]
#[unsafe(method_family = none)]
unsafe fn resolveNoteForRequestPayment_withCompletion(
&self,
intent: &INRequestPaymentIntent,
completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
);
}
);