objc2_authentication_services/generated/ASPasskeyCredentialIdentity.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
10extern_class!(
11 /// An ASPasswordCredentialIdentity is used to describe an identity that can use a service upon successful passkey based authentication.
12 /// Use this class to save entries into ASCredentialIdentityStore.
13 ///
14 /// See also [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/aspasskeycredentialidentity?language=objc)
15 #[unsafe(super(NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct ASPasskeyCredentialIdentity;
18);
19
20#[cfg(feature = "ASCredentialIdentity")]
21extern_conformance!(
22 unsafe impl ASCredentialIdentity for ASPasskeyCredentialIdentity {}
23);
24
25extern_conformance!(
26 unsafe impl NSCoding for ASPasskeyCredentialIdentity {}
27);
28
29extern_conformance!(
30 unsafe impl NSCopying for ASPasskeyCredentialIdentity {}
31);
32
33unsafe impl CopyingHelper for ASPasskeyCredentialIdentity {
34 type Result = Self;
35}
36
37extern_conformance!(
38 unsafe impl NSObjectProtocol for ASPasskeyCredentialIdentity {}
39);
40
41extern_conformance!(
42 unsafe impl NSSecureCoding for ASPasskeyCredentialIdentity {}
43);
44
45impl ASPasskeyCredentialIdentity {
46 extern_methods!(
47 #[unsafe(method(init))]
48 #[unsafe(method_family = init)]
49 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
50
51 /// Initialize an instance of ASPasskeyCredentialIdentity.
52 ///
53 /// Parameter `relyingPartyIdentifier`: relying party for this credential.
54 ///
55 /// Parameter `userName`: user name associated with this credential.
56 ///
57 /// Parameter `credentialID`: credential ID of this passkey credential.
58 ///
59 /// Parameter `userHandle`: user handle data of this passkey credential.
60 ///
61 /// Parameter `recordIdentifier`: identifier used by credential provider extension to identify this credential.
62 #[unsafe(method(initWithRelyingPartyIdentifier:userName:credentialID:userHandle:recordIdentifier:))]
63 #[unsafe(method_family = init)]
64 pub unsafe fn initWithRelyingPartyIdentifier_userName_credentialID_userHandle_recordIdentifier(
65 this: Allocated<Self>,
66 relying_party_identifier: &NSString,
67 user_name: &NSString,
68 credential_id: &NSData,
69 user_handle: &NSData,
70 record_identifier: Option<&NSString>,
71 ) -> Retained<Self>;
72
73 /// Create and initialize an instance of ASPasskeyCredentialIdentity.
74 ///
75 /// Parameter `relyingPartyIdentifier`: relying party for this credential.
76 ///
77 /// Parameter `userName`: user name associated with this credential.
78 ///
79 /// Parameter `credentialID`: credential ID of this passkey credential.
80 ///
81 /// Parameter `userHandle`: user handle data of this passkey credential.
82 ///
83 /// Parameter `recordIdentifier`: identifier used by credential provider extension to identify this credential.
84 #[unsafe(method(identityWithRelyingPartyIdentifier:userName:credentialID:userHandle:recordIdentifier:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn identityWithRelyingPartyIdentifier_userName_credentialID_userHandle_recordIdentifier(
87 relying_party_identifier: &NSString,
88 user_name: &NSString,
89 credential_id: &NSData,
90 user_handle: &NSData,
91 record_identifier: Option<&NSString>,
92 ) -> Retained<Self>;
93
94 /// The relying party identifier of this passkey credential.
95 ///
96 /// This field is reported as the serviceIdentifier property of ASCredentialIdentity.
97 #[unsafe(method(relyingPartyIdentifier))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn relyingPartyIdentifier(&self) -> Retained<NSString>;
100
101 /// The user name of this passkey credential.
102 ///
103 /// This field is reported as the user property of ASCredentialIdentity.
104 #[unsafe(method(userName))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn userName(&self) -> Retained<NSString>;
107
108 /// The credential ID of this passkey credential.
109 ///
110 /// This field is used to identify the correct credential to use based on relying party request parameters.
111 #[unsafe(method(credentialID))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn credentialID(&self) -> Retained<NSData>;
114
115 /// The user handle of this passkey credential.
116 ///
117 /// This field is used to identify the correct credential to use based on relying party request parameters.
118 #[unsafe(method(userHandle))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn userHandle(&self) -> Retained<NSData>;
121
122 /// Get the record identifier.
123 ///
124 /// Returns: The record identifier.
125 ///
126 /// You can utilize the record identifier to uniquely identify the credential identity in your local database.
127 #[unsafe(method(recordIdentifier))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn recordIdentifier(&self) -> Option<Retained<NSString>>;
130
131 /// Get or set the rank of the credential identity object.
132 ///
133 /// The system may utilize the rank to decide which credential identity precedes the other
134 /// if two identities have the same service identifier. A credential identity with a larger rank value
135 /// precedes one with a smaller value if both credential identities have the same service identifier.
136 /// The default value of this property is 0.
137 #[unsafe(method(rank))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn rank(&self) -> NSInteger;
140
141 /// Setter for [`rank`][Self::rank].
142 #[unsafe(method(setRank:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn setRank(&self, rank: NSInteger);
145 );
146}
147
148/// Methods declared on superclass `NSObject`.
149impl ASPasskeyCredentialIdentity {
150 extern_methods!(
151 #[unsafe(method(new))]
152 #[unsafe(method_family = new)]
153 pub unsafe fn new() -> Retained<Self>;
154 );
155}