web_sys/features/
gen_PushSubscriptionOptionsInit.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 = PushSubscriptionOptionsInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `PushSubscriptionOptionsInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"]
12    pub type PushSubscriptionOptionsInit;
13    #[doc = "Get the `applicationServerKey` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"]
16    #[wasm_bindgen(method, getter = "applicationServerKey")]
17    pub fn get_application_server_key(
18        this: &PushSubscriptionOptionsInit,
19    ) -> ::wasm_bindgen::JsValue;
20    #[doc = "Change the `applicationServerKey` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"]
23    #[wasm_bindgen(method, setter = "applicationServerKey")]
24    pub fn set_application_server_key(
25        this: &PushSubscriptionOptionsInit,
26        val: &::wasm_bindgen::JsValue,
27    );
28    #[doc = "Get the `userVisibleOnly` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"]
31    #[wasm_bindgen(method, getter = "userVisibleOnly")]
32    pub fn get_user_visible_only(this: &PushSubscriptionOptionsInit) -> Option<bool>;
33    #[doc = "Change the `userVisibleOnly` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"]
36    #[wasm_bindgen(method, setter = "userVisibleOnly")]
37    pub fn set_user_visible_only(this: &PushSubscriptionOptionsInit, val: bool);
38}
39impl PushSubscriptionOptionsInit {
40    #[doc = "Construct a new `PushSubscriptionOptionsInit`."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"]
43    pub fn new() -> Self {
44        #[allow(unused_mut)]
45        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
46        ret
47    }
48    #[deprecated = "Use `set_application_server_key()` instead."]
49    pub fn application_server_key(&mut self, val: Option<&::wasm_bindgen::JsValue>) -> &mut Self {
50        self.set_application_server_key(val.unwrap_or(&::wasm_bindgen::JsValue::NULL));
51        self
52    }
53    #[deprecated = "Use `set_user_visible_only()` instead."]
54    pub fn user_visible_only(&mut self, val: bool) -> &mut Self {
55        self.set_user_visible_only(val);
56        self
57    }
58}
59impl Default for PushSubscriptionOptionsInit {
60    fn default() -> Self {
61        Self::new()
62    }
63}