1 #![allow(unused_imports)]
4 use wasm_bindgen
::prelude
::*;
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PublicKeyCredentialCreationOptions)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `PublicKeyCredentialCreationOptions` dictionary."]
11 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"]
12 pub type PublicKeyCredentialCreationOptions
;
14 impl PublicKeyCredentialCreationOptions
{
16 feature
= "PublicKeyCredentialRpEntity",
17 feature
= "PublicKeyCredentialUserEntity",
19 #[doc = "Construct a new `PublicKeyCredentialCreationOptions`."]
21 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialRpEntity`, `PublicKeyCredentialUserEntity`*"]
23 challenge
: &::js_sys
::Object
,
24 pub_key_cred_params
: &::wasm_bindgen
::JsValue
,
25 rp
: &PublicKeyCredentialRpEntity
,
26 user
: &PublicKeyCredentialUserEntity
,
29 let mut ret
: Self = ::wasm_bindgen
::JsCast
::unchecked_into(::js_sys
::Object
::new());
30 ret
.challenge(challenge
);
31 ret
.pub_key_cred_params(pub_key_cred_params
);
36 #[cfg(feature = "AttestationConveyancePreference")]
37 #[doc = "Change the `attestation` field of this object."]
39 #[doc = "*This API requires the following crate features to be activated: `AttestationConveyancePreference`, `PublicKeyCredentialCreationOptions`*"]
40 pub fn attestation(&mut self, val
: AttestationConveyancePreference
) -> &mut Self {
41 use wasm_bindgen
::JsValue
;
42 let r
= ::js_sys
::Reflect
::set(
44 &JsValue
::from("attestation"),
49 "setting properties should never fail on our dictionary objects"
54 #[cfg(feature = "AuthenticatorSelectionCriteria")]
55 #[doc = "Change the `authenticatorSelection` field of this object."]
57 #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `PublicKeyCredentialCreationOptions`*"]
58 pub fn authenticator_selection(&mut self, val
: &AuthenticatorSelectionCriteria
) -> &mut Self {
59 use wasm_bindgen
::JsValue
;
60 let r
= ::js_sys
::Reflect
::set(
62 &JsValue
::from("authenticatorSelection"),
67 "setting properties should never fail on our dictionary objects"
72 #[doc = "Change the `challenge` field of this object."]
74 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"]
75 pub fn challenge(&mut self, val
: &::js_sys
::Object
) -> &mut Self {
76 use wasm_bindgen
::JsValue
;
77 let r
= ::js_sys
::Reflect
::set(
79 &JsValue
::from("challenge"),
84 "setting properties should never fail on our dictionary objects"
89 #[doc = "Change the `excludeCredentials` field of this object."]
91 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"]
92 pub fn exclude_credentials(&mut self, val
: &::wasm_bindgen
::JsValue
) -> &mut Self {
93 use wasm_bindgen
::JsValue
;
94 let r
= ::js_sys
::Reflect
::set(
96 &JsValue
::from("excludeCredentials"),
101 "setting properties should never fail on our dictionary objects"
106 #[cfg(feature = "AuthenticationExtensionsClientInputs")]
107 #[doc = "Change the `extensions` field of this object."]
109 #[doc = "*This API requires the following crate features to be activated: `AuthenticationExtensionsClientInputs`, `PublicKeyCredentialCreationOptions`*"]
110 pub fn extensions(&mut self, val
: &AuthenticationExtensionsClientInputs
) -> &mut Self {
111 use wasm_bindgen
::JsValue
;
112 let r
= ::js_sys
::Reflect
::set(
114 &JsValue
::from("extensions"),
119 "setting properties should never fail on our dictionary objects"
124 #[doc = "Change the `pubKeyCredParams` field of this object."]
126 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"]
127 pub fn pub_key_cred_params(&mut self, val
: &::wasm_bindgen
::JsValue
) -> &mut Self {
128 use wasm_bindgen
::JsValue
;
129 let r
= ::js_sys
::Reflect
::set(
131 &JsValue
::from("pubKeyCredParams"),
136 "setting properties should never fail on our dictionary objects"
141 #[cfg(feature = "PublicKeyCredentialRpEntity")]
142 #[doc = "Change the `rp` field of this object."]
144 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialRpEntity`*"]
145 pub fn rp(&mut self, val
: &PublicKeyCredentialRpEntity
) -> &mut Self {
146 use wasm_bindgen
::JsValue
;
147 let r
= ::js_sys
::Reflect
::set(self.as_ref(), &JsValue
::from("rp"), &JsValue
::from(val
));
150 "setting properties should never fail on our dictionary objects"
155 #[doc = "Change the `timeout` field of this object."]
157 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`*"]
158 pub fn timeout(&mut self, val
: u32) -> &mut Self {
159 use wasm_bindgen
::JsValue
;
160 let r
= ::js_sys
::Reflect
::set(
162 &JsValue
::from("timeout"),
167 "setting properties should never fail on our dictionary objects"
172 #[cfg(feature = "PublicKeyCredentialUserEntity")]
173 #[doc = "Change the `user` field of this object."]
175 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialUserEntity`*"]
176 pub fn user(&mut self, val
: &PublicKeyCredentialUserEntity
) -> &mut Self {
177 use wasm_bindgen
::JsValue
;
178 let r
= ::js_sys
::Reflect
::set(self.as_ref(), &JsValue
::from("user"), &JsValue
::from(val
));
181 "setting properties should never fail on our dictionary objects"