Skip to main content

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 = "Change the `appServerKey` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
26    #[wasm_bindgen(method, setter = "appServerKey")]
27    pub fn set_app_server_key_opt_buffer_source(
28        this: &PushSubscriptionInit,
29        val: Option<&::js_sys::Object>,
30    );
31    #[doc = "Change the `appServerKey` field of this object."]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
34    #[wasm_bindgen(method, setter = "appServerKey")]
35    pub fn set_app_server_key_opt_u8_slice(this: &PushSubscriptionInit, val: Option<&mut [u8]>);
36    #[doc = "Change the `appServerKey` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
39    #[wasm_bindgen(method, setter = "appServerKey")]
40    pub fn set_app_server_key_opt_u8_array(
41        this: &PushSubscriptionInit,
42        val: Option<&::js_sys::Uint8Array>,
43    );
44    #[doc = "Get the `authSecret` field of this object."]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
47    #[wasm_bindgen(method, getter = "authSecret")]
48    pub fn get_auth_secret(this: &PushSubscriptionInit) -> Option<::js_sys::ArrayBuffer>;
49    #[doc = "Change the `authSecret` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
52    #[wasm_bindgen(method, setter = "authSecret")]
53    pub fn set_auth_secret(this: &PushSubscriptionInit, val: Option<&::js_sys::ArrayBuffer>);
54    #[doc = "Get the `endpoint` field of this object."]
55    #[doc = ""]
56    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
57    #[wasm_bindgen(method, getter = "endpoint")]
58    pub fn get_endpoint(this: &PushSubscriptionInit) -> ::alloc::string::String;
59    #[doc = "Change the `endpoint` field of this object."]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
62    #[wasm_bindgen(method, setter = "endpoint")]
63    pub fn set_endpoint(this: &PushSubscriptionInit, val: &str);
64    #[doc = "Get the `p256dhKey` field of this object."]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
67    #[wasm_bindgen(method, getter = "p256dhKey")]
68    pub fn get_p256dh_key(this: &PushSubscriptionInit) -> Option<::js_sys::ArrayBuffer>;
69    #[doc = "Change the `p256dhKey` field of this object."]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
72    #[wasm_bindgen(method, setter = "p256dhKey")]
73    pub fn set_p256dh_key(this: &PushSubscriptionInit, val: Option<&::js_sys::ArrayBuffer>);
74    #[doc = "Get the `scope` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
77    #[wasm_bindgen(method, getter = "scope")]
78    pub fn get_scope(this: &PushSubscriptionInit) -> ::alloc::string::String;
79    #[doc = "Change the `scope` field of this object."]
80    #[doc = ""]
81    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
82    #[wasm_bindgen(method, setter = "scope")]
83    pub fn set_scope(this: &PushSubscriptionInit, val: &str);
84}
85impl PushSubscriptionInit {
86    #[doc = "Construct a new `PushSubscriptionInit`."]
87    #[doc = ""]
88    #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionInit`*"]
89    pub fn new(endpoint: &str, scope: &str) -> Self {
90        #[allow(unused_mut)]
91        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
92        ret.set_endpoint(endpoint);
93        ret.set_scope(scope);
94        ret
95    }
96    #[deprecated = "Use `set_app_server_key()` instead."]
97    pub fn app_server_key(&mut self, val: Option<&::js_sys::Object>) -> &mut Self {
98        self.set_app_server_key(val);
99        self
100    }
101    #[deprecated = "Use `set_auth_secret()` instead."]
102    pub fn auth_secret(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self {
103        self.set_auth_secret(val);
104        self
105    }
106    #[deprecated = "Use `set_endpoint()` instead."]
107    pub fn endpoint(&mut self, val: &str) -> &mut Self {
108        self.set_endpoint(val);
109        self
110    }
111    #[deprecated = "Use `set_p256dh_key()` instead."]
112    pub fn p256dh_key(&mut self, val: Option<&::js_sys::ArrayBuffer>) -> &mut Self {
113        self.set_p256dh_key(val);
114        self
115    }
116    #[deprecated = "Use `set_scope()` instead."]
117    pub fn scope(&mut self, val: &str) -> &mut Self {
118        self.set_scope(val);
119        self
120    }
121}