web_sys/features/
gen_PublicKeyCredentialCreationOptionsJson.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 = PublicKeyCredentialCreationOptionsJSON)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `PublicKeyCredentialCreationOptionsJson` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type PublicKeyCredentialCreationOptionsJson;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `attestation` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "attestation")]
25    pub fn get_attestation(
26        this: &PublicKeyCredentialCreationOptionsJson,
27    ) -> Option<::alloc::string::String>;
28    #[cfg(web_sys_unstable_apis)]
29    #[doc = "Change the `attestation` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
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, setter = "attestation")]
36    pub fn set_attestation(this: &PublicKeyCredentialCreationOptionsJson, val: &str);
37    #[cfg(web_sys_unstable_apis)]
38    #[doc = "Get the `attestationFormats` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
41    #[doc = ""]
42    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44    #[wasm_bindgen(method, getter = "attestationFormats")]
45    pub fn get_attestation_formats(
46        this: &PublicKeyCredentialCreationOptionsJson,
47    ) -> Option<::js_sys::Array>;
48    #[cfg(web_sys_unstable_apis)]
49    #[doc = "Change the `attestationFormats` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
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, setter = "attestationFormats")]
56    pub fn set_attestation_formats(
57        this: &PublicKeyCredentialCreationOptionsJson,
58        val: &::wasm_bindgen::JsValue,
59    );
60    #[cfg(web_sys_unstable_apis)]
61    #[cfg(feature = "AuthenticatorSelectionCriteria")]
62    #[doc = "Get the `authenticatorSelection` field of this object."]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptionsJson`*"]
65    #[doc = ""]
66    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
67    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
68    #[wasm_bindgen(method, getter = "authenticatorSelection")]
69    pub fn get_authenticator_selection(
70        this: &PublicKeyCredentialCreationOptionsJson,
71    ) -> Option<AuthenticatorSelectionCriteria>;
72    #[cfg(web_sys_unstable_apis)]
73    #[cfg(feature = "AuthenticatorSelectionCriteria")]
74    #[doc = "Change the `authenticatorSelection` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptionsJson`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    #[wasm_bindgen(method, setter = "authenticatorSelection")]
81    pub fn set_authenticator_selection(
82        this: &PublicKeyCredentialCreationOptionsJson,
83        val: &AuthenticatorSelectionCriteria,
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: `PublicKeyCredentialCreationOptionsJson`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
92    #[wasm_bindgen(method, getter = "challenge")]
93    pub fn get_challenge(this: &PublicKeyCredentialCreationOptionsJson) -> ::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: `PublicKeyCredentialCreationOptionsJson`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
101    #[wasm_bindgen(method, setter = "challenge")]
102    pub fn set_challenge(this: &PublicKeyCredentialCreationOptionsJson, val: &str);
103    #[cfg(web_sys_unstable_apis)]
104    #[doc = "Get the `excludeCredentials` field of this object."]
105    #[doc = ""]
106    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
107    #[doc = ""]
108    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
109    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
110    #[wasm_bindgen(method, getter = "excludeCredentials")]
111    pub fn get_exclude_credentials(
112        this: &PublicKeyCredentialCreationOptionsJson,
113    ) -> Option<::js_sys::Array>;
114    #[cfg(web_sys_unstable_apis)]
115    #[doc = "Change the `excludeCredentials` field of this object."]
116    #[doc = ""]
117    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
118    #[doc = ""]
119    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
120    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
121    #[wasm_bindgen(method, setter = "excludeCredentials")]
122    pub fn set_exclude_credentials(
123        this: &PublicKeyCredentialCreationOptionsJson,
124        val: &::wasm_bindgen::JsValue,
125    );
126    #[cfg(web_sys_unstable_apis)]
127    #[cfg(feature = "AuthenticationExtensionsClientInputsJson")]
128    #[doc = "Get the `extensions` field of this object."]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`, `PublicKeyCredentialCreationOptionsJson`*"]
131    #[doc = ""]
132    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
133    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
134    #[wasm_bindgen(method, getter = "extensions")]
135    pub fn get_extensions(
136        this: &PublicKeyCredentialCreationOptionsJson,
137    ) -> Option<AuthenticationExtensionsClientInputsJson>;
138    #[cfg(web_sys_unstable_apis)]
139    #[cfg(feature = "AuthenticationExtensionsClientInputsJson")]
140    #[doc = "Change the `extensions` field of this object."]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputsJson`, `PublicKeyCredentialCreationOptionsJson`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
146    #[wasm_bindgen(method, setter = "extensions")]
147    pub fn set_extensions(
148        this: &PublicKeyCredentialCreationOptionsJson,
149        val: &AuthenticationExtensionsClientInputsJson,
150    );
151    #[cfg(web_sys_unstable_apis)]
152    #[doc = "Get the `hints` field of this object."]
153    #[doc = ""]
154    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
158    #[wasm_bindgen(method, getter = "hints")]
159    pub fn get_hints(this: &PublicKeyCredentialCreationOptionsJson) -> Option<::js_sys::Array>;
160    #[cfg(web_sys_unstable_apis)]
161    #[doc = "Change the `hints` field of this object."]
162    #[doc = ""]
163    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
164    #[doc = ""]
165    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
166    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
167    #[wasm_bindgen(method, setter = "hints")]
168    pub fn set_hints(this: &PublicKeyCredentialCreationOptionsJson, val: &::wasm_bindgen::JsValue);
169    #[cfg(web_sys_unstable_apis)]
170    #[doc = "Get the `pubKeyCredParams` field of this object."]
171    #[doc = ""]
172    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
173    #[doc = ""]
174    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
175    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
176    #[wasm_bindgen(method, getter = "pubKeyCredParams")]
177    pub fn get_pub_key_cred_params(
178        this: &PublicKeyCredentialCreationOptionsJson,
179    ) -> ::js_sys::Array;
180    #[cfg(web_sys_unstable_apis)]
181    #[doc = "Change the `pubKeyCredParams` field of this object."]
182    #[doc = ""]
183    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
187    #[wasm_bindgen(method, setter = "pubKeyCredParams")]
188    pub fn set_pub_key_cred_params(
189        this: &PublicKeyCredentialCreationOptionsJson,
190        val: &::wasm_bindgen::JsValue,
191    );
192    #[cfg(web_sys_unstable_apis)]
193    #[cfg(feature = "PublicKeyCredentialRpEntity")]
194    #[doc = "Get the `rp` field of this object."]
195    #[doc = ""]
196    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialRpEntity`*"]
197    #[doc = ""]
198    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
199    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
200    #[wasm_bindgen(method, getter = "rp")]
201    pub fn get_rp(this: &PublicKeyCredentialCreationOptionsJson) -> PublicKeyCredentialRpEntity;
202    #[cfg(web_sys_unstable_apis)]
203    #[cfg(feature = "PublicKeyCredentialRpEntity")]
204    #[doc = "Change the `rp` field of this object."]
205    #[doc = ""]
206    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialRpEntity`*"]
207    #[doc = ""]
208    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
209    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
210    #[wasm_bindgen(method, setter = "rp")]
211    pub fn set_rp(this: &PublicKeyCredentialCreationOptionsJson, val: &PublicKeyCredentialRpEntity);
212    #[cfg(web_sys_unstable_apis)]
213    #[doc = "Get the `timeout` field of this object."]
214    #[doc = ""]
215    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
216    #[doc = ""]
217    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
218    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
219    #[wasm_bindgen(method, getter = "timeout")]
220    pub fn get_timeout(this: &PublicKeyCredentialCreationOptionsJson) -> Option<u32>;
221    #[cfg(web_sys_unstable_apis)]
222    #[doc = "Change the `timeout` field of this object."]
223    #[doc = ""]
224    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`*"]
225    #[doc = ""]
226    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
227    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
228    #[wasm_bindgen(method, setter = "timeout")]
229    pub fn set_timeout(this: &PublicKeyCredentialCreationOptionsJson, val: u32);
230    #[cfg(web_sys_unstable_apis)]
231    #[cfg(feature = "PublicKeyCredentialUserEntityJson")]
232    #[doc = "Get the `user` field of this object."]
233    #[doc = ""]
234    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialUserEntityJson`*"]
235    #[doc = ""]
236    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
237    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
238    #[wasm_bindgen(method, getter = "user")]
239    pub fn get_user(
240        this: &PublicKeyCredentialCreationOptionsJson,
241    ) -> PublicKeyCredentialUserEntityJson;
242    #[cfg(web_sys_unstable_apis)]
243    #[cfg(feature = "PublicKeyCredentialUserEntityJson")]
244    #[doc = "Change the `user` field of this object."]
245    #[doc = ""]
246    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialUserEntityJson`*"]
247    #[doc = ""]
248    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
249    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
250    #[wasm_bindgen(method, setter = "user")]
251    pub fn set_user(
252        this: &PublicKeyCredentialCreationOptionsJson,
253        val: &PublicKeyCredentialUserEntityJson,
254    );
255}
256#[cfg(web_sys_unstable_apis)]
257impl PublicKeyCredentialCreationOptionsJson {
258    #[cfg(all(
259        feature = "PublicKeyCredentialRpEntity",
260        feature = "PublicKeyCredentialUserEntityJson",
261    ))]
262    #[doc = "Construct a new `PublicKeyCredentialCreationOptionsJson`."]
263    #[doc = ""]
264    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptionsJson`, `PublicKeyCredentialRpEntity`, `PublicKeyCredentialUserEntityJson`*"]
265    #[doc = ""]
266    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
267    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
268    pub fn new(
269        challenge: &str,
270        pub_key_cred_params: &::wasm_bindgen::JsValue,
271        rp: &PublicKeyCredentialRpEntity,
272        user: &PublicKeyCredentialUserEntityJson,
273    ) -> Self {
274        #[allow(unused_mut)]
275        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
276        ret.set_challenge(challenge);
277        ret.set_pub_key_cred_params(pub_key_cred_params);
278        ret.set_rp(rp);
279        ret.set_user(user);
280        ret
281    }
282    #[cfg(web_sys_unstable_apis)]
283    #[deprecated = "Use `set_attestation()` instead."]
284    pub fn attestation(&mut self, val: &str) -> &mut Self {
285        self.set_attestation(val);
286        self
287    }
288    #[cfg(web_sys_unstable_apis)]
289    #[deprecated = "Use `set_attestation_formats()` instead."]
290    pub fn attestation_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
291        self.set_attestation_formats(val);
292        self
293    }
294    #[cfg(web_sys_unstable_apis)]
295    #[cfg(feature = "AuthenticatorSelectionCriteria")]
296    #[deprecated = "Use `set_authenticator_selection()` instead."]
297    pub fn authenticator_selection(&mut self, val: &AuthenticatorSelectionCriteria) -> &mut Self {
298        self.set_authenticator_selection(val);
299        self
300    }
301    #[cfg(web_sys_unstable_apis)]
302    #[deprecated = "Use `set_challenge()` instead."]
303    pub fn challenge(&mut self, val: &str) -> &mut Self {
304        self.set_challenge(val);
305        self
306    }
307    #[cfg(web_sys_unstable_apis)]
308    #[deprecated = "Use `set_exclude_credentials()` instead."]
309    pub fn exclude_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
310        self.set_exclude_credentials(val);
311        self
312    }
313    #[cfg(web_sys_unstable_apis)]
314    #[cfg(feature = "AuthenticationExtensionsClientInputsJson")]
315    #[deprecated = "Use `set_extensions()` instead."]
316    pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputsJson) -> &mut Self {
317        self.set_extensions(val);
318        self
319    }
320    #[cfg(web_sys_unstable_apis)]
321    #[deprecated = "Use `set_hints()` instead."]
322    pub fn hints(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
323        self.set_hints(val);
324        self
325    }
326    #[cfg(web_sys_unstable_apis)]
327    #[deprecated = "Use `set_pub_key_cred_params()` instead."]
328    pub fn pub_key_cred_params(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
329        self.set_pub_key_cred_params(val);
330        self
331    }
332    #[cfg(web_sys_unstable_apis)]
333    #[cfg(feature = "PublicKeyCredentialRpEntity")]
334    #[deprecated = "Use `set_rp()` instead."]
335    pub fn rp(&mut self, val: &PublicKeyCredentialRpEntity) -> &mut Self {
336        self.set_rp(val);
337        self
338    }
339    #[cfg(web_sys_unstable_apis)]
340    #[deprecated = "Use `set_timeout()` instead."]
341    pub fn timeout(&mut self, val: u32) -> &mut Self {
342        self.set_timeout(val);
343        self
344    }
345    #[cfg(web_sys_unstable_apis)]
346    #[cfg(feature = "PublicKeyCredentialUserEntityJson")]
347    #[deprecated = "Use `set_user()` instead."]
348    pub fn user(&mut self, val: &PublicKeyCredentialUserEntityJson) -> &mut Self {
349        self.set_user(val);
350        self
351    }
352}