Skip to main content

web_sys/features/
gen_PublicKeyCredentialRequestOptionsJson.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    #[wasm_bindgen(
9        extends = "::js_sys::Object",
10        js_name = "PublicKeyCredentialRequestOptionsJSON"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `PublicKeyCredentialRequestOptionsJson` dictionary."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
16    #[doc = ""]
17    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
18    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
19    pub type PublicKeyCredentialRequestOptionsJson;
20    #[cfg(web_sys_unstable_apis)]
21    #[cfg(feature = "PublicKeyCredentialDescriptorJson")]
22    #[doc = "Get the `allowCredentials` field of this object."]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`, `PublicKeyCredentialRequestOptionsJson`*"]
25    #[doc = ""]
26    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
27    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
28    #[wasm_bindgen(method, getter = "allowCredentials")]
29    pub fn get_allow_credentials(
30        this: &PublicKeyCredentialRequestOptionsJson,
31    ) -> Option<::js_sys::Array<PublicKeyCredentialDescriptorJson>>;
32    #[cfg(web_sys_unstable_apis)]
33    #[cfg(feature = "PublicKeyCredentialDescriptorJson")]
34    #[doc = "Change the `allowCredentials` field of this object."]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialDescriptorJson`, `PublicKeyCredentialRequestOptionsJson`*"]
37    #[doc = ""]
38    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
40    #[wasm_bindgen(method, setter = "allowCredentials")]
41    pub fn set_allow_credentials(
42        this: &PublicKeyCredentialRequestOptionsJson,
43        val: &[PublicKeyCredentialDescriptorJson],
44    );
45    #[cfg(web_sys_unstable_apis)]
46    #[doc = "Get the `attestation` field of this object."]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
49    #[doc = ""]
50    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
52    #[wasm_bindgen(method, getter = "attestation")]
53    pub fn get_attestation(
54        this: &PublicKeyCredentialRequestOptionsJson,
55    ) -> Option<::alloc::string::String>;
56    #[cfg(web_sys_unstable_apis)]
57    #[doc = "Change the `attestation` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
60    #[doc = ""]
61    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    #[wasm_bindgen(method, setter = "attestation")]
64    pub fn set_attestation(this: &PublicKeyCredentialRequestOptionsJson, val: &str);
65    #[cfg(web_sys_unstable_apis)]
66    #[doc = "Get the `attestationFormats` field of this object."]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
69    #[doc = ""]
70    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
71    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
72    #[wasm_bindgen(method, getter = "attestationFormats")]
73    pub fn get_attestation_formats(
74        this: &PublicKeyCredentialRequestOptionsJson,
75    ) -> Option<::js_sys::Array<::js_sys::JsString>>;
76    #[cfg(web_sys_unstable_apis)]
77    #[doc = "Change the `attestationFormats` field of this object."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
80    #[doc = ""]
81    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
83    #[wasm_bindgen(method, setter = "attestationFormats")]
84    pub fn set_attestation_formats(
85        this: &PublicKeyCredentialRequestOptionsJson,
86        val: &[::js_sys::JsString],
87    );
88    #[cfg(web_sys_unstable_apis)]
89    #[doc = "Get the `challenge` field of this object."]
90    #[doc = ""]
91    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
92    #[doc = ""]
93    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
94    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
95    #[wasm_bindgen(method, getter = "challenge")]
96    pub fn get_challenge(this: &PublicKeyCredentialRequestOptionsJson) -> ::alloc::string::String;
97    #[cfg(web_sys_unstable_apis)]
98    #[doc = "Change the `challenge` field of this object."]
99    #[doc = ""]
100    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
101    #[doc = ""]
102    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
103    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
104    #[wasm_bindgen(method, setter = "challenge")]
105    pub fn set_challenge(this: &PublicKeyCredentialRequestOptionsJson, val: &str);
106    #[cfg(web_sys_unstable_apis)]
107    #[cfg(feature = "AuthenticationExtensionsClientInputsJson")]
108    #[doc = "Get the `extensions` field of this object."]
109    #[doc = ""]
110    #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`, `PublicKeyCredentialRequestOptionsJson`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
114    #[wasm_bindgen(method, getter = "extensions")]
115    pub fn get_extensions(
116        this: &PublicKeyCredentialRequestOptionsJson,
117    ) -> Option<AuthenticationExtensionsClientInputsJson>;
118    #[cfg(web_sys_unstable_apis)]
119    #[cfg(feature = "AuthenticationExtensionsClientInputsJson")]
120    #[doc = "Change the `extensions` field of this object."]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`, `PublicKeyCredentialRequestOptionsJson`*"]
123    #[doc = ""]
124    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
125    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
126    #[wasm_bindgen(method, setter = "extensions")]
127    pub fn set_extensions(
128        this: &PublicKeyCredentialRequestOptionsJson,
129        val: &AuthenticationExtensionsClientInputsJson,
130    );
131    #[cfg(web_sys_unstable_apis)]
132    #[doc = "Get the `hints` field of this object."]
133    #[doc = ""]
134    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
135    #[doc = ""]
136    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
137    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
138    #[wasm_bindgen(method, getter = "hints")]
139    pub fn get_hints(
140        this: &PublicKeyCredentialRequestOptionsJson,
141    ) -> Option<::js_sys::Array<::js_sys::JsString>>;
142    #[cfg(web_sys_unstable_apis)]
143    #[doc = "Change the `hints` field of this object."]
144    #[doc = ""]
145    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
146    #[doc = ""]
147    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
148    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
149    #[wasm_bindgen(method, setter = "hints")]
150    pub fn set_hints(this: &PublicKeyCredentialRequestOptionsJson, val: &[::js_sys::JsString]);
151    #[cfg(web_sys_unstable_apis)]
152    #[doc = "Get the `rpId` field of this object."]
153    #[doc = ""]
154    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
155    #[doc = ""]
156    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
157    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
158    #[wasm_bindgen(method, getter = "rpId")]
159    pub fn get_rp_id(
160        this: &PublicKeyCredentialRequestOptionsJson,
161    ) -> Option<::alloc::string::String>;
162    #[cfg(web_sys_unstable_apis)]
163    #[doc = "Change the `rpId` field of this object."]
164    #[doc = ""]
165    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
166    #[doc = ""]
167    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
168    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
169    #[wasm_bindgen(method, setter = "rpId")]
170    pub fn set_rp_id(this: &PublicKeyCredentialRequestOptionsJson, val: &str);
171    #[cfg(web_sys_unstable_apis)]
172    #[doc = "Get the `timeout` field of this object."]
173    #[doc = ""]
174    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
175    #[doc = ""]
176    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
177    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
178    #[wasm_bindgen(method, getter = "timeout")]
179    pub fn get_timeout(this: &PublicKeyCredentialRequestOptionsJson) -> Option<u32>;
180    #[cfg(web_sys_unstable_apis)]
181    #[doc = "Change the `timeout` field of this object."]
182    #[doc = ""]
183    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
184    #[doc = ""]
185    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
186    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
187    #[wasm_bindgen(method, setter = "timeout")]
188    pub fn set_timeout(this: &PublicKeyCredentialRequestOptionsJson, val: u32);
189    #[cfg(web_sys_unstable_apis)]
190    #[doc = "Get the `userVerification` field of this object."]
191    #[doc = ""]
192    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
193    #[doc = ""]
194    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
195    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
196    #[wasm_bindgen(method, getter = "userVerification")]
197    pub fn get_user_verification(
198        this: &PublicKeyCredentialRequestOptionsJson,
199    ) -> Option<::alloc::string::String>;
200    #[cfg(web_sys_unstable_apis)]
201    #[doc = "Change the `userVerification` field of this object."]
202    #[doc = ""]
203    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
204    #[doc = ""]
205    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
206    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
207    #[wasm_bindgen(method, setter = "userVerification")]
208    pub fn set_user_verification(this: &PublicKeyCredentialRequestOptionsJson, val: &str);
209}
210#[cfg(web_sys_unstable_apis)]
211impl PublicKeyCredentialRequestOptionsJson {
212    #[doc = "Construct a new `PublicKeyCredentialRequestOptionsJson`."]
213    #[doc = ""]
214    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptionsJson`*"]
215    #[doc = ""]
216    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
217    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
218    pub fn new(challenge: &str) -> Self {
219        #[allow(unused_mut)]
220        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
221        ret.set_challenge(challenge);
222        ret
223    }
224    #[cfg(web_sys_unstable_apis)]
225    #[cfg(feature = "PublicKeyCredentialDescriptorJson")]
226    #[deprecated = "Use `set_allow_credentials()` instead."]
227    pub fn allow_credentials(&mut self, val: &[PublicKeyCredentialDescriptorJson]) -> &mut Self {
228        self.set_allow_credentials(val);
229        self
230    }
231    #[cfg(web_sys_unstable_apis)]
232    #[deprecated = "Use `set_attestation()` instead."]
233    pub fn attestation(&mut self, val: &str) -> &mut Self {
234        self.set_attestation(val);
235        self
236    }
237    #[cfg(web_sys_unstable_apis)]
238    #[deprecated = "Use `set_attestation_formats()` instead."]
239    pub fn attestation_formats(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
240        self.set_attestation_formats(val);
241        self
242    }
243    #[cfg(web_sys_unstable_apis)]
244    #[deprecated = "Use `set_challenge()` instead."]
245    pub fn challenge(&mut self, val: &str) -> &mut Self {
246        self.set_challenge(val);
247        self
248    }
249    #[cfg(web_sys_unstable_apis)]
250    #[cfg(feature = "AuthenticationExtensionsClientInputsJson")]
251    #[deprecated = "Use `set_extensions()` instead."]
252    pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputsJson) -> &mut Self {
253        self.set_extensions(val);
254        self
255    }
256    #[cfg(web_sys_unstable_apis)]
257    #[deprecated = "Use `set_hints()` instead."]
258    pub fn hints(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
259        self.set_hints(val);
260        self
261    }
262    #[cfg(web_sys_unstable_apis)]
263    #[deprecated = "Use `set_rp_id()` instead."]
264    pub fn rp_id(&mut self, val: &str) -> &mut Self {
265        self.set_rp_id(val);
266        self
267    }
268    #[cfg(web_sys_unstable_apis)]
269    #[deprecated = "Use `set_timeout()` instead."]
270    pub fn timeout(&mut self, val: u32) -> &mut Self {
271        self.set_timeout(val);
272        self
273    }
274    #[cfg(web_sys_unstable_apis)]
275    #[deprecated = "Use `set_user_verification()` instead."]
276    pub fn user_verification(&mut self, val: &str) -> &mut Self {
277        self.set_user_verification(val);
278        self
279    }
280}