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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddpaymentpassstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct PKAddPaymentPassStyle(pub NSInteger);
impl PKAddPaymentPassStyle {
    #[doc(alias = "PKAddPaymentPassStylePayment")]
    pub const Payment: Self = Self(0);
    #[doc(alias = "PKAddPaymentPassStyleAccess")]
    pub const Access: Self = Self(1);
}

unsafe impl Encode for PKAddPaymentPassStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for PKAddPaymentPassStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

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

impl PKAddPaymentPassRequestConfiguration {
    extern_methods!(
        #[cfg(feature = "PKConstants")]
        #[unsafe(method(initWithEncryptionScheme:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithEncryptionScheme(
            this: Allocated<Self>,
            encryption_scheme: &PKEncryptionScheme,
        ) -> Option<Retained<Self>>;

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

        #[unsafe(method(style))]
        #[unsafe(method_family = none)]
        pub unsafe fn style(&self) -> PKAddPaymentPassStyle;

        /// Setter for [`style`][Self::style].
        #[unsafe(method(setStyle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStyle(&self, style: PKAddPaymentPassStyle);

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

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

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

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

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

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

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

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

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

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

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

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

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

        /// Setter for [`productIdentifiers`][Self::productIdentifiers].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setProductIdentifiers:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setProductIdentifiers(&self, product_identifiers: &NSSet<NSString>);

        #[unsafe(method(requiresFelicaSecureElement))]
        #[unsafe(method_family = none)]
        pub unsafe fn requiresFelicaSecureElement(&self) -> bool;

        /// Setter for [`requiresFelicaSecureElement`][Self::requiresFelicaSecureElement].
        #[unsafe(method(setRequiresFelicaSecureElement:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRequiresFelicaSecureElement(&self, requires_felica_secure_element: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl PKAddPaymentPassRequestConfiguration {
    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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddpaymentpassrequest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PKAddPaymentPassRequest;
);

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

impl PKAddPaymentPassRequest {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

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

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

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

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

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

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

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

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

/// Methods declared on superclass `NSObject`.
impl PKAddPaymentPassRequest {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}