objc2-pass-kit 0.3.2

Bindings to the PassKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkdisbursementrequest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PKDisbursementRequest;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for PKDisbursementRequest {}
);

impl PKDisbursementRequest {
    extern_methods!(
        #[unsafe(method(merchantIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn merchantIdentifier(&self) -> Retained<NSString>;

        /// Setter for [`merchantIdentifier`][Self::merchantIdentifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setMerchantIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMerchantIdentifier(&self, merchant_identifier: &NSString);

        #[unsafe(method(regionCode))]
        #[unsafe(method_family = none)]
        pub unsafe fn regionCode(&self) -> Retained<NSString>;

        /// Setter for [`regionCode`][Self::regionCode].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setRegionCode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRegionCode(&self, region_code: &NSString);

        #[cfg(feature = "PKConstants")]
        #[unsafe(method(supportedNetworks))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedNetworks(&self) -> Retained<NSArray<PKPaymentNetwork>>;

        #[cfg(feature = "PKConstants")]
        /// Setter for [`supportedNetworks`][Self::supportedNetworks].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSupportedNetworks:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupportedNetworks(&self, supported_networks: &NSArray<PKPaymentNetwork>);

        #[cfg(feature = "PKPaymentRequest")]
        #[unsafe(method(merchantCapabilities))]
        #[unsafe(method_family = none)]
        pub unsafe fn merchantCapabilities(&self) -> PKMerchantCapability;

        #[cfg(feature = "PKPaymentRequest")]
        /// Setter for [`merchantCapabilities`][Self::merchantCapabilities].
        #[unsafe(method(setMerchantCapabilities:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMerchantCapabilities(&self, merchant_capabilities: PKMerchantCapability);

        #[cfg(feature = "PKPaymentSummaryItem")]
        #[unsafe(method(summaryItems))]
        #[unsafe(method_family = none)]
        pub unsafe fn summaryItems(&self) -> Retained<NSArray<PKPaymentSummaryItem>>;

        #[cfg(feature = "PKPaymentSummaryItem")]
        /// Setter for [`summaryItems`][Self::summaryItems].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSummaryItems:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSummaryItems(&self, summary_items: &NSArray<PKPaymentSummaryItem>);

        #[unsafe(method(currencyCode))]
        #[unsafe(method_family = none)]
        pub unsafe fn currencyCode(&self) -> Retained<NSString>;

        /// Setter for [`currencyCode`][Self::currencyCode].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCurrencyCode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCurrencyCode(&self, currency_code: &NSString);

        #[cfg(feature = "PKConstants")]
        #[unsafe(method(requiredRecipientContactFields))]
        #[unsafe(method_family = none)]
        pub unsafe fn requiredRecipientContactFields(&self) -> Retained<NSArray<PKContactField>>;

        #[cfg(feature = "PKConstants")]
        /// Setter for [`requiredRecipientContactFields`][Self::requiredRecipientContactFields].
        #[unsafe(method(setRequiredRecipientContactFields:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRequiredRecipientContactFields(
            &self,
            required_recipient_contact_fields: &NSArray<PKContactField>,
        );

        #[cfg(feature = "PKContact")]
        #[unsafe(method(recipientContact))]
        #[unsafe(method_family = none)]
        pub unsafe fn recipientContact(&self) -> Option<Retained<PKContact>>;

        #[cfg(feature = "PKContact")]
        /// Setter for [`recipientContact`][Self::recipientContact].
        #[unsafe(method(setRecipientContact:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRecipientContact(&self, recipient_contact: Option<&PKContact>);

        #[unsafe(method(supportedRegions))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedRegions(&self) -> Option<Retained<NSArray<NSString>>>;

        /// Setter for [`supportedRegions`][Self::supportedRegions].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSupportedRegions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupportedRegions(&self, supported_regions: Option<&NSArray<NSString>>);

        #[unsafe(method(applicationData))]
        #[unsafe(method_family = none)]
        pub unsafe fn applicationData(&self) -> Option<Retained<NSData>>;

        /// Setter for [`applicationData`][Self::applicationData].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setApplicationData:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setApplicationData(&self, application_data: Option<&NSData>);

        #[cfg(all(
            feature = "PKConstants",
            feature = "PKPaymentRequest",
            feature = "PKPaymentSummaryItem"
        ))]
        #[unsafe(method(initWithMerchantIdentifier:currencyCode:regionCode:supportedNetworks:merchantCapabilities:summaryItems:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithMerchantIdentifier_currencyCode_regionCode_supportedNetworks_merchantCapabilities_summaryItems(
            this: Allocated<Self>,
            merchant_identifier: &NSString,
            currency_code: &NSString,
            region_code: &NSString,
            supported_networks: &NSArray<PKPaymentNetwork>,
            merchant_capabilities: PKMerchantCapability,
            summary_items: &NSArray<PKPaymentSummaryItem>,
        ) -> Retained<Self>;

        #[cfg(feature = "PKConstants")]
        #[unsafe(method(disbursementContactInvalidErrorWithContactField:localizedDescription:))]
        #[unsafe(method_family = none)]
        pub unsafe fn disbursementContactInvalidErrorWithContactField_localizedDescription(
            field: &PKContactField,
            localized_description: Option<&NSString>,
        ) -> Retained<NSError>;

        #[unsafe(method(disbursementCardUnsupportedError))]
        #[unsafe(method_family = none)]
        pub unsafe fn disbursementCardUnsupportedError() -> Retained<NSError>;
    );
}

/// Methods declared on superclass `NSObject`.
impl PKDisbursementRequest {
    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>;
    );
}