use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Use Product.purchase(confirmIn:options:)"]
pub struct SKPayment;
);
extern_conformance!(
unsafe impl NSCopying for SKPayment {}
);
unsafe impl CopyingHelper for SKPayment {
type Result = Self;
}
extern_conformance!(
unsafe impl NSMutableCopying for SKPayment {}
);
unsafe impl MutableCopyingHelper for SKPayment {
type Result = SKMutablePayment;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SKPayment {}
);
impl SKPayment {
extern_methods!(
#[cfg(feature = "SKProduct")]
#[deprecated = "Use Product.purchase(confirmIn:options:)"]
#[unsafe(method(paymentWithProduct:))]
#[unsafe(method_family = none)]
pub unsafe fn paymentWithProduct(product: &SKProduct) -> Retained<Self>;
#[deprecated]
#[unsafe(method(paymentWithProductIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn paymentWithProductIdentifier(identifier: &NSString) -> Retained<AnyObject>;
#[deprecated = "Use Product.purchase(confirmIn:options:)"]
#[unsafe(method(productIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn productIdentifier(&self) -> Retained<NSString>;
#[deprecated = "Create Product.PurchaseOption.custom values to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(requestData))]
#[unsafe(method_family = none)]
pub unsafe fn requestData(&self) -> Option<Retained<NSData>>;
#[deprecated = "Create a Product.PurchaseOption.quantity to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(quantity))]
#[unsafe(method_family = none)]
pub unsafe fn quantity(&self) -> NSInteger;
#[deprecated = "Create a Product.PurchaseOption.appAccountToken to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(applicationUsername))]
#[unsafe(method_family = none)]
pub unsafe fn applicationUsername(&self) -> Option<Retained<NSString>>;
#[deprecated = "Create a Product.PurchaseOption.simulatesAskToBuyInSandbox to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(simulatesAskToBuyInSandbox))]
#[unsafe(method_family = none)]
pub unsafe fn simulatesAskToBuyInSandbox(&self) -> bool;
#[cfg(feature = "SKPaymentDiscount")]
#[deprecated = "Create a Product.PurchaseOption.promotionalOffer to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(paymentDiscount))]
#[unsafe(method_family = none)]
pub unsafe fn paymentDiscount(&self) -> Option<Retained<SKPaymentDiscount>>;
);
}
impl SKPayment {
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!(
#[unsafe(super(SKPayment, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Use Product.purchase(confirmIn:options:)"]
pub struct SKMutablePayment;
);
extern_conformance!(
unsafe impl NSCopying for SKMutablePayment {}
);
unsafe impl CopyingHelper for SKMutablePayment {
type Result = SKPayment;
}
extern_conformance!(
unsafe impl NSMutableCopying for SKMutablePayment {}
);
unsafe impl MutableCopyingHelper for SKMutablePayment {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SKMutablePayment {}
);
impl SKMutablePayment {
extern_methods!(
#[deprecated = "Create a Product.PurchaseOption.appAccountToken to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(applicationUsername))]
#[unsafe(method_family = none)]
pub unsafe fn applicationUsername(&self) -> Option<Retained<NSString>>;
#[deprecated = "Create a Product.PurchaseOption.appAccountToken to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(setApplicationUsername:))]
#[unsafe(method_family = none)]
pub unsafe fn setApplicationUsername(&self, application_username: Option<&NSString>);
#[cfg(feature = "SKPaymentDiscount")]
#[deprecated = "Create a Product.PurchaseOption.promotionalOffer to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(paymentDiscount))]
#[unsafe(method_family = none)]
pub unsafe fn paymentDiscount(&self) -> Option<Retained<SKPaymentDiscount>>;
#[cfg(feature = "SKPaymentDiscount")]
#[deprecated = "Create a Product.PurchaseOption.promotionalOffer to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(setPaymentDiscount:))]
#[unsafe(method_family = none)]
pub unsafe fn setPaymentDiscount(&self, payment_discount: Option<&SKPaymentDiscount>);
#[deprecated = "Use Product.purchase(confirmIn:options:)"]
#[unsafe(method(productIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn productIdentifier(&self) -> Retained<NSString>;
#[deprecated = "Use Product.purchase(confirmIn:options:)"]
#[unsafe(method(setProductIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setProductIdentifier(&self, product_identifier: &NSString);
#[deprecated = "Create a Product.PurchaseOption.quantity to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(quantity))]
#[unsafe(method_family = none)]
pub unsafe fn quantity(&self) -> NSInteger;
#[deprecated = "Create a Product.PurchaseOption.quantity to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(setQuantity:))]
#[unsafe(method_family = none)]
pub unsafe fn setQuantity(&self, quantity: NSInteger);
#[deprecated = "Create Product.PurchaseOption.custom values to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(requestData))]
#[unsafe(method_family = none)]
pub unsafe fn requestData(&self) -> Option<Retained<NSData>>;
#[deprecated = "Create Product.PurchaseOption.custom values to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(setRequestData:))]
#[unsafe(method_family = none)]
pub unsafe fn setRequestData(&self, request_data: Option<&NSData>);
#[deprecated = "Create a Product.PurchaseOption.simulatesAskToBuyInSandbox to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(simulatesAskToBuyInSandbox))]
#[unsafe(method_family = none)]
pub unsafe fn simulatesAskToBuyInSandbox(&self) -> bool;
#[deprecated = "Create a Product.PurchaseOption.simulatesAskToBuyInSandbox to use in Product.purchase(confirmIn:options:)"]
#[unsafe(method(setSimulatesAskToBuyInSandbox:))]
#[unsafe(method_family = none)]
pub unsafe fn setSimulatesAskToBuyInSandbox(&self, simulates_ask_to_buy_in_sandbox: bool);
);
}
impl SKMutablePayment {
extern_methods!(
#[cfg(feature = "SKProduct")]
#[deprecated = "Use Product.purchase(confirmIn:options:)"]
#[unsafe(method(paymentWithProduct:))]
#[unsafe(method_family = none)]
pub unsafe fn paymentWithProduct(product: &SKProduct) -> Retained<Self>;
);
}
impl SKMutablePayment {
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>;
);
}