web_sys/features/
gen_PushSubscriptionInit.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 = PushSubscriptionInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `PushSubscriptionInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
12    pub type PushSubscriptionInit;
13    #[doc = "Get the `appServerKey` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
16    #[wasm_bindgen(method, getter = "appServerKey")]
17    pub fn get_app_server_key(this: &PushSubscriptionInit) -> Option<::js_sys::Object>;
18    #[doc = "Change the `appServerKey` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
21    #[wasm_bindgen(method, setter = "appServerKey")]
22    pub fn set_app_server_key(this: &PushSubscriptionInit, val: Option<&::js_sys::Object>);
23    #[doc = "Get the `authSecret` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
26    #[wasm_bindgen(method, getter = "authSecret")]
27    pub fn get_auth_secret(this: &PushSubscriptionInit) -> Option<::js_sys::ArrayBuffer>;
28    #[doc = "Change the `authSecret` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
31    #[wasm_bindgen(method, setter = "authSecret")]
32    pub fn set_auth_secret(this: &PushSubscriptionInit, val: Option<&::js_sys::ArrayBuffer>);
33    #[doc = "Get the `endpoint` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
36    #[wasm_bindgen(method, getter = "endpoint")]
37    pub fn get_endpoint(this: &PushSubscriptionInit) -> ::alloc::string::String;
38    #[doc = "Change the `endpoint` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
41    #[wasm_bindgen(method, setter = "endpoint")]
42    pub fn set_endpoint(this: &PushSubscriptionInit, val: &str);
43    #[doc = "Get the `p256dhKey` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
46    #[wasm_bindgen(method, getter = "p256dhKey")]
47    pub fn get_p256dh_key(this: &PushSubscriptionInit) -> Option<::js_sys::ArrayBuffer>;
48    #[doc = "Change the `p256dhKey` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
51    #[wasm_bindgen(method, setter = "p256dhKey")]
52    pub fn set_p256dh_key(this: &PushSubscriptionInit, val: Option<&::js_sys::ArrayBuffer>);
53    #[doc = "Get the `scope` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
56    #[wasm_bindgen(method, getter = "scope")]
57    pub fn get_scope(this: &PushSubscriptionInit) -> ::alloc::string::String;
58    #[doc = "Change the `scope` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
61    #[wasm_bindgen(method, setter = "scope")]
62    pub fn set_scope(this: &PushSubscriptionInit, val: &str);
63}
64impl PushSubscriptionInit {
65    #[doc = "Construct a new `PushSubscriptionInit`."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
68    pub fn new(endpoint: &str, scope: &str) -> Self {
69        #[allow(unused_mut)]
70        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
71        ret.set_endpoint(endpoint);
72        ret.set_scope(scope);
73        ret
74    }
75    #[deprecated = "Use `set_app_server_key()` instead."]
76    pub fn app_server_key(&mut self, val: Option<&::js_sys::Object>) -> &mut Self {
77        self.set_app_server_key(val);
78        self
79    }
80    #[deprecated = "Use `set_auth_secret()` instead."]
81    pub fn auth_secret(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self {
82        self.set_auth_secret(val);
83        self
84    }
85    #[deprecated = "Use `set_endpoint()` instead."]
86    pub fn endpoint(&mut self, val: &str) -> &mut Self {
87        self.set_endpoint(val);
88        self
89    }
90    #[deprecated = "Use `set_p256dh_key()` instead."]
91    pub fn p256dh_key(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self {
92        self.set_p256dh_key(val);
93        self
94    }
95    #[deprecated = "Use `set_scope()` instead."]
96    pub fn scope(&mut self, val: &str) -> &mut Self {
97        self.set_scope(val);
98        self
99    }
100}