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