1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! 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/authenticationservices/asauthorizationopenidoperation?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type ASAuthorizationOpenIDOperation = NSString;
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationoperationimplicit?language=objc)
pub static ASAuthorizationOperationImplicit: &'static ASAuthorizationOpenIDOperation;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationoperationlogin?language=objc)
pub static ASAuthorizationOperationLogin: &'static ASAuthorizationOpenIDOperation;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationoperationrefresh?language=objc)
pub static ASAuthorizationOperationRefresh: &'static ASAuthorizationOpenIDOperation;
}
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationoperationlogout?language=objc)
pub static ASAuthorizationOperationLogout: &'static ASAuthorizationOpenIDOperation;
}
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asauthorizationopenidrequest?language=objc)
#[unsafe(super(ASAuthorizationRequest, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "ASAuthorizationRequest")]
pub struct ASAuthorizationOpenIDRequest;
);
#[cfg(feature = "ASAuthorizationRequest")]
extern_conformance!(
unsafe impl NSCoding for ASAuthorizationOpenIDRequest {}
);
#[cfg(feature = "ASAuthorizationRequest")]
extern_conformance!(
unsafe impl NSCopying for ASAuthorizationOpenIDRequest {}
);
#[cfg(feature = "ASAuthorizationRequest")]
unsafe impl CopyingHelper for ASAuthorizationOpenIDRequest {
type Result = Self;
}
#[cfg(feature = "ASAuthorizationRequest")]
extern_conformance!(
unsafe impl NSObjectProtocol for ASAuthorizationOpenIDRequest {}
);
#[cfg(feature = "ASAuthorizationRequest")]
extern_conformance!(
unsafe impl NSSecureCoding for ASAuthorizationOpenIDRequest {}
);
#[cfg(feature = "ASAuthorizationRequest")]
impl ASAuthorizationOpenIDRequest {
extern_methods!(
#[cfg(feature = "ASAuthorization")]
/// The contact information to be requested from the user. Only scopes for which this app was authorized for will be returned.
#[unsafe(method(requestedScopes))]
#[unsafe(method_family = none)]
pub unsafe fn requestedScopes(&self) -> Option<Retained<NSArray<ASAuthorizationScope>>>;
#[cfg(feature = "ASAuthorization")]
/// Setter for [`requestedScopes`][Self::requestedScopes].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setRequestedScopes:))]
#[unsafe(method_family = none)]
pub unsafe fn setRequestedScopes(
&self,
requested_scopes: Option<&NSArray<ASAuthorizationScope>>,
);
/// State to be passed to the identity provider. This value will be returned as a part of successful ASAuthorization response.
///
/// Note: The state size may depend on the actual technology used and an error might be returned by the request execution.
#[unsafe(method(state))]
#[unsafe(method_family = none)]
pub unsafe fn state(&self) -> Option<Retained<NSString>>;
/// Setter for [`state`][Self::state].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setState:))]
#[unsafe(method_family = none)]
pub unsafe fn setState(&self, state: Option<&NSString>);
/// Nonce to be passed to the identity provider. This value can be verified with the identity token provided as a part of successful ASAuthorization response.
///
/// Note: The nonce size may depend on the actual technology used and an error might be returned by the request execution.
#[unsafe(method(nonce))]
#[unsafe(method_family = none)]
pub unsafe fn nonce(&self) -> Option<Retained<NSString>>;
/// Setter for [`nonce`][Self::nonce].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setNonce:))]
#[unsafe(method_family = none)]
pub unsafe fn setNonce(&self, nonce: Option<&NSString>);
/// Operation to be executed by the request. The ASAuthorizationOperationImplicit operation interpretation depends on the credential provider implementation.
#[unsafe(method(requestedOperation))]
#[unsafe(method_family = none)]
pub unsafe fn requestedOperation(&self) -> Retained<ASAuthorizationOpenIDOperation>;
/// Setter for [`requestedOperation`][Self::requestedOperation].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setRequestedOperation:))]
#[unsafe(method_family = none)]
pub unsafe fn setRequestedOperation(
&self,
requested_operation: &ASAuthorizationOpenIDOperation,
);
);
}
/// Methods declared on superclass `ASAuthorizationRequest`.
#[cfg(feature = "ASAuthorizationRequest")]
impl ASAuthorizationOpenIDRequest {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}