web_sys/features/
gen_PublicKeyCredentialCreationOptions.rs

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