objc2_authentication_services/generated/
ASAuthorizationAppleIDCredential.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct ASUserDetectionStatus(pub NSInteger);
14impl ASUserDetectionStatus {
15 #[doc(alias = "ASUserDetectionStatusUnsupported")]
16 pub const Unsupported: Self = Self(0);
17 #[doc(alias = "ASUserDetectionStatusUnknown")]
18 pub const Unknown: Self = Self(1);
19 #[doc(alias = "ASUserDetectionStatusLikelyReal")]
20 pub const LikelyReal: Self = Self(2);
21}
22
23unsafe impl Encode for ASUserDetectionStatus {
24 const ENCODING: Encoding = NSInteger::ENCODING;
25}
26
27unsafe impl RefEncode for ASUserDetectionStatus {
28 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31#[repr(transparent)]
34#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
35pub struct ASUserAgeRange(pub NSInteger);
36impl ASUserAgeRange {
37 #[doc(alias = "ASUserAgeRangeUnknown")]
38 pub const Unknown: Self = Self(0);
39 #[doc(alias = "ASUserAgeRangeChild")]
40 pub const Child: Self = Self(1);
41 #[doc(alias = "ASUserAgeRangeNotChild")]
42 pub const NotChild: Self = Self(2);
43}
44
45unsafe impl Encode for ASUserAgeRange {
46 const ENCODING: Encoding = NSInteger::ENCODING;
47}
48
49unsafe impl RefEncode for ASUserAgeRange {
50 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
51}
52
53extern_class!(
54 #[unsafe(super(NSObject))]
56 #[derive(Debug, PartialEq, Eq, Hash)]
57 pub struct ASAuthorizationAppleIDCredential;
58);
59
60#[cfg(feature = "ASAuthorizationCredential")]
61extern_conformance!(
62 unsafe impl ASAuthorizationCredential for ASAuthorizationAppleIDCredential {}
63);
64
65extern_conformance!(
66 unsafe impl NSCoding for ASAuthorizationAppleIDCredential {}
67);
68
69extern_conformance!(
70 unsafe impl NSCopying for ASAuthorizationAppleIDCredential {}
71);
72
73unsafe impl CopyingHelper for ASAuthorizationAppleIDCredential {
74 type Result = Self;
75}
76
77extern_conformance!(
78 unsafe impl NSObjectProtocol for ASAuthorizationAppleIDCredential {}
79);
80
81extern_conformance!(
82 unsafe impl NSSecureCoding for ASAuthorizationAppleIDCredential {}
83);
84
85impl ASAuthorizationAppleIDCredential {
86 extern_methods!(
87 #[unsafe(method(user))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn user(&self) -> Retained<NSString>;
95
96 #[unsafe(method(state))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn state(&self) -> Option<Retained<NSString>>;
100
101 #[cfg(feature = "ASAuthorization")]
102 #[unsafe(method(authorizedScopes))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn authorizedScopes(&self) -> Retained<NSArray<ASAuthorizationScope>>;
108
109 #[unsafe(method(authorizationCode))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn authorizationCode(&self) -> Option<Retained<NSData>>;
113
114 #[unsafe(method(identityToken))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn identityToken(&self) -> Option<Retained<NSData>>;
118
119 #[unsafe(method(email))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn email(&self) -> Option<Retained<NSString>>;
123
124 #[unsafe(method(fullName))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn fullName(&self) -> Option<Retained<NSPersonNameComponents>>;
128
129 #[unsafe(method(realUserStatus))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn realUserStatus(&self) -> ASUserDetectionStatus;
135
136 #[unsafe(method(userAgeRange))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn userAgeRange(&self) -> ASUserAgeRange;
142
143 #[unsafe(method(new))]
144 #[unsafe(method_family = new)]
145 pub unsafe fn new() -> Retained<Self>;
146
147 #[unsafe(method(init))]
148 #[unsafe(method_family = init)]
149 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
150 );
151}