use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[deprecated = "Use Product.SubscriptionOffer.PaymentMode"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKProductDiscountPaymentMode(pub NSUInteger);
impl SKProductDiscountPaymentMode {
#[doc(alias = "SKProductDiscountPaymentModePayAsYouGo")]
#[deprecated = "Use Product.SubscriptionOffer.PaymentMode"]
pub const PayAsYouGo: Self = Self(0);
#[doc(alias = "SKProductDiscountPaymentModePayUpFront")]
#[deprecated = "Use Product.SubscriptionOffer.PaymentMode"]
pub const PayUpFront: Self = Self(1);
#[doc(alias = "SKProductDiscountPaymentModeFreeTrial")]
#[deprecated = "Use Product.SubscriptionOffer.PaymentMode"]
pub const FreeTrial: Self = Self(2);
}
unsafe impl Encode for SKProductDiscountPaymentMode {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for SKProductDiscountPaymentMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated = "Use Product.SubscriptionOffer.OfferType"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SKProductDiscountType(pub NSUInteger);
impl SKProductDiscountType {
#[doc(alias = "SKProductDiscountTypeIntroductory")]
#[deprecated = "Use Product.SubscriptionOffer.OfferType"]
pub const Introductory: Self = Self(0);
#[doc(alias = "SKProductDiscountTypeSubscription")]
#[deprecated = "Use Product.SubscriptionOffer.OfferType"]
pub const Subscription: Self = Self(1);
}
unsafe impl Encode for SKProductDiscountType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for SKProductDiscountType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Use Product.SubscriptionOffer"]
pub struct SKProductDiscount;
);
unsafe impl Send for SKProductDiscount {}
unsafe impl Sync for SKProductDiscount {}
extern_conformance!(
unsafe impl NSObjectProtocol for SKProductDiscount {}
);
impl SKProductDiscount {
extern_methods!(
#[deprecated = "Use Product.SubscriptionOffer.displayPrice"]
#[unsafe(method(price))]
#[unsafe(method_family = none)]
pub unsafe fn price(&self) -> Retained<NSDecimalNumber>;
#[deprecated = "Use Product.SubscriptionOffer.displayPrice"]
#[unsafe(method(priceLocale))]
#[unsafe(method_family = none)]
pub unsafe fn priceLocale(&self) -> Retained<NSLocale>;
#[deprecated = "Use Product.SubscriptionOffer.id"]
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "SKProduct")]
#[deprecated = "Use Product.SubscriptionOffer.period"]
#[unsafe(method(subscriptionPeriod))]
#[unsafe(method_family = none)]
pub unsafe fn subscriptionPeriod(&self) -> Retained<SKProductSubscriptionPeriod>;
#[deprecated = "Use Product.SubscriptionOffer.periodCount"]
#[unsafe(method(numberOfPeriods))]
#[unsafe(method_family = none)]
pub unsafe fn numberOfPeriods(&self) -> NSUInteger;
#[deprecated = "Use Product.SubscriptionOffer.paymentMode"]
#[unsafe(method(paymentMode))]
#[unsafe(method_family = none)]
pub unsafe fn paymentMode(&self) -> SKProductDiscountPaymentMode;
#[deprecated = "Use Product.SubscriptionOffer.type"]
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> SKProductDiscountType;
);
}
impl SKProductDiscount {
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>;
);
}