objc2-intents 0.3.2

Bindings to the Intents 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/intents/inlistrideoptionsintentresponsecode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INListRideOptionsIntentResponseCode(pub NSInteger);
impl INListRideOptionsIntentResponseCode {
    #[doc(alias = "INListRideOptionsIntentResponseCodeUnspecified")]
    pub const Unspecified: Self = Self(0);
    #[doc(alias = "INListRideOptionsIntentResponseCodeReady")]
    pub const Ready: Self = Self(1);
    #[doc(alias = "INListRideOptionsIntentResponseCodeInProgress")]
    #[deprecated = "INListRideOptionsIntentResponseCodeInProgress is deprecated."]
    pub const InProgress: Self = Self(2);
    #[doc(alias = "INListRideOptionsIntentResponseCodeSuccess")]
    pub const Success: Self = Self(3);
    #[doc(alias = "INListRideOptionsIntentResponseCodeFailure")]
    pub const Failure: Self = Self(4);
    #[doc(alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunch")]
    pub const FailureRequiringAppLaunch: Self = Self(5);
    #[doc(
        alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunchMustVerifyCredentials"
    )]
    pub const FailureRequiringAppLaunchMustVerifyCredentials: Self = Self(6);
    #[doc(alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunchNoServiceInArea")]
    pub const FailureRequiringAppLaunchNoServiceInArea: Self = Self(7);
    #[doc(
        alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunchServiceTemporarilyUnavailable"
    )]
    pub const FailureRequiringAppLaunchServiceTemporarilyUnavailable: Self = Self(8);
    #[doc(
        alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunchPreviousRideNeedsCompletion"
    )]
    pub const FailureRequiringAppLaunchPreviousRideNeedsCompletion: Self = Self(9);
    #[doc(alias = "INListRideOptionsIntentResponseCodeFailurePreviousRideNeedsFeedback")]
    pub const FailurePreviousRideNeedsFeedback: Self = Self(10);
}

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

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

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

#[cfg(feature = "INIntentResponse")]
extern_conformance!(
    unsafe impl NSCoding for INListRideOptionsIntentResponse {}
);

#[cfg(feature = "INIntentResponse")]
extern_conformance!(
    unsafe impl NSCopying for INListRideOptionsIntentResponse {}
);

#[cfg(feature = "INIntentResponse")]
unsafe impl CopyingHelper for INListRideOptionsIntentResponse {
    type Result = Self;
}

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

#[cfg(feature = "INIntentResponse")]
extern_conformance!(
    unsafe impl NSSecureCoding for INListRideOptionsIntentResponse {}
);

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

        #[unsafe(method(initWithCode:userActivity:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCode_userActivity(
            this: Allocated<Self>,
            code: INListRideOptionsIntentResponseCode,
            user_activity: Option<&NSUserActivity>,
        ) -> Retained<Self>;

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

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

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

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

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

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

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

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