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