objc2_intents/generated/
INSearchForAccountsIntentResponse.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/insearchforaccountsintentresponsecode?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct INSearchForAccountsIntentResponseCode(pub NSInteger);
15impl INSearchForAccountsIntentResponseCode {
16    #[doc(alias = "INSearchForAccountsIntentResponseCodeUnspecified")]
17    pub const Unspecified: Self = Self(0);
18    #[doc(alias = "INSearchForAccountsIntentResponseCodeReady")]
19    pub const Ready: Self = Self(1);
20    #[doc(alias = "INSearchForAccountsIntentResponseCodeInProgress")]
21    pub const InProgress: Self = Self(2);
22    #[doc(alias = "INSearchForAccountsIntentResponseCodeSuccess")]
23    pub const Success: Self = Self(3);
24    #[doc(alias = "INSearchForAccountsIntentResponseCodeFailure")]
25    pub const Failure: Self = Self(4);
26    #[doc(alias = "INSearchForAccountsIntentResponseCodeFailureRequiringAppLaunch")]
27    pub const FailureRequiringAppLaunch: Self = Self(5);
28    #[doc(alias = "INSearchForAccountsIntentResponseCodeFailureCredentialsUnverified")]
29    pub const FailureCredentialsUnverified: Self = Self(6);
30    #[doc(alias = "INSearchForAccountsIntentResponseCodeFailureAccountNotFound")]
31    pub const FailureAccountNotFound: Self = Self(7);
32    #[doc(
33        alias = "INSearchForAccountsIntentResponseCodeFailureTermsAndConditionsAcceptanceRequired"
34    )]
35    pub const FailureTermsAndConditionsAcceptanceRequired: Self = Self(8);
36    #[doc(alias = "INSearchForAccountsIntentResponseCodeFailureNotEligible")]
37    pub const FailureNotEligible: Self = Self(9);
38}
39
40unsafe impl Encode for INSearchForAccountsIntentResponseCode {
41    const ENCODING: Encoding = NSInteger::ENCODING;
42}
43
44unsafe impl RefEncode for INSearchForAccountsIntentResponseCode {
45    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
46}
47
48extern_class!(
49    /// [Apple's documentation](https://developer.apple.com/documentation/intents/insearchforaccountsintentresponse?language=objc)
50    #[unsafe(super(INIntentResponse, NSObject))]
51    #[derive(Debug, PartialEq, Eq, Hash)]
52    #[cfg(feature = "INIntentResponse")]
53    pub struct INSearchForAccountsIntentResponse;
54);
55
56#[cfg(feature = "INIntentResponse")]
57extern_conformance!(
58    unsafe impl NSCoding for INSearchForAccountsIntentResponse {}
59);
60
61#[cfg(feature = "INIntentResponse")]
62extern_conformance!(
63    unsafe impl NSCopying for INSearchForAccountsIntentResponse {}
64);
65
66#[cfg(feature = "INIntentResponse")]
67unsafe impl CopyingHelper for INSearchForAccountsIntentResponse {
68    type Result = Self;
69}
70
71#[cfg(feature = "INIntentResponse")]
72extern_conformance!(
73    unsafe impl NSObjectProtocol for INSearchForAccountsIntentResponse {}
74);
75
76#[cfg(feature = "INIntentResponse")]
77extern_conformance!(
78    unsafe impl NSSecureCoding for INSearchForAccountsIntentResponse {}
79);
80
81#[cfg(feature = "INIntentResponse")]
82impl INSearchForAccountsIntentResponse {
83    extern_methods!(
84        #[unsafe(method(init))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
87
88        #[unsafe(method(initWithCode:userActivity:))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn initWithCode_userActivity(
91            this: Allocated<Self>,
92            code: INSearchForAccountsIntentResponseCode,
93            user_activity: Option<&NSUserActivity>,
94        ) -> Retained<Self>;
95
96        #[unsafe(method(code))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn code(&self) -> INSearchForAccountsIntentResponseCode;
99
100        #[cfg(feature = "INPaymentAccount")]
101        #[unsafe(method(accounts))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn accounts(&self) -> Option<Retained<NSArray<INPaymentAccount>>>;
104
105        #[cfg(feature = "INPaymentAccount")]
106        /// Setter for [`accounts`][Self::accounts].
107        ///
108        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
109        #[unsafe(method(setAccounts:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn setAccounts(&self, accounts: Option<&NSArray<INPaymentAccount>>);
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116#[cfg(feature = "INIntentResponse")]
117impl INSearchForAccountsIntentResponse {
118    extern_methods!(
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122    );
123}