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