objc2_intents/generated/
INListRideOptionsIntentResponse.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/intents/inlistrideoptionsintentresponsecode?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct INListRideOptionsIntentResponseCode(pub NSInteger);
15impl INListRideOptionsIntentResponseCode {
16    #[doc(alias = "INListRideOptionsIntentResponseCodeUnspecified")]
17    pub const Unspecified: Self = Self(0);
18    #[doc(alias = "INListRideOptionsIntentResponseCodeReady")]
19    pub const Ready: Self = Self(1);
20    #[doc(alias = "INListRideOptionsIntentResponseCodeInProgress")]
21    #[deprecated = "INListRideOptionsIntentResponseCodeInProgress is deprecated."]
22    pub const InProgress: Self = Self(2);
23    #[doc(alias = "INListRideOptionsIntentResponseCodeSuccess")]
24    pub const Success: Self = Self(3);
25    #[doc(alias = "INListRideOptionsIntentResponseCodeFailure")]
26    pub const Failure: Self = Self(4);
27    #[doc(alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunch")]
28    pub const FailureRequiringAppLaunch: Self = Self(5);
29    #[doc(
30        alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunchMustVerifyCredentials"
31    )]
32    pub const FailureRequiringAppLaunchMustVerifyCredentials: Self = Self(6);
33    #[doc(alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunchNoServiceInArea")]
34    pub const FailureRequiringAppLaunchNoServiceInArea: Self = Self(7);
35    #[doc(
36        alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunchServiceTemporarilyUnavailable"
37    )]
38    pub const FailureRequiringAppLaunchServiceTemporarilyUnavailable: Self = Self(8);
39    #[doc(
40        alias = "INListRideOptionsIntentResponseCodeFailureRequiringAppLaunchPreviousRideNeedsCompletion"
41    )]
42    pub const FailureRequiringAppLaunchPreviousRideNeedsCompletion: Self = Self(9);
43    #[doc(alias = "INListRideOptionsIntentResponseCodeFailurePreviousRideNeedsFeedback")]
44    pub const FailurePreviousRideNeedsFeedback: Self = Self(10);
45}
46
47unsafe impl Encode for INListRideOptionsIntentResponseCode {
48    const ENCODING: Encoding = NSInteger::ENCODING;
49}
50
51unsafe impl RefEncode for INListRideOptionsIntentResponseCode {
52    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
53}
54
55extern_class!(
56    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inlistrideoptionsintentresponse?language=objc)
57    #[unsafe(super(INIntentResponse, NSObject))]
58    #[derive(Debug, PartialEq, Eq, Hash)]
59    #[cfg(feature = "INIntentResponse")]
60    pub struct INListRideOptionsIntentResponse;
61);
62
63#[cfg(feature = "INIntentResponse")]
64extern_conformance!(
65    unsafe impl NSCoding for INListRideOptionsIntentResponse {}
66);
67
68#[cfg(feature = "INIntentResponse")]
69extern_conformance!(
70    unsafe impl NSCopying for INListRideOptionsIntentResponse {}
71);
72
73#[cfg(feature = "INIntentResponse")]
74unsafe impl CopyingHelper for INListRideOptionsIntentResponse {
75    type Result = Self;
76}
77
78#[cfg(feature = "INIntentResponse")]
79extern_conformance!(
80    unsafe impl NSObjectProtocol for INListRideOptionsIntentResponse {}
81);
82
83#[cfg(feature = "INIntentResponse")]
84extern_conformance!(
85    unsafe impl NSSecureCoding for INListRideOptionsIntentResponse {}
86);
87
88#[cfg(feature = "INIntentResponse")]
89impl INListRideOptionsIntentResponse {
90    extern_methods!(
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95        #[unsafe(method(initWithCode:userActivity:))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn initWithCode_userActivity(
98            this: Allocated<Self>,
99            code: INListRideOptionsIntentResponseCode,
100            user_activity: Option<&NSUserActivity>,
101        ) -> Retained<Self>;
102
103        #[unsafe(method(code))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn code(&self) -> INListRideOptionsIntentResponseCode;
106
107        #[cfg(feature = "INRideOption")]
108        #[unsafe(method(rideOptions))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn rideOptions(&self) -> Option<Retained<NSArray<INRideOption>>>;
111
112        #[cfg(feature = "INRideOption")]
113        /// Setter for [`rideOptions`][Self::rideOptions].
114        ///
115        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
116        #[unsafe(method(setRideOptions:))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn setRideOptions(&self, ride_options: Option<&NSArray<INRideOption>>);
119
120        #[cfg(feature = "INPaymentMethod")]
121        #[unsafe(method(paymentMethods))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn paymentMethods(&self) -> Option<Retained<NSArray<INPaymentMethod>>>;
124
125        #[cfg(feature = "INPaymentMethod")]
126        /// Setter for [`paymentMethods`][Self::paymentMethods].
127        ///
128        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
129        #[unsafe(method(setPaymentMethods:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn setPaymentMethods(&self, payment_methods: Option<&NSArray<INPaymentMethod>>);
132
133        #[unsafe(method(expirationDate))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn expirationDate(&self) -> Option<Retained<NSDate>>;
136
137        /// Setter for [`expirationDate`][Self::expirationDate].
138        ///
139        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
140        #[unsafe(method(setExpirationDate:))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn setExpirationDate(&self, expiration_date: Option<&NSDate>);
143    );
144}
145
146/// Methods declared on superclass `NSObject`.
147#[cfg(feature = "INIntentResponse")]
148impl INListRideOptionsIntentResponse {
149    extern_methods!(
150        #[unsafe(method(new))]
151        #[unsafe(method_family = new)]
152        pub unsafe fn new() -> Retained<Self>;
153    );
154}