web_sys/features/
gen_BasicCardResponse.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 = BasicCardResponse)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `BasicCardResponse` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
12    pub type BasicCardResponse;
13    #[cfg(feature = "PaymentAddress")]
14    #[doc = "Get the `billingAddress` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`, `PaymentAddress`*"]
17    #[wasm_bindgen(method, getter = "billingAddress")]
18    pub fn get_billing_address(this: &BasicCardResponse) -> Option<PaymentAddress>;
19    #[cfg(feature = "PaymentAddress")]
20    #[doc = "Change the `billingAddress` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`, `PaymentAddress`*"]
23    #[wasm_bindgen(method, setter = "billingAddress")]
24    pub fn set_billing_address(this: &BasicCardResponse, val: Option<&PaymentAddress>);
25    #[doc = "Get the `cardNumber` field of this object."]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
28    #[wasm_bindgen(method, getter = "cardNumber")]
29    pub fn get_card_number(this: &BasicCardResponse) -> ::alloc::string::String;
30    #[doc = "Change the `cardNumber` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
33    #[wasm_bindgen(method, setter = "cardNumber")]
34    pub fn set_card_number(this: &BasicCardResponse, val: &str);
35    #[doc = "Get the `cardSecurityCode` field of this object."]
36    #[doc = ""]
37    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
38    #[wasm_bindgen(method, getter = "cardSecurityCode")]
39    pub fn get_card_security_code(this: &BasicCardResponse) -> Option<::alloc::string::String>;
40    #[doc = "Change the `cardSecurityCode` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
43    #[wasm_bindgen(method, setter = "cardSecurityCode")]
44    pub fn set_card_security_code(this: &BasicCardResponse, val: &str);
45    #[doc = "Get the `cardholderName` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
48    #[wasm_bindgen(method, getter = "cardholderName")]
49    pub fn get_cardholder_name(this: &BasicCardResponse) -> Option<::alloc::string::String>;
50    #[doc = "Change the `cardholderName` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
53    #[wasm_bindgen(method, setter = "cardholderName")]
54    pub fn set_cardholder_name(this: &BasicCardResponse, val: &str);
55    #[doc = "Get the `expiryMonth` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
58    #[wasm_bindgen(method, getter = "expiryMonth")]
59    pub fn get_expiry_month(this: &BasicCardResponse) -> Option<::alloc::string::String>;
60    #[doc = "Change the `expiryMonth` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
63    #[wasm_bindgen(method, setter = "expiryMonth")]
64    pub fn set_expiry_month(this: &BasicCardResponse, val: &str);
65    #[doc = "Get the `expiryYear` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
68    #[wasm_bindgen(method, getter = "expiryYear")]
69    pub fn get_expiry_year(this: &BasicCardResponse) -> Option<::alloc::string::String>;
70    #[doc = "Change the `expiryYear` field of this object."]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
73    #[wasm_bindgen(method, setter = "expiryYear")]
74    pub fn set_expiry_year(this: &BasicCardResponse, val: &str);
75}
76impl BasicCardResponse {
77    #[doc = "Construct a new `BasicCardResponse`."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `BasicCardResponse`*"]
80    pub fn new(card_number: &str) -> Self {
81        #[allow(unused_mut)]
82        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
83        ret.set_card_number(card_number);
84        ret
85    }
86    #[cfg(feature = "PaymentAddress")]
87    #[deprecated = "Use `set_billing_address()` instead."]
88    pub fn billing_address(&mut self, val: Option<&PaymentAddress>) -> &mut Self {
89        self.set_billing_address(val);
90        self
91    }
92    #[deprecated = "Use `set_card_number()` instead."]
93    pub fn card_number(&mut self, val: &str) -> &mut Self {
94        self.set_card_number(val);
95        self
96    }
97    #[deprecated = "Use `set_card_security_code()` instead."]
98    pub fn card_security_code(&mut self, val: &str) -> &mut Self {
99        self.set_card_security_code(val);
100        self
101    }
102    #[deprecated = "Use `set_cardholder_name()` instead."]
103    pub fn cardholder_name(&mut self, val: &str) -> &mut Self {
104        self.set_cardholder_name(val);
105        self
106    }
107    #[deprecated = "Use `set_expiry_month()` instead."]
108    pub fn expiry_month(&mut self, val: &str) -> &mut Self {
109        self.set_expiry_month(val);
110        self
111    }
112    #[deprecated = "Use `set_expiry_year()` instead."]
113    pub fn expiry_year(&mut self, val: &str) -> &mut Self {
114        self.set_expiry_year(val);
115        self
116    }
117}