maxcountryman_web_sys/features/
gen_DecoderDoctorNotification.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DecoderDoctorNotification)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `DecoderDoctorNotification` dictionary."]
9    #[doc = ""]
10    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"]
11    pub type DecoderDoctorNotification;
12}
13impl DecoderDoctorNotification {
14    #[cfg(feature = "DecoderDoctorNotificationType")]
15    #[doc = "Construct a new `DecoderDoctorNotification`."]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`, `DecoderDoctorNotificationType`*"]
18    pub fn new(
19        decoder_doctor_report_id: &str,
20        is_solved: bool,
21        type_: DecoderDoctorNotificationType,
22    ) -> Self {
23        #[allow(unused_mut)]
24        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
25        ret.decoder_doctor_report_id(decoder_doctor_report_id);
26        ret.is_solved(is_solved);
27        ret.type_(type_);
28        ret
29    }
30    #[doc = "Change the `decodeIssue` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"]
33    pub fn decode_issue(&mut self, val: &str) -> &mut Self {
34        use wasm_bindgen::JsValue;
35        let r = ::js_sys::Reflect::set(
36            self.as_ref(),
37            &JsValue::from("decodeIssue"),
38            &JsValue::from(val),
39        );
40        debug_assert!(
41            r.is_ok(),
42            "setting properties should never fail on our dictionary objects"
43        );
44        let _ = r;
45        self
46    }
47    #[doc = "Change the `decoderDoctorReportId` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"]
50    pub fn decoder_doctor_report_id(&mut self, val: &str) -> &mut Self {
51        use wasm_bindgen::JsValue;
52        let r = ::js_sys::Reflect::set(
53            self.as_ref(),
54            &JsValue::from("decoderDoctorReportId"),
55            &JsValue::from(val),
56        );
57        debug_assert!(
58            r.is_ok(),
59            "setting properties should never fail on our dictionary objects"
60        );
61        let _ = r;
62        self
63    }
64    #[doc = "Change the `docURL` field of this object."]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"]
67    pub fn doc_url(&mut self, val: &str) -> &mut Self {
68        use wasm_bindgen::JsValue;
69        let r =
70            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("docURL"), &JsValue::from(val));
71        debug_assert!(
72            r.is_ok(),
73            "setting properties should never fail on our dictionary objects"
74        );
75        let _ = r;
76        self
77    }
78    #[doc = "Change the `formats` field of this object."]
79    #[doc = ""]
80    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"]
81    pub fn formats(&mut self, val: &str) -> &mut Self {
82        use wasm_bindgen::JsValue;
83        let r = ::js_sys::Reflect::set(
84            self.as_ref(),
85            &JsValue::from("formats"),
86            &JsValue::from(val),
87        );
88        debug_assert!(
89            r.is_ok(),
90            "setting properties should never fail on our dictionary objects"
91        );
92        let _ = r;
93        self
94    }
95    #[doc = "Change the `isSolved` field of this object."]
96    #[doc = ""]
97    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"]
98    pub fn is_solved(&mut self, val: bool) -> &mut Self {
99        use wasm_bindgen::JsValue;
100        let r = ::js_sys::Reflect::set(
101            self.as_ref(),
102            &JsValue::from("isSolved"),
103            &JsValue::from(val),
104        );
105        debug_assert!(
106            r.is_ok(),
107            "setting properties should never fail on our dictionary objects"
108        );
109        let _ = r;
110        self
111    }
112    #[doc = "Change the `resourceURL` field of this object."]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`*"]
115    pub fn resource_url(&mut self, val: &str) -> &mut Self {
116        use wasm_bindgen::JsValue;
117        let r = ::js_sys::Reflect::set(
118            self.as_ref(),
119            &JsValue::from("resourceURL"),
120            &JsValue::from(val),
121        );
122        debug_assert!(
123            r.is_ok(),
124            "setting properties should never fail on our dictionary objects"
125        );
126        let _ = r;
127        self
128    }
129    #[cfg(feature = "DecoderDoctorNotificationType")]
130    #[doc = "Change the `type` field of this object."]
131    #[doc = ""]
132    #[doc = "*This API requires the following crate features to be activated: `DecoderDoctorNotification`, `DecoderDoctorNotificationType`*"]
133    pub fn type_(&mut self, val: DecoderDoctorNotificationType) -> &mut Self {
134        use wasm_bindgen::JsValue;
135        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
136        debug_assert!(
137            r.is_ok(),
138            "setting properties should never fail on our dictionary objects"
139        );
140        let _ = r;
141        self
142    }
143}