Skip to main content

web_sys/features/
gen_AuthenticatorSelectionCriteria.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "::js_sys::Object",
9        js_name = "AuthenticatorSelectionCriteria"
10    )]
11    #[derive(Debug, Clone, PartialEq, Eq)]
12    #[doc = "The `AuthenticatorSelectionCriteria` dictionary."]
13    #[doc = ""]
14    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
15    pub type AuthenticatorSelectionCriteria;
16    #[cfg(feature = "AuthenticatorAttachment")]
17    #[doc = "Get the `authenticatorAttachment` field of this object."]
18    #[doc = ""]
19    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttachment`, `AuthenticatorSelectionCriteria`*"]
20    #[wasm_bindgen(method, getter = "authenticatorAttachment")]
21    pub fn get_authenticator_attachment(
22        this: &AuthenticatorSelectionCriteria,
23    ) -> Option<AuthenticatorAttachment>;
24    #[cfg(feature = "AuthenticatorAttachment")]
25    #[doc = "Change the `authenticatorAttachment` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorAttachment`, `AuthenticatorSelectionCriteria`*"]
28    #[wasm_bindgen(method, setter = "authenticatorAttachment")]
29    pub fn set_authenticator_attachment(
30        this: &AuthenticatorSelectionCriteria,
31        val: AuthenticatorAttachment,
32    );
33    #[doc = "Get the `requireResidentKey` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
36    #[wasm_bindgen(method, getter = "requireResidentKey")]
37    pub fn get_require_resident_key(this: &AuthenticatorSelectionCriteria) -> Option<bool>;
38    #[doc = "Change the `requireResidentKey` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
41    #[wasm_bindgen(method, setter = "requireResidentKey")]
42    pub fn set_require_resident_key(this: &AuthenticatorSelectionCriteria, val: bool);
43    #[doc = "Get the `residentKey` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
46    #[wasm_bindgen(method, getter = "residentKey")]
47    pub fn get_resident_key(
48        this: &AuthenticatorSelectionCriteria,
49    ) -> Option<::alloc::string::String>;
50    #[doc = "Change the `residentKey` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
53    #[wasm_bindgen(method, setter = "residentKey")]
54    pub fn set_resident_key(this: &AuthenticatorSelectionCriteria, val: &str);
55    #[cfg(feature = "UserVerificationRequirement")]
56    #[doc = "Get the `userVerification` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `UserVerificationRequirement`*"]
59    #[wasm_bindgen(method, getter = "userVerification")]
60    pub fn get_user_verification(
61        this: &AuthenticatorSelectionCriteria,
62    ) -> Option<UserVerificationRequirement>;
63    #[cfg(feature = "UserVerificationRequirement")]
64    #[doc = "Change the `userVerification` field of this object."]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`, `UserVerificationRequirement`*"]
67    #[wasm_bindgen(method, setter = "userVerification")]
68    pub fn set_user_verification(
69        this: &AuthenticatorSelectionCriteria,
70        val: UserVerificationRequirement,
71    );
72}
73impl AuthenticatorSelectionCriteria {
74    #[doc = "Construct a new `AuthenticatorSelectionCriteria`."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `AuthenticatorSelectionCriteria`*"]
77    pub fn new() -> Self {
78        #[allow(unused_mut)]
79        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
80        ret
81    }
82    #[cfg(feature = "AuthenticatorAttachment")]
83    #[deprecated = "Use `set_authenticator_attachment()` instead."]
84    pub fn authenticator_attachment(&mut self, val: AuthenticatorAttachment) -> &mut Self {
85        self.set_authenticator_attachment(val);
86        self
87    }
88    #[deprecated = "Use `set_require_resident_key()` instead."]
89    pub fn require_resident_key(&mut self, val: bool) -> &mut Self {
90        self.set_require_resident_key(val);
91        self
92    }
93    #[deprecated = "Use `set_resident_key()` instead."]
94    pub fn resident_key(&mut self, val: &str) -> &mut Self {
95        self.set_resident_key(val);
96        self
97    }
98    #[cfg(feature = "UserVerificationRequirement")]
99    #[deprecated = "Use `set_user_verification()` instead."]
100    pub fn user_verification(&mut self, val: UserVerificationRequirement) -> &mut Self {
101        self.set_user_verification(val);
102        self
103    }
104}
105impl Default for AuthenticatorSelectionCriteria {
106    fn default() -> Self {
107        Self::new()
108    }
109}