]> git.proxmox.com Git - rustc.git/blob - vendor/web-sys/src/features/gen_PublicKeyCredentialCreationOptions.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / vendor / web-sys / src / features / gen_PublicKeyCredentialCreationOptions.rs
1 #![allow(unused_imports)]
2 #![allow(clippy::all)]
3 use super::*;
4 use wasm_bindgen::prelude::*;
5 #[wasm_bindgen]
6 extern "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 }
14 impl PublicKeyCredentialCreationOptions {
15 #[cfg(all(
16 feature = "PublicKeyCredentialRpEntity",
17 feature = "PublicKeyCredentialUserEntity",
18 ))]
19 #[doc = "Construct a new `PublicKeyCredentialCreationOptions`."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `PublicKeyCredentialCreationOptions`, `PublicKeyCredentialRpEntity`, `PublicKeyCredentialUserEntity`*"]
22 pub fn new(
23 challenge: &::js_sys::Object,
24 pub_key_cred_params: &::wasm_bindgen::JsValue,
25 rp: &PublicKeyCredentialRpEntity,
26 user: &PublicKeyCredentialUserEntity,
27 ) -> Self {
28 #[allow(unused_mut)]
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);
32 ret.rp(rp);
33 ret.user(user);
34 ret
35 }
36 #[cfg(feature = "AttestationConveyancePreference")]
37 #[doc = "Change the `attestation` field of this object."]
38 #[doc = ""]
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(
43 self.as_ref(),
44 &JsValue::from("attestation"),
45 &JsValue::from(val),
46 );
47 debug_assert!(
48 r.is_ok(),
49 "setting properties should never fail on our dictionary objects"
50 );
51 let _ = r;
52 self
53 }
54 #[cfg(feature = "AuthenticatorSelectionCriteria")]
55 #[doc = "Change the `authenticatorSelection` field of this object."]
56 #[doc = ""]
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(
61 self.as_ref(),
62 &JsValue::from("authenticatorSelection"),
63 &JsValue::from(val),
64 );
65 debug_assert!(
66 r.is_ok(),
67 "setting properties should never fail on our dictionary objects"
68 );
69 let _ = r;
70 self
71 }
72 #[doc = "Change the `challenge` field of this object."]
73 #[doc = ""]
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(
78 self.as_ref(),
79 &JsValue::from("challenge"),
80 &JsValue::from(val),
81 );
82 debug_assert!(
83 r.is_ok(),
84 "setting properties should never fail on our dictionary objects"
85 );
86 let _ = r;
87 self
88 }
89 #[doc = "Change the `excludeCredentials` field of this object."]
90 #[doc = ""]
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(
95 self.as_ref(),
96 &JsValue::from("excludeCredentials"),
97 &JsValue::from(val),
98 );
99 debug_assert!(
100 r.is_ok(),
101 "setting properties should never fail on our dictionary objects"
102 );
103 let _ = r;
104 self
105 }
106 #[cfg(feature = "AuthenticationExtensionsClientInputs")]
107 #[doc = "Change the `extensions` field of this object."]
108 #[doc = ""]
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(
113 self.as_ref(),
114 &JsValue::from("extensions"),
115 &JsValue::from(val),
116 );
117 debug_assert!(
118 r.is_ok(),
119 "setting properties should never fail on our dictionary objects"
120 );
121 let _ = r;
122 self
123 }
124 #[doc = "Change the `pubKeyCredParams` field of this object."]
125 #[doc = ""]
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(
130 self.as_ref(),
131 &JsValue::from("pubKeyCredParams"),
132 &JsValue::from(val),
133 );
134 debug_assert!(
135 r.is_ok(),
136 "setting properties should never fail on our dictionary objects"
137 );
138 let _ = r;
139 self
140 }
141 #[cfg(feature = "PublicKeyCredentialRpEntity")]
142 #[doc = "Change the `rp` field of this object."]
143 #[doc = ""]
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));
148 debug_assert!(
149 r.is_ok(),
150 "setting properties should never fail on our dictionary objects"
151 );
152 let _ = r;
153 self
154 }
155 #[doc = "Change the `timeout` field of this object."]
156 #[doc = ""]
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(
161 self.as_ref(),
162 &JsValue::from("timeout"),
163 &JsValue::from(val),
164 );
165 debug_assert!(
166 r.is_ok(),
167 "setting properties should never fail on our dictionary objects"
168 );
169 let _ = r;
170 self
171 }
172 #[cfg(feature = "PublicKeyCredentialUserEntity")]
173 #[doc = "Change the `user` field of this object."]
174 #[doc = ""]
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));
179 debug_assert!(
180 r.is_ok(),
181 "setting properties should never fail on our dictionary objects"
182 );
183 let _ = r;
184 self
185 }
186 }