web_sys/features/
gen_SecurityPolicyViolationEventInit.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 = SecurityPolicyViolationEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `SecurityPolicyViolationEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
12    pub type SecurityPolicyViolationEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &SecurityPolicyViolationEventInit) -> Option<bool>;
18    #[doc = "Change the `bubbles` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &SecurityPolicyViolationEventInit, val: bool);
23    #[doc = "Get the `cancelable` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &SecurityPolicyViolationEventInit) -> Option<bool>;
28    #[doc = "Change the `cancelable` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &SecurityPolicyViolationEventInit, val: bool);
33    #[doc = "Get the `composed` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &SecurityPolicyViolationEventInit) -> Option<bool>;
38    #[doc = "Change the `composed` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &SecurityPolicyViolationEventInit, val: bool);
43    #[doc = "Get the `blockedURI` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
46    #[wasm_bindgen(method, getter = "blockedURI")]
47    pub fn get_blocked_uri(
48        this: &SecurityPolicyViolationEventInit,
49    ) -> Option<::alloc::string::String>;
50    #[doc = "Change the `blockedURI` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
53    #[wasm_bindgen(method, setter = "blockedURI")]
54    pub fn set_blocked_uri(this: &SecurityPolicyViolationEventInit, val: &str);
55    #[doc = "Get the `columnNumber` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
58    #[wasm_bindgen(method, getter = "columnNumber")]
59    pub fn get_column_number(this: &SecurityPolicyViolationEventInit) -> Option<i32>;
60    #[doc = "Change the `columnNumber` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
63    #[wasm_bindgen(method, setter = "columnNumber")]
64    pub fn set_column_number(this: &SecurityPolicyViolationEventInit, val: i32);
65    #[cfg(feature = "SecurityPolicyViolationEventDisposition")]
66    #[doc = "Get the `disposition` field of this object."]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventDisposition`, `SecurityPolicyViolationEventInit`*"]
69    #[wasm_bindgen(method, getter = "disposition")]
70    pub fn get_disposition(
71        this: &SecurityPolicyViolationEventInit,
72    ) -> Option<SecurityPolicyViolationEventDisposition>;
73    #[cfg(feature = "SecurityPolicyViolationEventDisposition")]
74    #[doc = "Change the `disposition` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventDisposition`, `SecurityPolicyViolationEventInit`*"]
77    #[wasm_bindgen(method, setter = "disposition")]
78    pub fn set_disposition(
79        this: &SecurityPolicyViolationEventInit,
80        val: SecurityPolicyViolationEventDisposition,
81    );
82    #[doc = "Get the `documentURI` field of this object."]
83    #[doc = ""]
84    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
85    #[wasm_bindgen(method, getter = "documentURI")]
86    pub fn get_document_uri(
87        this: &SecurityPolicyViolationEventInit,
88    ) -> Option<::alloc::string::String>;
89    #[doc = "Change the `documentURI` field of this object."]
90    #[doc = ""]
91    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
92    #[wasm_bindgen(method, setter = "documentURI")]
93    pub fn set_document_uri(this: &SecurityPolicyViolationEventInit, val: &str);
94    #[doc = "Get the `effectiveDirective` field of this object."]
95    #[doc = ""]
96    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
97    #[wasm_bindgen(method, getter = "effectiveDirective")]
98    pub fn get_effective_directive(
99        this: &SecurityPolicyViolationEventInit,
100    ) -> Option<::alloc::string::String>;
101    #[doc = "Change the `effectiveDirective` field of this object."]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
104    #[wasm_bindgen(method, setter = "effectiveDirective")]
105    pub fn set_effective_directive(this: &SecurityPolicyViolationEventInit, val: &str);
106    #[doc = "Get the `lineNumber` field of this object."]
107    #[doc = ""]
108    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
109    #[wasm_bindgen(method, getter = "lineNumber")]
110    pub fn get_line_number(this: &SecurityPolicyViolationEventInit) -> Option<i32>;
111    #[doc = "Change the `lineNumber` field of this object."]
112    #[doc = ""]
113    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
114    #[wasm_bindgen(method, setter = "lineNumber")]
115    pub fn set_line_number(this: &SecurityPolicyViolationEventInit, val: i32);
116    #[doc = "Get the `originalPolicy` field of this object."]
117    #[doc = ""]
118    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
119    #[wasm_bindgen(method, getter = "originalPolicy")]
120    pub fn get_original_policy(
121        this: &SecurityPolicyViolationEventInit,
122    ) -> Option<::alloc::string::String>;
123    #[doc = "Change the `originalPolicy` field of this object."]
124    #[doc = ""]
125    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
126    #[wasm_bindgen(method, setter = "originalPolicy")]
127    pub fn set_original_policy(this: &SecurityPolicyViolationEventInit, val: &str);
128    #[doc = "Get the `referrer` field of this object."]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
131    #[wasm_bindgen(method, getter = "referrer")]
132    pub fn get_referrer(this: &SecurityPolicyViolationEventInit)
133        -> Option<::alloc::string::String>;
134    #[doc = "Change the `referrer` field of this object."]
135    #[doc = ""]
136    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
137    #[wasm_bindgen(method, setter = "referrer")]
138    pub fn set_referrer(this: &SecurityPolicyViolationEventInit, val: &str);
139    #[doc = "Get the `sample` field of this object."]
140    #[doc = ""]
141    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
142    #[wasm_bindgen(method, getter = "sample")]
143    pub fn get_sample(this: &SecurityPolicyViolationEventInit) -> Option<::alloc::string::String>;
144    #[doc = "Change the `sample` field of this object."]
145    #[doc = ""]
146    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
147    #[wasm_bindgen(method, setter = "sample")]
148    pub fn set_sample(this: &SecurityPolicyViolationEventInit, val: &str);
149    #[doc = "Get the `sourceFile` field of this object."]
150    #[doc = ""]
151    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
152    #[wasm_bindgen(method, getter = "sourceFile")]
153    pub fn get_source_file(
154        this: &SecurityPolicyViolationEventInit,
155    ) -> Option<::alloc::string::String>;
156    #[doc = "Change the `sourceFile` field of this object."]
157    #[doc = ""]
158    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
159    #[wasm_bindgen(method, setter = "sourceFile")]
160    pub fn set_source_file(this: &SecurityPolicyViolationEventInit, val: &str);
161    #[doc = "Get the `statusCode` field of this object."]
162    #[doc = ""]
163    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
164    #[wasm_bindgen(method, getter = "statusCode")]
165    pub fn get_status_code(this: &SecurityPolicyViolationEventInit) -> Option<u16>;
166    #[doc = "Change the `statusCode` field of this object."]
167    #[doc = ""]
168    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
169    #[wasm_bindgen(method, setter = "statusCode")]
170    pub fn set_status_code(this: &SecurityPolicyViolationEventInit, val: u16);
171    #[doc = "Get the `violatedDirective` field of this object."]
172    #[doc = ""]
173    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
174    #[wasm_bindgen(method, getter = "violatedDirective")]
175    pub fn get_violated_directive(
176        this: &SecurityPolicyViolationEventInit,
177    ) -> Option<::alloc::string::String>;
178    #[doc = "Change the `violatedDirective` field of this object."]
179    #[doc = ""]
180    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
181    #[wasm_bindgen(method, setter = "violatedDirective")]
182    pub fn set_violated_directive(this: &SecurityPolicyViolationEventInit, val: &str);
183}
184impl SecurityPolicyViolationEventInit {
185    #[doc = "Construct a new `SecurityPolicyViolationEventInit`."]
186    #[doc = ""]
187    #[doc = "*This API requires the following crate features to be activated: `SecurityPolicyViolationEventInit`*"]
188    pub fn new() -> Self {
189        #[allow(unused_mut)]
190        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
191        ret
192    }
193    #[deprecated = "Use `set_bubbles()` instead."]
194    pub fn bubbles(&mut self, val: bool) -> &mut Self {
195        self.set_bubbles(val);
196        self
197    }
198    #[deprecated = "Use `set_cancelable()` instead."]
199    pub fn cancelable(&mut self, val: bool) -> &mut Self {
200        self.set_cancelable(val);
201        self
202    }
203    #[deprecated = "Use `set_composed()` instead."]
204    pub fn composed(&mut self, val: bool) -> &mut Self {
205        self.set_composed(val);
206        self
207    }
208    #[deprecated = "Use `set_blocked_uri()` instead."]
209    pub fn blocked_uri(&mut self, val: &str) -> &mut Self {
210        self.set_blocked_uri(val);
211        self
212    }
213    #[deprecated = "Use `set_column_number()` instead."]
214    pub fn column_number(&mut self, val: i32) -> &mut Self {
215        self.set_column_number(val);
216        self
217    }
218    #[cfg(feature = "SecurityPolicyViolationEventDisposition")]
219    #[deprecated = "Use `set_disposition()` instead."]
220    pub fn disposition(&mut self, val: SecurityPolicyViolationEventDisposition) -> &mut Self {
221        self.set_disposition(val);
222        self
223    }
224    #[deprecated = "Use `set_document_uri()` instead."]
225    pub fn document_uri(&mut self, val: &str) -> &mut Self {
226        self.set_document_uri(val);
227        self
228    }
229    #[deprecated = "Use `set_effective_directive()` instead."]
230    pub fn effective_directive(&mut self, val: &str) -> &mut Self {
231        self.set_effective_directive(val);
232        self
233    }
234    #[deprecated = "Use `set_line_number()` instead."]
235    pub fn line_number(&mut self, val: i32) -> &mut Self {
236        self.set_line_number(val);
237        self
238    }
239    #[deprecated = "Use `set_original_policy()` instead."]
240    pub fn original_policy(&mut self, val: &str) -> &mut Self {
241        self.set_original_policy(val);
242        self
243    }
244    #[deprecated = "Use `set_referrer()` instead."]
245    pub fn referrer(&mut self, val: &str) -> &mut Self {
246        self.set_referrer(val);
247        self
248    }
249    #[deprecated = "Use `set_sample()` instead."]
250    pub fn sample(&mut self, val: &str) -> &mut Self {
251        self.set_sample(val);
252        self
253    }
254    #[deprecated = "Use `set_source_file()` instead."]
255    pub fn source_file(&mut self, val: &str) -> &mut Self {
256        self.set_source_file(val);
257        self
258    }
259    #[deprecated = "Use `set_status_code()` instead."]
260    pub fn status_code(&mut self, val: u16) -> &mut Self {
261        self.set_status_code(val);
262        self
263    }
264    #[deprecated = "Use `set_violated_directive()` instead."]
265    pub fn violated_directive(&mut self, val: &str) -> &mut Self {
266        self.set_violated_directive(val);
267        self
268    }
269}
270impl Default for SecurityPolicyViolationEventInit {
271    fn default() -> Self {
272        Self::new()
273    }
274}