Skip to main content

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