use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
#[cfg(feature = "SKRequest")]
#[deprecated = "Get products using Product.products(for:)"]
pub unsafe trait SKProductsRequestDelegate: SKRequestDelegate {
#[deprecated = "Get products using Product.products(for:)"]
#[unsafe(method(productsRequest:didReceiveResponse:))]
#[unsafe(method_family = none)]
unsafe fn productsRequest_didReceiveResponse(
&self,
request: &SKProductsRequest,
response: &SKProductsResponse,
);
}
);
extern_class!(
#[unsafe(super(SKRequest, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "SKRequest")]
#[deprecated = "Use Product.products(for:)"]
pub struct SKProductsRequest;
);
#[cfg(feature = "SKRequest")]
extern_conformance!(
unsafe impl NSObjectProtocol for SKProductsRequest {}
);
#[cfg(feature = "SKRequest")]
impl SKProductsRequest {
extern_methods!(
#[deprecated = "Use Product.products(for:)"]
#[unsafe(method(initWithProductIdentifiers:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithProductIdentifiers(
this: Allocated<Self>,
product_identifiers: &NSSet<NSString>,
) -> Retained<Self>;
#[deprecated = "Use Product.products(for:)"]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn SKProductsRequestDelegate>>>;
#[deprecated = "Use Product.products(for:)"]
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn SKProductsRequestDelegate>>,
);
);
}
#[cfg(feature = "SKRequest")]
impl SKProductsRequest {
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(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Get products using Product.products(for:)"]
pub struct SKProductsResponse;
);
unsafe impl Send for SKProductsResponse {}
unsafe impl Sync for SKProductsResponse {}
extern_conformance!(
unsafe impl NSObjectProtocol for SKProductsResponse {}
);
impl SKProductsResponse {
extern_methods!(
#[cfg(feature = "SKProduct")]
#[deprecated = "Get products using Product.products(for:)"]
#[unsafe(method(products))]
#[unsafe(method_family = none)]
pub unsafe fn products(&self) -> Retained<NSArray<SKProduct>>;
#[deprecated = "Get products using Product.products(for:)"]
#[unsafe(method(invalidProductIdentifiers))]
#[unsafe(method_family = none)]
pub unsafe fn invalidProductIdentifiers(&self) -> Retained<NSArray<NSString>>;
);
}
impl SKProductsResponse {
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>;
);
}