objc2_authentication_services/generated/ASPasswordCredentialIdentity.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 password based authentication.
12 /// Use this class to save entries into ASCredentialIdentityStore.
13 ///
14 /// See also [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/aspasswordcredentialidentity?language=objc)
15 #[unsafe(super(NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct ASPasswordCredentialIdentity;
18);
19
20#[cfg(feature = "ASCredentialIdentity")]
21extern_conformance!(
22 unsafe impl ASCredentialIdentity for ASPasswordCredentialIdentity {}
23);
24
25extern_conformance!(
26 unsafe impl NSCoding for ASPasswordCredentialIdentity {}
27);
28
29extern_conformance!(
30 unsafe impl NSCopying for ASPasswordCredentialIdentity {}
31);
32
33unsafe impl CopyingHelper for ASPasswordCredentialIdentity {
34 type Result = Self;
35}
36
37extern_conformance!(
38 unsafe impl NSObjectProtocol for ASPasswordCredentialIdentity {}
39);
40
41extern_conformance!(
42 unsafe impl NSSecureCoding for ASPasswordCredentialIdentity {}
43);
44
45impl ASPasswordCredentialIdentity {
46 extern_methods!(
47 #[unsafe(method(init))]
48 #[unsafe(method_family = init)]
49 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
50
51 #[cfg(feature = "ASCredentialServiceIdentifier")]
52 /// Initializes an instance of ASPasswordCredentialIdentity.
53 ///
54 /// Parameter `serviceIdentifier`: the service identifier for which this credential identity is valid.
55 ///
56 /// Parameter `user`: the user that can authenticate into the service indicated by the serviceIdentifier.
57 ///
58 /// Parameter `recordIdentifier`: an optional string to uniquely identify this record in your local database.
59 #[unsafe(method(initWithServiceIdentifier:user:recordIdentifier:))]
60 #[unsafe(method_family = init)]
61 pub unsafe fn initWithServiceIdentifier_user_recordIdentifier(
62 this: Allocated<Self>,
63 service_identifier: &ASCredentialServiceIdentifier,
64 user: &NSString,
65 record_identifier: Option<&NSString>,
66 ) -> Retained<Self>;
67
68 #[cfg(feature = "ASCredentialServiceIdentifier")]
69 /// Creates and initializes an instance of ASPasswordCredentialIdentity.
70 ///
71 /// Parameter `serviceIdentifier`: the service identifier for which this credential identity is valid.
72 ///
73 /// Parameter `user`: the user that can authenticate into the service indicated by the serviceIdentifier.
74 ///
75 /// Parameter `recordIdentifier`: an optional string to uniquely identify this record in your local database.
76 #[unsafe(method(identityWithServiceIdentifier:user:recordIdentifier:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn identityWithServiceIdentifier_user_recordIdentifier(
79 service_identifier: &ASCredentialServiceIdentifier,
80 user: &NSString,
81 record_identifier: Option<&NSString>,
82 ) -> Retained<Self>;
83
84 #[cfg(feature = "ASCredentialServiceIdentifier")]
85 /// Get the service identifier.
86 ///
87 /// Returns: The service identifier for this credential identity.
88 #[unsafe(method(serviceIdentifier))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn serviceIdentifier(&self) -> Retained<ASCredentialServiceIdentifier>;
91
92 /// Get the user.
93 ///
94 /// Returns: The user string.
95 #[unsafe(method(user))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn user(&self) -> Retained<NSString>;
98
99 /// Get the record identifier.
100 ///
101 /// Returns: The record identifier.
102 ///
103 /// You can utilize the record identifier to uniquely identify the credential identity in your local database.
104 #[unsafe(method(recordIdentifier))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn recordIdentifier(&self) -> Option<Retained<NSString>>;
107
108 /// Get or set the rank of the credential identity object.
109 ///
110 /// The system may utilize the rank to decide which credential identity precedes the other
111 /// if two identities have the same service identifier. A credential identity with a larger rank value
112 /// precedes one with a smaller value if both credential identities have the same service identifier.
113 /// The default value of this property is 0.
114 #[unsafe(method(rank))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn rank(&self) -> NSInteger;
117
118 /// Setter for [`rank`][Self::rank].
119 #[unsafe(method(setRank:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn setRank(&self, rank: NSInteger);
122 );
123}
124
125/// Methods declared on superclass `NSObject`.
126impl ASPasswordCredentialIdentity {
127 extern_methods!(
128 #[unsafe(method(new))]
129 #[unsafe(method_family = new)]
130 pub unsafe fn new() -> Retained<Self>;
131 );
132}