maxcountryman_web_sys/features/
gen_PaymentMethodChangeEventInit.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 = PaymentMethodChangeEventInit)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `PaymentMethodChangeEventInit` dictionary."]
9    #[doc = ""]
10    #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"]
11    pub type PaymentMethodChangeEventInit;
12}
13impl PaymentMethodChangeEventInit {
14    #[doc = "Construct a new `PaymentMethodChangeEventInit`."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"]
17    pub fn new(method_name: &str) -> Self {
18        #[allow(unused_mut)]
19        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20        ret.method_name(method_name);
21        ret
22    }
23    #[doc = "Change the `bubbles` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"]
26    pub fn bubbles(&mut self, val: bool) -> &mut Self {
27        use wasm_bindgen::JsValue;
28        let r = ::js_sys::Reflect::set(
29            self.as_ref(),
30            &JsValue::from("bubbles"),
31            &JsValue::from(val),
32        );
33        debug_assert!(
34            r.is_ok(),
35            "setting properties should never fail on our dictionary objects"
36        );
37        let _ = r;
38        self
39    }
40    #[doc = "Change the `cancelable` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"]
43    pub fn cancelable(&mut self, val: bool) -> &mut Self {
44        use wasm_bindgen::JsValue;
45        let r = ::js_sys::Reflect::set(
46            self.as_ref(),
47            &JsValue::from("cancelable"),
48            &JsValue::from(val),
49        );
50        debug_assert!(
51            r.is_ok(),
52            "setting properties should never fail on our dictionary objects"
53        );
54        let _ = r;
55        self
56    }
57    #[doc = "Change the `composed` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"]
60    pub fn composed(&mut self, val: bool) -> &mut Self {
61        use wasm_bindgen::JsValue;
62        let r = ::js_sys::Reflect::set(
63            self.as_ref(),
64            &JsValue::from("composed"),
65            &JsValue::from(val),
66        );
67        debug_assert!(
68            r.is_ok(),
69            "setting properties should never fail on our dictionary objects"
70        );
71        let _ = r;
72        self
73    }
74    #[doc = "Change the `methodDetails` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"]
77    pub fn method_details(&mut self, val: Option<&::js_sys::Object>) -> &mut Self {
78        use wasm_bindgen::JsValue;
79        let r = ::js_sys::Reflect::set(
80            self.as_ref(),
81            &JsValue::from("methodDetails"),
82            &JsValue::from(val),
83        );
84        debug_assert!(
85            r.is_ok(),
86            "setting properties should never fail on our dictionary objects"
87        );
88        let _ = r;
89        self
90    }
91    #[doc = "Change the `methodName` field of this object."]
92    #[doc = ""]
93    #[doc = "*This API requires the following crate features to be activated: `PaymentMethodChangeEventInit`*"]
94    pub fn method_name(&mut self, val: &str) -> &mut Self {
95        use wasm_bindgen::JsValue;
96        let r = ::js_sys::Reflect::set(
97            self.as_ref(),
98            &JsValue::from("methodName"),
99            &JsValue::from(val),
100        );
101        debug_assert!(
102            r.is_ok(),
103            "setting properties should never fail on our dictionary objects"
104        );
105        let _ = r;
106        self
107    }
108}