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/ingetusercurrentrestaurantreservationbookingsintentresponsecode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INGetUserCurrentRestaurantReservationBookingsIntentResponseCode(pub NSInteger);
impl INGetUserCurrentRestaurantReservationBookingsIntentResponseCode {
    #[doc(alias = "INGetUserCurrentRestaurantReservationBookingsIntentResponseCodeSuccess")]
    pub const Success: Self = Self(0);
    #[doc(alias = "INGetUserCurrentRestaurantReservationBookingsIntentResponseCodeFailure")]
    pub const Failure: Self = Self(1);
    #[doc(
        alias = "INGetUserCurrentRestaurantReservationBookingsIntentResponseCodeFailureRequestUnsatisfiable"
    )]
    pub const FailureRequestUnsatisfiable: Self = Self(2);
    #[doc(alias = "INGetUserCurrentRestaurantReservationBookingsIntentResponseCodeUnspecified")]
    pub const Unspecified: Self = Self(3);
}

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

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

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

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

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

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

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

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

#[cfg(feature = "INIntentResponse")]
impl INGetUserCurrentRestaurantReservationBookingsIntentResponse {
    extern_methods!(
        #[cfg(all(
            feature = "INRestaurantReservationBooking",
            feature = "INRestaurantReservationUserBooking"
        ))]
        #[unsafe(method(initWithUserCurrentBookings:code:userActivity:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithUserCurrentBookings_code_userActivity(
            this: Allocated<Self>,
            user_current_bookings: &NSArray<INRestaurantReservationUserBooking>,
            code: INGetUserCurrentRestaurantReservationBookingsIntentResponseCode,
            user_activity: Option<&NSUserActivity>,
        ) -> Retained<Self>;

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

        #[cfg(all(
            feature = "INRestaurantReservationBooking",
            feature = "INRestaurantReservationUserBooking"
        ))]
        #[unsafe(method(userCurrentBookings))]
        #[unsafe(method_family = none)]
        pub unsafe fn userCurrentBookings(
            &self,
        ) -> Retained<NSArray<INRestaurantReservationUserBooking>>;

        #[cfg(all(
            feature = "INRestaurantReservationBooking",
            feature = "INRestaurantReservationUserBooking"
        ))]
        /// Setter for [`userCurrentBookings`][Self::userCurrentBookings].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setUserCurrentBookings:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUserCurrentBookings(
            &self,
            user_current_bookings: &NSArray<INRestaurantReservationUserBooking>,
        );
    );
}

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