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/pksuicapassproperties?language=objc)
    #[unsafe(super(PKTransitPassProperties, PKStoredValuePassProperties, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "PKStoredValuePassProperties",
        feature = "PKTransitPassProperties"
    ))]
    pub struct PKSuicaPassProperties;
);

#[cfg(all(
    feature = "PKStoredValuePassProperties",
    feature = "PKTransitPassProperties"
))]
extern_conformance!(
    unsafe impl NSObjectProtocol for PKSuicaPassProperties {}
);

#[cfg(all(
    feature = "PKStoredValuePassProperties",
    feature = "PKTransitPassProperties"
))]
impl PKSuicaPassProperties {
    extern_methods!(
        #[cfg(all(feature = "PKObject", feature = "PKPass"))]
        /// Properties for a given pass, or nil if the pass doesn’t support the set of properties being requested
        #[unsafe(method(passPropertiesForPass:))]
        #[unsafe(method_family = none)]
        pub unsafe fn passPropertiesForPass(pass: &PKPass) -> Option<Retained<Self>>;

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

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

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

        /// Note: isInShinkansenStation is not a subset of isInStation.
        #[unsafe(method(isInShinkansenStation))]
        #[unsafe(method_family = none)]
        pub unsafe fn isInShinkansenStation(&self) -> bool;

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

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

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

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

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