web_sys/features/
gen_PublicKeyCredentialRequestOptions.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PublicKeyCredentialRequestOptions)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `PublicKeyCredentialRequestOptions` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
12 pub type PublicKeyCredentialRequestOptions;
13 #[doc = "Get the `allowCredentials` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
16 #[wasm_bindgen(method, getter = "allowCredentials")]
17 pub fn get_allow_credentials(
18 this: &PublicKeyCredentialRequestOptions,
19 ) -> Option<::js_sys::Array>;
20 #[doc = "Change the `allowCredentials` field of this object."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
23 #[wasm_bindgen(method, setter = "allowCredentials")]
24 pub fn set_allow_credentials(
25 this: &PublicKeyCredentialRequestOptions,
26 val: &::wasm_bindgen::JsValue,
27 );
28 #[cfg(web_sys_unstable_apis)]
29 #[doc = "Get the `attestation` field of this object."]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
32 #[doc = ""]
33 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35 #[wasm_bindgen(method, getter = "attestation")]
36 pub fn get_attestation(
37 this: &PublicKeyCredentialRequestOptions,
38 ) -> Option<::alloc::string::String>;
39 #[cfg(web_sys_unstable_apis)]
40 #[doc = "Change the `attestation` field of this object."]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
43 #[doc = ""]
44 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
45 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
46 #[wasm_bindgen(method, setter = "attestation")]
47 pub fn set_attestation(this: &PublicKeyCredentialRequestOptions, val: &str);
48 #[cfg(web_sys_unstable_apis)]
49 #[doc = "Get the `attestationFormats` field of this object."]
50 #[doc = ""]
51 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
52 #[doc = ""]
53 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
55 #[wasm_bindgen(method, getter = "attestationFormats")]
56 pub fn get_attestation_formats(
57 this: &PublicKeyCredentialRequestOptions,
58 ) -> Option<::js_sys::Array>;
59 #[cfg(web_sys_unstable_apis)]
60 #[doc = "Change the `attestationFormats` field of this object."]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
63 #[doc = ""]
64 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
65 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
66 #[wasm_bindgen(method, setter = "attestationFormats")]
67 pub fn set_attestation_formats(
68 this: &PublicKeyCredentialRequestOptions,
69 val: &::wasm_bindgen::JsValue,
70 );
71 #[doc = "Get the `challenge` field of this object."]
72 #[doc = ""]
73 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
74 #[wasm_bindgen(method, getter = "challenge")]
75 pub fn get_challenge(this: &PublicKeyCredentialRequestOptions) -> ::js_sys::Object;
76 #[doc = "Change the `challenge` field of this object."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
79 #[wasm_bindgen(method, setter = "challenge")]
80 pub fn set_challenge(this: &PublicKeyCredentialRequestOptions, val: &::js_sys::Object);
81 #[cfg(feature = "AuthenticationExtensionsClientInputs")]
82 #[doc = "Get the `extensions` field of this object."]
83 #[doc = ""]
84 #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"]
85 #[wasm_bindgen(method, getter = "extensions")]
86 pub fn get_extensions(
87 this: &PublicKeyCredentialRequestOptions,
88 ) -> Option<AuthenticationExtensionsClientInputs>;
89 #[cfg(feature = "AuthenticationExtensionsClientInputs")]
90 #[doc = "Change the `extensions` field of this object."]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"]
93 #[wasm_bindgen(method, setter = "extensions")]
94 pub fn set_extensions(
95 this: &PublicKeyCredentialRequestOptions,
96 val: &AuthenticationExtensionsClientInputs,
97 );
98 #[cfg(web_sys_unstable_apis)]
99 #[doc = "Get the `hints` field of this object."]
100 #[doc = ""]
101 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
102 #[doc = ""]
103 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
104 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
105 #[wasm_bindgen(method, getter = "hints")]
106 pub fn get_hints(this: &PublicKeyCredentialRequestOptions) -> Option<::js_sys::Array>;
107 #[cfg(web_sys_unstable_apis)]
108 #[doc = "Change the `hints` field of this object."]
109 #[doc = ""]
110 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
111 #[doc = ""]
112 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
113 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
114 #[wasm_bindgen(method, setter = "hints")]
115 pub fn set_hints(this: &PublicKeyCredentialRequestOptions, val: &::wasm_bindgen::JsValue);
116 #[doc = "Get the `rpId` field of this object."]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
119 #[wasm_bindgen(method, getter = "rpId")]
120 pub fn get_rp_id(this: &PublicKeyCredentialRequestOptions) -> Option<::alloc::string::String>;
121 #[doc = "Change the `rpId` field of this object."]
122 #[doc = ""]
123 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
124 #[wasm_bindgen(method, setter = "rpId")]
125 pub fn set_rp_id(this: &PublicKeyCredentialRequestOptions, val: &str);
126 #[doc = "Get the `timeout` field of this object."]
127 #[doc = ""]
128 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
129 #[wasm_bindgen(method, getter = "timeout")]
130 pub fn get_timeout(this: &PublicKeyCredentialRequestOptions) -> Option<u32>;
131 #[doc = "Change the `timeout` field of this object."]
132 #[doc = ""]
133 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
134 #[wasm_bindgen(method, setter = "timeout")]
135 pub fn set_timeout(this: &PublicKeyCredentialRequestOptions, val: u32);
136 #[cfg(feature = "UserVerificationRequirement")]
137 #[doc = "Get the `userVerification` field of this object."]
138 #[doc = ""]
139 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"]
140 #[wasm_bindgen(method, getter = "userVerification")]
141 pub fn get_user_verification(
142 this: &PublicKeyCredentialRequestOptions,
143 ) -> Option<UserVerificationRequirement>;
144 #[cfg(feature = "UserVerificationRequirement")]
145 #[doc = "Change the `userVerification` field of this object."]
146 #[doc = ""]
147 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"]
148 #[wasm_bindgen(method, setter = "userVerification")]
149 pub fn set_user_verification(
150 this: &PublicKeyCredentialRequestOptions,
151 val: UserVerificationRequirement,
152 );
153}
154impl PublicKeyCredentialRequestOptions {
155 #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."]
156 #[doc = ""]
157 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
158 pub fn new(challenge: &::js_sys::Object) -> Self {
159 #[allow(unused_mut)]
160 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
161 ret.set_challenge(challenge);
162 ret
163 }
164 #[deprecated = "Use `set_allow_credentials()` instead."]
165 pub fn allow_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
166 self.set_allow_credentials(val);
167 self
168 }
169 #[cfg(web_sys_unstable_apis)]
170 #[deprecated = "Use `set_attestation()` instead."]
171 pub fn attestation(&mut self, val: &str) -> &mut Self {
172 self.set_attestation(val);
173 self
174 }
175 #[cfg(web_sys_unstable_apis)]
176 #[deprecated = "Use `set_attestation_formats()` instead."]
177 pub fn attestation_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
178 self.set_attestation_formats(val);
179 self
180 }
181 #[deprecated = "Use `set_challenge()` instead."]
182 pub fn challenge(&mut self, val: &::js_sys::Object) -> &mut Self {
183 self.set_challenge(val);
184 self
185 }
186 #[cfg(feature = "AuthenticationExtensionsClientInputs")]
187 #[deprecated = "Use `set_extensions()` instead."]
188 pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self {
189 self.set_extensions(val);
190 self
191 }
192 #[cfg(web_sys_unstable_apis)]
193 #[deprecated = "Use `set_hints()` instead."]
194 pub fn hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
195 self.set_hints(val);
196 self
197 }
198 #[deprecated = "Use `set_rp_id()` instead."]
199 pub fn rp_id(&mut self, val: &str) -> &mut Self {
200 self.set_rp_id(val);
201 self
202 }
203 #[deprecated = "Use `set_timeout()` instead."]
204 pub fn timeout(&mut self, val: u32) -> &mut Self {
205 self.set_timeout(val);
206 self
207 }
208 #[cfg(feature = "UserVerificationRequirement")]
209 #[deprecated = "Use `set_user_verification()` instead."]
210 pub fn user_verification(&mut self, val: UserVerificationRequirement) -> &mut Self {
211 self.set_user_verification(val);
212 self
213 }
214}