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/ingetavailablerestaurantreservationbookingdefaultsintentresponsecode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INGetAvailableRestaurantReservationBookingDefaultsIntentResponseCode(pub NSInteger);
impl INGetAvailableRestaurantReservationBookingDefaultsIntentResponseCode {
    #[doc(alias = "INGetAvailableRestaurantReservationBookingDefaultsIntentResponseCodeSuccess")]
    pub const Success: Self = Self(0);
    #[doc(alias = "INGetAvailableRestaurantReservationBookingDefaultsIntentResponseCodeFailure")]
    pub const Failure: Self = Self(1);
    #[doc(
        alias = "INGetAvailableRestaurantReservationBookingDefaultsIntentResponseCodeUnspecified"
    )]
    pub const Unspecified: Self = Self(2);
}

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

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

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

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

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

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

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

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

#[cfg(feature = "INIntentResponse")]
impl INGetAvailableRestaurantReservationBookingDefaultsIntentResponse {
    extern_methods!(
        #[unsafe(method(defaultPartySize))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultPartySize(&self) -> NSUInteger;

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

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

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

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

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

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

        #[cfg(feature = "INImage")]
        /// Setter for [`providerImage`][Self::providerImage].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setProviderImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setProviderImage(&self, provider_image: &INImage);

        #[unsafe(method(initWithDefaultPartySize:defaultBookingDate:code:userActivity:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDefaultPartySize_defaultBookingDate_code_userActivity(
            this: Allocated<Self>,
            default_party_size: NSUInteger,
            default_booking_date: &NSDate,
            code: INGetAvailableRestaurantReservationBookingDefaultsIntentResponseCode,
            user_activity: Option<&NSUserActivity>,
        ) -> Retained<Self>;

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

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