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