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