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::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

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

#[cfg(feature = "PKObject")]
extern_conformance!(
    unsafe impl NSObjectProtocol for PKPass {}
);

#[cfg(feature = "PKObject")]
impl PKPass {
    extern_methods!(
        #[unsafe(method(initWithData:error:_))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithData_error(
            this: Allocated<Self>,
            data: &NSData,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        #[cfg(feature = "PKPass_Types")]
        #[unsafe(method(passType))]
        #[unsafe(method_family = none)]
        pub unsafe fn passType(&self) -> PKPassType;

        #[cfg(all(feature = "PKPaymentPass", feature = "PKSecureElementPass"))]
        #[deprecated = "Use -[PKPass secureElementPass] instead"]
        #[unsafe(method(paymentPass))]
        #[unsafe(method_family = none)]
        pub unsafe fn paymentPass(&self) -> Option<Retained<PKPaymentPass>>;

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

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

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

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

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

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

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

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

        #[deprecated = "Use relevantDates"]
        #[unsafe(method(relevantDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn relevantDate(&self) -> Option<Retained<NSDate>>;

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

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

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

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

        #[unsafe(method(localizedValueForFieldKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedValueForFieldKey(
            &self,
            key: &NSString,
        ) -> Option<Retained<AnyObject>>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "PKObject")]
impl PKPass {
    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>;
    );
}