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!(
    /// Request for information from an identity document stored as a Wallet pass.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentityrequest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PKIdentityRequest;
);

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

impl PKIdentityRequest {
    extern_methods!(
        #[cfg(feature = "PKIdentityDocumentDescriptor")]
        /// A descriptor describing the identity document to request.
        #[unsafe(method(descriptor))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptor(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn PKIdentityDocumentDescriptor>>>;

        #[cfg(feature = "PKIdentityDocumentDescriptor")]
        /// Setter for [`descriptor`][Self::descriptor].
        #[unsafe(method(setDescriptor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDescriptor(
            &self,
            descriptor: Option<&ProtocolObject<dyn PKIdentityDocumentDescriptor>>,
        );

        /// A caller-specified nonce that will be included in the signed response payload.
        /// This is treated as opaque by the PKIdentityAuthorizationController, and has a
        /// maximum allowed size of 64 bytes.
        #[unsafe(method(nonce))]
        #[unsafe(method_family = none)]
        pub unsafe fn nonce(&self) -> Option<Retained<NSData>>;

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

        /// Identifies the merchant making the request, as previously agreed with Apple.
        /// This must match one of the merchant identifiers in the application's entitlement.
        /// This property must be set when requestDocument is invoked.
        #[unsafe(method(merchantIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn merchantIdentifier(&self) -> Option<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: Option<&NSString>);
    );
}

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