Skip to main content

web_sys/features/
gen_PublicKeyCredentialRequestOptions.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 = 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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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<::js_sys::JsString>>;
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
66    #[wasm_bindgen(method, setter = "attestationFormats")]
67    pub fn set_attestation_formats(
68        this: &PublicKeyCredentialRequestOptions,
69        val: &[::js_sys::JsString],
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    #[doc = "Change the `challenge` field of this object."]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
84    #[wasm_bindgen(method, setter = "challenge")]
85    pub fn set_challenge_buffer_source(
86        this: &PublicKeyCredentialRequestOptions,
87        val: &::js_sys::Object,
88    );
89    #[doc = "Change the `challenge` field of this object."]
90    #[doc = ""]
91    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
92    #[wasm_bindgen(method, setter = "challenge")]
93    pub fn set_challenge_u8_slice(this: &PublicKeyCredentialRequestOptions, val: &mut [u8]);
94    #[doc = "Change the `challenge` field of this object."]
95    #[doc = ""]
96    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
97    #[wasm_bindgen(method, setter = "challenge")]
98    pub fn set_challenge_u8_array(
99        this: &PublicKeyCredentialRequestOptions,
100        val: &::js_sys::Uint8Array,
101    );
102    #[cfg(feature = "AuthenticationExtensionsClientInputs")]
103    #[doc = "Get the `extensions` field of this object."]
104    #[doc = ""]
105    #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"]
106    #[wasm_bindgen(method, getter = "extensions")]
107    pub fn get_extensions(
108        this: &PublicKeyCredentialRequestOptions,
109    ) -> Option<AuthenticationExtensionsClientInputs>;
110    #[cfg(feature = "AuthenticationExtensionsClientInputs")]
111    #[doc = "Change the `extensions` field of this object."]
112    #[doc = ""]
113    #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialRequestOptions`*"]
114    #[wasm_bindgen(method, setter = "extensions")]
115    pub fn set_extensions(
116        this: &PublicKeyCredentialRequestOptions,
117        val: &AuthenticationExtensionsClientInputs,
118    );
119    #[cfg(web_sys_unstable_apis)]
120    #[doc = "Get the `hints` field of this object."]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
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, getter = "hints")]
127    pub fn get_hints(
128        this: &PublicKeyCredentialRequestOptions,
129    ) -> Option<::js_sys::Array<::js_sys::JsString>>;
130    #[cfg(web_sys_unstable_apis)]
131    #[doc = "Change the `hints` field of this object."]
132    #[doc = ""]
133    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
134    #[doc = ""]
135    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
136    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
137    #[wasm_bindgen(method, setter = "hints")]
138    pub fn set_hints(this: &PublicKeyCredentialRequestOptions, val: &[::js_sys::JsString]);
139    #[doc = "Get the `rpId` field of this object."]
140    #[doc = ""]
141    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
142    #[wasm_bindgen(method, getter = "rpId")]
143    pub fn get_rp_id(this: &PublicKeyCredentialRequestOptions) -> Option<::alloc::string::String>;
144    #[doc = "Change the `rpId` field of this object."]
145    #[doc = ""]
146    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
147    #[wasm_bindgen(method, setter = "rpId")]
148    pub fn set_rp_id(this: &PublicKeyCredentialRequestOptions, val: &str);
149    #[doc = "Get the `timeout` field of this object."]
150    #[doc = ""]
151    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
152    #[wasm_bindgen(method, getter = "timeout")]
153    pub fn get_timeout(this: &PublicKeyCredentialRequestOptions) -> Option<u32>;
154    #[doc = "Change the `timeout` field of this object."]
155    #[doc = ""]
156    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
157    #[wasm_bindgen(method, setter = "timeout")]
158    pub fn set_timeout(this: &PublicKeyCredentialRequestOptions, val: u32);
159    #[cfg(feature = "UserVerificationRequirement")]
160    #[doc = "Get the `userVerification` field of this object."]
161    #[doc = ""]
162    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"]
163    #[wasm_bindgen(method, getter = "userVerification")]
164    pub fn get_user_verification(
165        this: &PublicKeyCredentialRequestOptions,
166    ) -> Option<UserVerificationRequirement>;
167    #[cfg(feature = "UserVerificationRequirement")]
168    #[doc = "Change the `userVerification` field of this object."]
169    #[doc = ""]
170    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`, `UserVerificationRequirement`*"]
171    #[wasm_bindgen(method, setter = "userVerification")]
172    pub fn set_user_verification(
173        this: &PublicKeyCredentialRequestOptions,
174        val: UserVerificationRequirement,
175    );
176}
177impl PublicKeyCredentialRequestOptions {
178    #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."]
179    #[doc = ""]
180    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
181    pub fn new(challenge: &::js_sys::Object) -> Self {
182        #[allow(unused_mut)]
183        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
184        ret.set_challenge(challenge);
185        ret
186    }
187    #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."]
188    #[doc = ""]
189    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
190    pub fn new_with_u8_slice(challenge: &mut [u8]) -> Self {
191        #[allow(unused_mut)]
192        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
193        ret.set_challenge_u8_slice(challenge);
194        ret
195    }
196    #[doc = "Construct a new `PublicKeyCredentialRequestOptions`."]
197    #[doc = ""]
198    #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialRequestOptions`*"]
199    pub fn new_with_u8_array(challenge: &::js_sys::Uint8Array) -> Self {
200        #[allow(unused_mut)]
201        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
202        ret.set_challenge_u8_array(challenge);
203        ret
204    }
205    #[deprecated = "Use `set_allow_credentials()` instead."]
206    pub fn allow_credentials(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
207        self.set_allow_credentials(val);
208        self
209    }
210    #[cfg(web_sys_unstable_apis)]
211    #[deprecated = "Use `set_attestation()` instead."]
212    pub fn attestation(&mut self, val: &str) -> &mut Self {
213        self.set_attestation(val);
214        self
215    }
216    #[cfg(web_sys_unstable_apis)]
217    #[deprecated = "Use `set_attestation_formats()` instead."]
218    pub fn attestation_formats(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
219        self.set_attestation_formats(val);
220        self
221    }
222    #[deprecated = "Use `set_challenge()` instead."]
223    pub fn challenge(&mut self, val: &::js_sys::Object) -> &mut Self {
224        self.set_challenge(val);
225        self
226    }
227    #[cfg(feature = "AuthenticationExtensionsClientInputs")]
228    #[deprecated = "Use `set_extensions()` instead."]
229    pub fn extensions(&mut self, val: &AuthenticationExtensionsClientInputs) -> &mut Self {
230        self.set_extensions(val);
231        self
232    }
233    #[cfg(web_sys_unstable_apis)]
234    #[deprecated = "Use `set_hints()` instead."]
235    pub fn hints(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
236        self.set_hints(val);
237        self
238    }
239    #[deprecated = "Use `set_rp_id()` instead."]
240    pub fn rp_id(&mut self, val: &str) -> &mut Self {
241        self.set_rp_id(val);
242        self
243    }
244    #[deprecated = "Use `set_timeout()` instead."]
245    pub fn timeout(&mut self, val: u32) -> &mut Self {
246        self.set_timeout(val);
247        self
248    }
249    #[cfg(feature = "UserVerificationRequirement")]
250    #[deprecated = "Use `set_user_verification()` instead."]
251    pub fn user_verification(&mut self, val: UserVerificationRequirement) -> &mut Self {
252        self.set_user_verification(val);
253        self
254    }
255}