stripe/resources/generated/
invoice_payment_method_options_customer_balance.rs

1// ======================================
2// This file was automatically generated.
3// ======================================
4
5use serde::{Deserialize, Serialize};
6
7/// The resource representing a Stripe "invoice_payment_method_options_customer_balance".
8#[derive(Clone, Debug, Default, Deserialize, Serialize)]
9pub struct InvoicePaymentMethodOptionsCustomerBalance {
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub bank_transfer: Option<InvoicePaymentMethodOptionsCustomerBalanceBankTransfer>,
12
13    /// The funding method type to be used when there are not enough funds in the customer balance.
14    ///
15    /// Permitted values include: `bank_transfer`.
16    pub funding_type: Option<InvoicePaymentMethodOptionsCustomerBalanceFundingType>,
17}
18
19#[derive(Clone, Debug, Default, Deserialize, Serialize)]
20pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransfer {
21    #[serde(skip_serializing_if = "Option::is_none")]
22    pub eu_bank_transfer:
23        Option<InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,
24
25    /// The bank transfer type that can be used for funding.
26    ///
27    /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
28    #[serde(rename = "type")]
29    pub type_: Option<String>,
30}
31
32#[derive(Clone, Debug, Default, Deserialize, Serialize)]
33pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
34    /// The desired country code of the bank account information.
35    ///
36    /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
37    pub country: InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry,
38}
39
40/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer`'s `country` field.
41#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
42#[serde(rename_all = "snake_case")]
43pub enum InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry {
44    #[serde(rename = "BE")]
45    Be,
46    #[serde(rename = "DE")]
47    De,
48    #[serde(rename = "ES")]
49    Es,
50    #[serde(rename = "FR")]
51    Fr,
52    #[serde(rename = "IE")]
53    Ie,
54    #[serde(rename = "NL")]
55    Nl,
56}
57
58impl InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry {
59    pub fn as_str(self) -> &'static str {
60        match self {
61            InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Be => "BE",
62            InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::De => "DE",
63            InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Es => "ES",
64            InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Fr => "FR",
65            InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Ie => "IE",
66            InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Nl => "NL",
67        }
68    }
69}
70
71impl AsRef<str> for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry {
72    fn as_ref(&self) -> &str {
73        self.as_str()
74    }
75}
76
77impl std::fmt::Display
78    for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry
79{
80    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
81        self.as_str().fmt(f)
82    }
83}
84impl std::default::Default
85    for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry
86{
87    fn default() -> Self {
88        Self::Be
89    }
90}
91
92/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCustomerBalance`'s `funding_type` field.
93#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
94#[serde(rename_all = "snake_case")]
95pub enum InvoicePaymentMethodOptionsCustomerBalanceFundingType {
96    BankTransfer,
97}
98
99impl InvoicePaymentMethodOptionsCustomerBalanceFundingType {
100    pub fn as_str(self) -> &'static str {
101        match self {
102            InvoicePaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => "bank_transfer",
103        }
104    }
105}
106
107impl AsRef<str> for InvoicePaymentMethodOptionsCustomerBalanceFundingType {
108    fn as_ref(&self) -> &str {
109        self.as_str()
110    }
111}
112
113impl std::fmt::Display for InvoicePaymentMethodOptionsCustomerBalanceFundingType {
114    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
115        self.as_str().fmt(f)
116    }
117}
118impl std::default::Default for InvoicePaymentMethodOptionsCustomerBalanceFundingType {
119    fn default() -> Self {
120        Self::BankTransfer
121    }
122}