Skip to content

Commit

Permalink
Merge pull request arlyon#237 from arlyon/openapi-1654826952
Browse files Browse the repository at this point in the history
Generate latest changes from OpenApi spec
arlyon authored Jun 10, 2022
2 parents d6040d7 + 6947e36 commit 113f7d5
Showing 16 changed files with 2,988 additions and 395 deletions.
45 changes: 45 additions & 0 deletions src/resources/generated/account.rs
Original file line number Diff line number Diff line change
@@ -466,6 +466,9 @@ pub struct AccountSettings {

#[serde(skip_serializing_if = "Option::is_none")]
pub sepa_debit_payments: Option<AccountSepaDebitPaymentsSettings>,

#[serde(skip_serializing_if = "Option::is_none")]
pub treasury: Option<AccountTreasurySettings>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
@@ -607,6 +610,27 @@ pub struct TosAcceptance {
pub user_agent: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AccountTreasurySettings {
#[serde(skip_serializing_if = "Option::is_none")]
pub tos_acceptance: Option<AccountTermsOfService>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AccountTermsOfService {
/// The Unix timestamp marking when the account representative accepted the service agreement.
#[serde(skip_serializing_if = "Option::is_none")]
pub date: Option<Timestamp>,

/// The IP address from which the account representative accepted the service agreement.
#[serde(skip_serializing_if = "Option::is_none")]
pub ip: Option<String>,

/// The user agent of the browser from which the account representative accepted the service agreement.
#[serde(skip_serializing_if = "Option::is_none")]
pub user_agent: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AccountUnificationAccountController {
/// `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts).
@@ -1077,6 +1101,9 @@ pub struct AccountSettingsParams {

#[serde(skip_serializing_if = "Option::is_none")]
pub payouts: Option<PayoutSettingsParams>,

#[serde(skip_serializing_if = "Option::is_none")]
pub treasury: Option<AccountSettingsParamsTreasury>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
@@ -1454,6 +1481,12 @@ pub struct AccountSettingsParamsCardIssuing {
pub tos_acceptance: Option<AccountSettingsParamsCardIssuingTosAcceptance>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AccountSettingsParamsTreasury {
#[serde(skip_serializing_if = "Option::is_none")]
pub tos_acceptance: Option<AccountSettingsParamsTreasuryTosAcceptance>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BrandingSettingsParams {
#[serde(skip_serializing_if = "Option::is_none")]
@@ -2018,6 +2051,18 @@ pub struct AccountSettingsParamsCardIssuingTosAcceptance {
pub user_agent: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct AccountSettingsParamsTreasuryTosAcceptance {
#[serde(skip_serializing_if = "Option::is_none")]
pub date: Option<Timestamp>,

#[serde(skip_serializing_if = "Option::is_none")]
pub ip: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub user_agent: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct DeclineChargeOnParams {
#[serde(skip_serializing_if = "Option::is_none")]
2,634 changes: 2,276 additions & 358 deletions src/resources/generated/checkout_session.rs

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions src/resources/generated/customer.rs
Original file line number Diff line number Diff line change
@@ -652,6 +652,9 @@ pub struct CustomerInvoiceSettings {

#[serde(skip_serializing_if = "Option::is_none")]
pub footer: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub rendering_options: Option<CustomerInvoiceSettingsRenderingOptions>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
@@ -718,6 +721,12 @@ pub struct CustomerInvoiceSettingsCustomFields {
pub value: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CustomerInvoiceSettingsRenderingOptions {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_tax_display: Option<CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateCustomerCashBalanceSettings {
#[serde(skip_serializing_if = "Option::is_none")]
@@ -779,6 +788,42 @@ impl std::default::Default for CreateCustomerCashBalanceSettingsReconciliationMo
}
}

/// An enum representing the possible values of an `CustomerInvoiceSettingsRenderingOptions`'s `amount_tax_display` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay {
ExcludeTax,
IncludeInclusiveTax,
}

impl CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay {
pub fn as_str(self) -> &'static str {
match self {
CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax",
CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => {
"include_inclusive_tax"
}
}
}
}

impl AsRef<str> for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay {
fn default() -> Self {
Self::ExcludeTax
}
}

/// An enum representing the possible values of an `CustomerTax`'s `automatic_tax` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
60 changes: 59 additions & 1 deletion src/resources/generated/funding_instructions.rs
Original file line number Diff line number Diff line change
@@ -47,6 +47,15 @@ pub struct FundingInstructionsBankTransfer {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferFinancialAddress {
#[serde(skip_serializing_if = "Option::is_none")]
pub iban: Option<FundingInstructionsBankTransferIbanRecord>,

#[serde(skip_serializing_if = "Option::is_none")]
pub sort_code: Option<FundingInstructionsBankTransferSortCodeRecord>,

#[serde(skip_serializing_if = "Option::is_none")]
pub spei: Option<FundingInstructionsBankTransferSpeiRecord>,

/// The payment networks supported by this FinancialAddress.
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_networks:
@@ -60,6 +69,45 @@ pub struct FundingInstructionsBankTransferFinancialAddress {
pub zengin: Option<FundingInstructionsBankTransferZenginRecord>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferIbanRecord {
/// The name of the person or business that owns the bank account.
pub account_holder_name: String,

/// The BIC/SWIFT code of the account.
pub bic: String,

/// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
pub country: String,

/// The IBAN of the account.
pub iban: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferSortCodeRecord {
/// The name of the person or business that owns the bank account.
pub account_holder_name: String,

/// The account number.
pub account_number: String,

/// The six-digit sort code.
pub sort_code: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferSpeiRecord {
/// The three-digit bank code.
pub bank_code: String,

/// The short banking institution name.
pub bank_name: String,

/// The CLABE number.
pub clabe: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferZenginRecord {
/// The account holder name.
@@ -97,14 +145,20 @@ pub struct FundingInstructionsBankTransferZenginRecord {
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum FundingInstructionsBankTransferFinancialAddressSupportedNetworks {
Bacs,
Fps,
Sepa,
Spei,
Zengin,
}

impl FundingInstructionsBankTransferFinancialAddressSupportedNetworks {
pub fn as_str(self) -> &'static str {
match self {
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Bacs => "bacs",
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Fps => "fps",
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Sepa => "sepa",
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Spei => "spei",
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Zengin => "zengin",
}
}
@@ -123,7 +177,7 @@ impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressSuppor
}
impl std::default::Default for FundingInstructionsBankTransferFinancialAddressSupportedNetworks {
fn default() -> Self {
Self::Sepa
Self::Bacs
}
}

@@ -132,13 +186,17 @@ impl std::default::Default for FundingInstructionsBankTransferFinancialAddressSu
#[serde(rename_all = "snake_case")]
pub enum FundingInstructionsBankTransferFinancialAddressType {
Iban,
SortCode,
Spei,
Zengin,
}

impl FundingInstructionsBankTransferFinancialAddressType {
pub fn as_str(self) -> &'static str {
match self {
FundingInstructionsBankTransferFinancialAddressType::Iban => "iban",
FundingInstructionsBankTransferFinancialAddressType::SortCode => "sort_code",
FundingInstructionsBankTransferFinancialAddressType::Spei => "spei",
FundingInstructionsBankTransferFinancialAddressType::Zengin => "zengin",
}
}
13 changes: 12 additions & 1 deletion src/resources/generated/invoice.rs
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ pub struct Invoice {
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_paid: Option<i64>,

/// The amount remaining, in %s, that is due.
/// The difference between amount_due and amount_paid, in %s.
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_remaining: Option<i64>,

@@ -965,6 +965,11 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptio

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer {
#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer: Option<
CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer,
>,

#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
@@ -977,6 +982,12 @@ pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancia
pub permissions: Option<Vec<CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
{
pub country: String,
}

/// An enum representing the possible values of an `AutomaticTax`'s `status` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
Original file line number Diff line number Diff line change
@@ -19,14 +19,75 @@ pub struct InvoicePaymentMethodOptionsCustomerBalance {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransfer {
#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer:
Option<InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,

/// The bank transfer type that can be used for funding.
///
/// Permitted values include: `jp_bank_transfer`.
/// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
/// The desired country code of the bank account information.
///
/// Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.
pub country: InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry,
}

/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer`'s `country` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry {
#[serde(rename = "DE")]
De,
#[serde(rename = "ES")]
Es,
#[serde(rename = "FR")]
Fr,
#[serde(rename = "IE")]
Ie,
#[serde(rename = "NL")]
Nl,
}

impl InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry {
pub fn as_str(self) -> &'static str {
match self {
InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::De => "DE",
InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Es => "ES",
InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Fr => "FR",
InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Ie => "IE",
InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Nl => "NL",
}
}
}

impl AsRef<str> for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display
for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry
{
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default
for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry
{
fn default() -> Self {
Self::De
}
}

/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCustomerBalance`'s `funding_type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
52 changes: 48 additions & 4 deletions src/resources/generated/order.rs
Original file line number Diff line number Diff line change
@@ -1626,6 +1626,9 @@ pub struct CreateOrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer {

#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer: Option<CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,

#[serde(skip_serializing_if = "Option::is_none")]
pub requested_address_types: Option<Vec<CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,

@@ -1658,6 +1661,9 @@ pub struct UpdateOrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer {

#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer: Option<UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,

#[serde(skip_serializing_if = "Option::is_none")]
pub requested_address_types: Option<Vec<UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,

@@ -1668,6 +1674,16 @@ pub struct UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTran
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateOrderPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptions {}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
pub country: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
pub country: String,
}

/// An enum representing the possible values of an `CreateOrderLineItemsPriceData`'s `tax_behavior` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
@@ -2141,6 +2157,10 @@ impl std::default::Default for CreateOrderPaymentSettingsPaymentMethodOptionsCar
#[serde(rename_all = "snake_case")]
pub enum CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
{
Iban,
Sepa,
SortCode,
Spei,
Zengin,
}

@@ -2149,6 +2169,10 @@ impl
{
pub fn as_str(self) -> &'static str {
match self {
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban",
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa",
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code",
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei",
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin",
}
}
@@ -2167,21 +2191,27 @@ impl std::fmt::Display for CreateOrderPaymentSettingsPaymentMethodOptionsCustome
}
impl std::default::Default for CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
fn default() -> Self {
Self::Zengin
Self::Iban
}
}

/// An enum representing the possible values of an `CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType {
EuBankTransfer,
GbBankTransfer,
JpBankTransfer,
MxBankTransfer,
}

impl CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType {
pub fn as_str(self) -> &'static str {
match self {
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer",
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer",
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer",
CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer",
}
}
}
@@ -2203,7 +2233,7 @@ impl std::default::Default
for CreateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType
{
fn default() -> Self {
Self::JpBankTransfer
Self::EuBankTransfer
}
}

@@ -4214,6 +4244,10 @@ impl std::default::Default for UpdateOrderPaymentSettingsPaymentMethodOptionsCar
#[serde(rename_all = "snake_case")]
pub enum UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
{
Iban,
Sepa,
SortCode,
Spei,
Zengin,
}

@@ -4222,6 +4256,10 @@ impl
{
pub fn as_str(self) -> &'static str {
match self {
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban",
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa",
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code",
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei",
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin",
}
}
@@ -4240,21 +4278,27 @@ impl std::fmt::Display for UpdateOrderPaymentSettingsPaymentMethodOptionsCustome
}
impl std::default::Default for UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
fn default() -> Self {
Self::Zengin
Self::Iban
}
}

/// An enum representing the possible values of an `UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType {
EuBankTransfer,
GbBankTransfer,
JpBankTransfer,
MxBankTransfer,
}

impl UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType {
pub fn as_str(self) -> &'static str {
match self {
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer",
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer",
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer",
UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer",
}
}
}
@@ -4276,7 +4320,7 @@ impl std::default::Default
for UpdateOrderPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferType
{
fn default() -> Self {
Self::JpBankTransfer
Self::EuBankTransfer
}
}

128 changes: 122 additions & 6 deletions src/resources/generated/payment_intent.rs
Original file line number Diff line number Diff line change
@@ -423,6 +423,15 @@ pub struct PaymentIntentNextActionDisplayBankTransferInstructions {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferFinancialAddress {
#[serde(skip_serializing_if = "Option::is_none")]
pub iban: Option<FundingInstructionsBankTransferIbanRecord>,

#[serde(skip_serializing_if = "Option::is_none")]
pub sort_code: Option<FundingInstructionsBankTransferSortCodeRecord>,

#[serde(skip_serializing_if = "Option::is_none")]
pub spei: Option<FundingInstructionsBankTransferSpeiRecord>,

/// The payment networks supported by this FinancialAddress.
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_networks:
@@ -436,6 +445,45 @@ pub struct FundingInstructionsBankTransferFinancialAddress {
pub zengin: Option<FundingInstructionsBankTransferZenginRecord>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferIbanRecord {
/// The name of the person or business that owns the bank account.
pub account_holder_name: String,

/// The BIC/SWIFT code of the account.
pub bic: String,

/// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
pub country: String,

/// The IBAN of the account.
pub iban: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferSortCodeRecord {
/// The name of the person or business that owns the bank account.
pub account_holder_name: String,

/// The account number.
pub account_number: String,

/// The six-digit sort code.
pub sort_code: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferSpeiRecord {
/// The three-digit bank code.
pub bank_code: String,

/// The short banking institution name.
pub bank_name: String,

/// The CLABE number.
pub clabe: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FundingInstructionsBankTransferZenginRecord {
/// The account holder name.
@@ -2908,6 +2956,10 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer:
Option<CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,

#[serde(skip_serializing_if = "Option::is_none")]
pub requested_address_types: Option<
Vec<
@@ -3024,6 +3076,10 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer {
#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer:
Option<UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,

#[serde(skip_serializing_if = "Option::is_none")]
pub requested_address_types: Option<
Vec<
@@ -3066,6 +3122,11 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
pub country: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
pub count: u64,
@@ -3076,6 +3137,11 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan {
pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
pub country: String,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged, rename_all = "snake_case")]
pub enum PaymentIntentPaymentMethodOptionsAcssDebitUnion {
@@ -4905,12 +4971,20 @@ impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardSetupF
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
Iban,
Sepa,
SortCode,
Spei,
Zengin,
}

impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
pub fn as_str(self) -> &'static str {
match self {
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban",
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa",
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code",
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei",
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin",
}
}
@@ -4935,21 +5009,27 @@ impl std::default::Default
for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
{
fn default() -> Self {
Self::Zengin
Self::Iban
}
}

/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
EuBankTransfer,
GbBankTransfer,
JpBankTransfer,
MxBankTransfer,
}

impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
pub fn as_str(self) -> &'static str {
match self {
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer",
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer",
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer",
CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer",
}
}
}
@@ -4969,7 +5049,7 @@ impl std::default::Default
for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
{
fn default() -> Self {
Self::JpBankTransfer
Self::EuBankTransfer
}
}

@@ -5937,14 +6017,20 @@ impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsWechatPayS
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum FundingInstructionsBankTransferFinancialAddressSupportedNetworks {
Bacs,
Fps,
Sepa,
Spei,
Zengin,
}

impl FundingInstructionsBankTransferFinancialAddressSupportedNetworks {
pub fn as_str(self) -> &'static str {
match self {
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Bacs => "bacs",
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Fps => "fps",
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Sepa => "sepa",
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Spei => "spei",
FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Zengin => "zengin",
}
}
@@ -5963,7 +6049,7 @@ impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressSuppor
}
impl std::default::Default for FundingInstructionsBankTransferFinancialAddressSupportedNetworks {
fn default() -> Self {
Self::Sepa
Self::Bacs
}
}

@@ -5972,13 +6058,17 @@ impl std::default::Default for FundingInstructionsBankTransferFinancialAddressSu
#[serde(rename_all = "snake_case")]
pub enum FundingInstructionsBankTransferFinancialAddressType {
Iban,
SortCode,
Spei,
Zengin,
}

impl FundingInstructionsBankTransferFinancialAddressType {
pub fn as_str(self) -> &'static str {
match self {
FundingInstructionsBankTransferFinancialAddressType::Iban => "iban",
FundingInstructionsBankTransferFinancialAddressType::SortCode => "sort_code",
FundingInstructionsBankTransferFinancialAddressType::Spei => "spei",
FundingInstructionsBankTransferFinancialAddressType::Zengin => "zengin",
}
}
@@ -6117,15 +6207,27 @@ impl std::default::Default for PaymentIntentConfirmationMethod {
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum PaymentIntentNextActionDisplayBankTransferInstructionsType {
EuBankTransfer,
GbBankTransfer,
JpBankTransfer,
MxBankTransfer,
}

impl PaymentIntentNextActionDisplayBankTransferInstructionsType {
pub fn as_str(self) -> &'static str {
match self {
PaymentIntentNextActionDisplayBankTransferInstructionsType::EuBankTransfer => {
"eu_bank_transfer"
}
PaymentIntentNextActionDisplayBankTransferInstructionsType::GbBankTransfer => {
"gb_bank_transfer"
}
PaymentIntentNextActionDisplayBankTransferInstructionsType::JpBankTransfer => {
"jp_bank_transfer"
}
PaymentIntentNextActionDisplayBankTransferInstructionsType::MxBankTransfer => {
"mx_bank_transfer"
}
}
}
}
@@ -6143,7 +6245,7 @@ impl std::fmt::Display for PaymentIntentNextActionDisplayBankTransferInstruction
}
impl std::default::Default for PaymentIntentNextActionDisplayBankTransferInstructionsType {
fn default() -> Self {
Self::JpBankTransfer
Self::EuBankTransfer
}
}

@@ -8599,12 +8701,20 @@ impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardSetupF
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
Iban,
Sepa,
SortCode,
Spei,
Zengin,
}

impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
pub fn as_str(self) -> &'static str {
match self {
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban",
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa",
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code",
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei",
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin",
}
}
@@ -8629,21 +8739,27 @@ impl std::default::Default
for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
{
fn default() -> Self {
Self::Zengin
Self::Iban
}
}

/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
EuBankTransfer,
GbBankTransfer,
JpBankTransfer,
MxBankTransfer,
}

impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType {
pub fn as_str(self) -> &'static str {
match self {
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer",
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer",
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer",
UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer",
}
}
}
@@ -8663,7 +8779,7 @@ impl std::default::Default
for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType
{
fn default() -> Self {
Self::JpBankTransfer
Self::EuBankTransfer
}
}

8 changes: 4 additions & 4 deletions src/resources/generated/payment_method.rs
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ pub struct PaymentMethod {
}

impl PaymentMethod {
/// Returns a list of PaymentMethods.
/// Returns a list of PaymentMethods attached to the StripeAccount.
///
/// For listing a customer’s payment methods, you should use [List a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list).
pub fn list(client: &Client, params: &ListPaymentMethods<'_>) -> Response<List<PaymentMethod>> {
@@ -149,7 +149,9 @@ impl PaymentMethod {
client.post_form("/payment_methods", &params)
}

/// Retrieves a PaymentMethod object.
/// Retrieves a PaymentMethod object attached to the StripeAccount.
///
/// To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer).
pub fn retrieve(
client: &Client,
id: &PaymentMethodId,
@@ -865,8 +867,6 @@ impl<'a> CreatePaymentMethod<'a> {
#[derive(Clone, Debug, Serialize)]
pub struct ListPaymentMethods<'a> {
/// The ID of the customer whose PaymentMethods will be retrieved.
///
/// If not provided, the response list will be empty.
#[serde(skip_serializing_if = "Option::is_none")]
pub customer: Option<CustomerId>,

86 changes: 82 additions & 4 deletions src/resources/generated/payment_method_options_customer_balance.rs
Original file line number Diff line number Diff line change
@@ -27,29 +27,50 @@ pub struct PaymentMethodOptionsCustomerBalance {

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodOptionsCustomerBalanceBankTransfer {
#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer: Option<PaymentMethodOptionsCustomerBalanceEuBankAccount>,

/// List of address types that should be returned in the financial_addresses response.
///
/// If not specified, all valid types will be returned. Permitted values include: `zengin`.
/// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`.
#[serde(skip_serializing_if = "Option::is_none")]
pub requested_address_types:
Option<Vec<PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes>>,

/// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`.
/// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<PaymentMethodOptionsCustomerBalanceBankTransferType>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PaymentMethodOptionsCustomerBalanceEuBankAccount {
/// The desired country code of the bank account information.
///
/// Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.
pub country: PaymentMethodOptionsCustomerBalanceEuBankAccountCountry,
}

/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
Iban,
Sepa,
SortCode,
Spei,
Zengin,
}

impl PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes {
pub fn as_str(self) -> &'static str {
match self {
PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban",
PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa",
PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => {
"sort_code"
}
PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei",
PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => {
"zengin"
}
@@ -72,23 +93,35 @@ impl std::default::Default
for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes
{
fn default() -> Self {
Self::Zengin
Self::Iban
}
}

/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum PaymentMethodOptionsCustomerBalanceBankTransferType {
EuBankTransfer,
GbBankTransfer,
JpBankTransfer,
MxBankTransfer,
}

impl PaymentMethodOptionsCustomerBalanceBankTransferType {
pub fn as_str(self) -> &'static str {
match self {
PaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => {
"eu_bank_transfer"
}
PaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => {
"gb_bank_transfer"
}
PaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => {
"jp_bank_transfer"
}
PaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => {
"mx_bank_transfer"
}
}
}
}
@@ -106,7 +139,52 @@ impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferType {
}
impl std::default::Default for PaymentMethodOptionsCustomerBalanceBankTransferType {
fn default() -> Self {
Self::JpBankTransfer
Self::EuBankTransfer
}
}

/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceEuBankAccount`'s `country` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum PaymentMethodOptionsCustomerBalanceEuBankAccountCountry {
#[serde(rename = "DE")]
De,
#[serde(rename = "ES")]
Es,
#[serde(rename = "FR")]
Fr,
#[serde(rename = "IE")]
Ie,
#[serde(rename = "NL")]
Nl,
}

impl PaymentMethodOptionsCustomerBalanceEuBankAccountCountry {
pub fn as_str(self) -> &'static str {
match self {
PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::De => "DE",
PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Es => "ES",
PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Fr => "FR",
PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Ie => "IE",
PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Nl => "NL",
}
}
}

impl AsRef<str> for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry {
fn default() -> Self {
Self::De
}
}

40 changes: 40 additions & 0 deletions src/resources/generated/price.rs
Original file line number Diff line number Diff line change
@@ -43,6 +43,10 @@ pub struct Price {
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<Currency>,

/// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_unit_amount: Option<CustomUnitAmount>,

// Always true for a deleted object
#[serde(default)]
pub deleted: bool,
@@ -156,6 +160,23 @@ impl Object for Price {
}
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CustomUnitAmount {
/// The maximum unit amount the customer can specify for this item.
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum: Option<i64>,

/// The minimum unit amount the customer can specify for this item.
///
/// Must be at least the minimum charge amount.
#[serde(skip_serializing_if = "Option::is_none")]
pub minimum: Option<i64>,

/// The starting unit amount which can be updated by the customer.
#[serde(skip_serializing_if = "Option::is_none")]
pub preset: Option<i64>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct PriceTier {
/// Price for the entire tier.
@@ -238,6 +259,10 @@ pub struct CreatePrice<'a> {
/// Must be a [supported currency](https://stripe.com/docs/currencies).
pub currency: Currency,

/// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_unit_amount: Option<CreatePriceCustomUnitAmount>,

/// Specifies which fields in the response should be expanded.
#[serde(skip_serializing_if = "Expand::is_empty")]
pub expand: &'a [&'a str],
@@ -319,6 +344,7 @@ impl<'a> CreatePrice<'a> {
active: Default::default(),
billing_scheme: Default::default(),
currency,
custom_unit_amount: Default::default(),
expand: Default::default(),
lookup_key: Default::default(),
metadata: Default::default(),
@@ -476,6 +502,20 @@ impl<'a> UpdatePrice<'a> {
}
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreatePriceCustomUnitAmount {
pub enabled: bool,

#[serde(skip_serializing_if = "Option::is_none")]
pub maximum: Option<i64>,

#[serde(skip_serializing_if = "Option::is_none")]
pub minimum: Option<i64>,

#[serde(skip_serializing_if = "Option::is_none")]
pub preset: Option<i64>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreatePriceProductData {
#[serde(skip_serializing_if = "Option::is_none")]
51 changes: 51 additions & 0 deletions src/resources/generated/setup_attempt.rs
Original file line number Diff line number Diff line change
@@ -24,6 +24,14 @@ pub struct SetupAttempt {
#[serde(skip_serializing_if = "Option::is_none")]
pub application: Option<Expandable<Application>>,

/// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
///
/// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
///
/// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_to_self: Option<bool>,

/// Time at which the object was created.
///
/// Measured in seconds since the Unix epoch.
@@ -33,6 +41,15 @@ pub struct SetupAttempt {
#[serde(skip_serializing_if = "Option::is_none")]
pub customer: Option<Expandable<Customer>>,

/// Indicates the directions of money movement for which this payment method is intended to be used.
///
/// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
///
/// Include `outbound` if you intend to use the payment method as the destination to send funds to.
/// You can include both if you intend to use the payment method for both purposes.
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_directions: Option<Vec<SetupAttemptFlowDirections>>,

/// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
pub livemode: bool,

@@ -323,6 +340,40 @@ impl Paginable for ListSetupAttempts<'_> {
self.starting_after = Some(item.id());
}
}
/// An enum representing the possible values of an `SetupAttempt`'s `flow_directions` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum SetupAttemptFlowDirections {
Inbound,
Outbound,
}

impl SetupAttemptFlowDirections {
pub fn as_str(self) -> &'static str {
match self {
SetupAttemptFlowDirections::Inbound => "inbound",
SetupAttemptFlowDirections::Outbound => "outbound",
}
}
}

impl AsRef<str> for SetupAttemptFlowDirections {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display for SetupAttemptFlowDirections {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default for SetupAttemptFlowDirections {
fn default() -> Self {
Self::Inbound
}
}

/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsBancontact`'s `preferred_language` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
115 changes: 115 additions & 0 deletions src/resources/generated/setup_intent.rs
Original file line number Diff line number Diff line change
@@ -393,6 +393,14 @@ pub struct SetupIntentTypeSpecificPaymentMethodOptionsClient {
/// The parameters for `SetupIntent::create`.
#[derive(Clone, Debug, Serialize, Default)]
pub struct CreateSetupIntent<'a> {
/// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
///
/// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
///
/// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_to_self: Option<bool>,

/// Set to `true` to attempt to confirm this SetupIntent immediately.
///
/// This parameter defaults to `false`.
@@ -418,6 +426,15 @@ pub struct CreateSetupIntent<'a> {
#[serde(skip_serializing_if = "Expand::is_empty")]
pub expand: &'a [&'a str],

/// Indicates the directions of money movement for which this payment method is intended to be used.
///
/// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
///
/// Include `outbound` if you intend to use the payment method as the destination to send funds to.
/// You can include both if you intend to use the payment method for both purposes.
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_directions: Option<Vec<CreateSetupIntentFlowDirections>>,

/// This hash contains details about the Mandate to create.
///
/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
@@ -471,10 +488,12 @@ pub struct CreateSetupIntent<'a> {
impl<'a> CreateSetupIntent<'a> {
pub fn new() -> Self {
CreateSetupIntent {
attach_to_self: Default::default(),
confirm: Default::default(),
customer: Default::default(),
description: Default::default(),
expand: Default::default(),
flow_directions: Default::default(),
mandate_data: Default::default(),
metadata: Default::default(),
on_behalf_of: Default::default(),
@@ -491,6 +510,14 @@ impl<'a> CreateSetupIntent<'a> {
/// The parameters for `SetupIntent::list`.
#[derive(Clone, Debug, Serialize, Default)]
pub struct ListSetupIntents<'a> {
/// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
///
/// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
///
/// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_to_self: Option<bool>,

/// A filter on the list, based on the object `created` field.
///
/// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
@@ -533,6 +560,7 @@ pub struct ListSetupIntents<'a> {
impl<'a> ListSetupIntents<'a> {
pub fn new() -> Self {
ListSetupIntents {
attach_to_self: Default::default(),
created: Default::default(),
customer: Default::default(),
ending_before: Default::default(),
@@ -552,6 +580,14 @@ impl Paginable for ListSetupIntents<'_> {
/// The parameters for `SetupIntent::update`.
#[derive(Clone, Debug, Serialize, Default)]
pub struct UpdateSetupIntent<'a> {
/// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
///
/// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers.
///
/// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
#[serde(skip_serializing_if = "Option::is_none")]
pub attach_to_self: Option<bool>,

/// ID of the Customer this SetupIntent belongs to, if one exists.
///
/// If present, the SetupIntent's payment method will be attached to the Customer on successful setup.
@@ -570,6 +606,15 @@ pub struct UpdateSetupIntent<'a> {
#[serde(skip_serializing_if = "Expand::is_empty")]
pub expand: &'a [&'a str],

/// Indicates the directions of money movement for which this payment method is intended to be used.
///
/// Include `inbound` if you intend to use the payment method as the origin to pull funds from.
///
/// Include `outbound` if you intend to use the payment method as the destination to send funds to.
/// You can include both if you intend to use the payment method for both purposes.
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_directions: Option<Vec<UpdateSetupIntentFlowDirections>>,

/// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
///
/// This can be useful for storing additional information about the object in a structured format.
@@ -602,9 +647,11 @@ pub struct UpdateSetupIntent<'a> {
impl<'a> UpdateSetupIntent<'a> {
pub fn new() -> Self {
UpdateSetupIntent {
attach_to_self: Default::default(),
customer: Default::default(),
description: Default::default(),
expand: Default::default(),
flow_directions: Default::default(),
metadata: Default::default(),
payment_method: Default::default(),
payment_method_data: Default::default(),
@@ -1519,6 +1566,40 @@ impl std::default::Default for SetupIntentPaymentMethodOptionsUsBankAccountUnion
}
}

/// An enum representing the possible values of an `CreateSetupIntent`'s `flow_directions` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum CreateSetupIntentFlowDirections {
Inbound,
Outbound,
}

impl CreateSetupIntentFlowDirections {
pub fn as_str(self) -> &'static str {
match self {
CreateSetupIntentFlowDirections::Inbound => "inbound",
CreateSetupIntentFlowDirections::Outbound => "outbound",
}
}
}

impl AsRef<str> for CreateSetupIntentFlowDirections {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display for CreateSetupIntentFlowDirections {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default for CreateSetupIntentFlowDirections {
fn default() -> Self {
Self::Inbound
}
}

/// An enum representing the possible values of an `CreateSetupIntentMandateDataCustomerAcceptance`'s `type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
@@ -3073,6 +3154,40 @@ impl std::default::Default for SetupIntentTypeSpecificPaymentMethodOptionsClient
}
}

/// An enum representing the possible values of an `UpdateSetupIntent`'s `flow_directions` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum UpdateSetupIntentFlowDirections {
Inbound,
Outbound,
}

impl UpdateSetupIntentFlowDirections {
pub fn as_str(self) -> &'static str {
match self {
UpdateSetupIntentFlowDirections::Inbound => "inbound",
UpdateSetupIntentFlowDirections::Outbound => "outbound",
}
}
}

impl AsRef<str> for UpdateSetupIntentFlowDirections {
fn as_ref(&self) -> &str {
self.as_str()
}
}

impl std::fmt::Display for UpdateSetupIntentFlowDirections {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default for UpdateSetupIntentFlowDirections {
fn default() -> Self {
Self::Inbound
}
}

/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataEps`'s `bank` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
33 changes: 26 additions & 7 deletions src/resources/generated/subscription.rs
Original file line number Diff line number Diff line change
@@ -39,6 +39,8 @@ pub struct Subscription {
pub automatic_tax: SubscriptionAutomaticTax,

/// Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices.
///
/// The timestamp is in UTC format.
pub billing_cycle_anchor: Timestamp,

/// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.
@@ -381,6 +383,8 @@ pub struct InvoiceMandateOptionsCard {
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct SubscriptionsResourcePendingUpdate {
/// If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices.
///
/// The timestamp is in UTC format.
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_cycle_anchor: Option<Timestamp>,

@@ -437,6 +441,7 @@ pub struct CreateSubscription<'a> {
/// A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle).
///
/// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices.
/// The timestamp is in UTC format.
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_cycle_anchor: Option<Timestamp>,

@@ -562,8 +567,6 @@ pub struct CreateSubscription<'a> {

/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`.
///
/// Valid values are `create_prorations` or `none`. Passing `create_prorations` will cause proration invoice items to be created when applicable.
/// Prorations can be disabled by passing `none`.
/// If no value is passed, the default is `create_prorations`.
#[serde(skip_serializing_if = "Option::is_none")]
pub proration_behavior: Option<SubscriptionProrationBehavior>,
@@ -749,7 +752,7 @@ pub struct UpdateSubscription<'a> {

/// Either `now` or `unchanged`.
///
/// Setting the value to `now` resets the subscription's billing cycle anchor to the current time.
/// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC).
/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_cycle_anchor: Option<SubscriptionBillingCycleAnchor>,
@@ -876,10 +879,6 @@ pub struct UpdateSubscription<'a> {
pub promotion_code: Option<PromotionCodeId>,

/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
///
/// Valid values are `create_prorations`, `none`, or `always_invoice`. Passing `create_prorations` will cause proration invoice items to be created when applicable.
/// These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment).
/// In order to always invoice immediately for prorations, pass `always_invoice`. Prorations can be disabled by passing `none`.
#[serde(skip_serializing_if = "Option::is_none")]
pub proration_behavior: Option<SubscriptionProrationBehavior>,

@@ -1315,6 +1314,10 @@ pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptio

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer {

#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,

#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
@@ -1350,6 +1353,10 @@ pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptio

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer {

#[serde(skip_serializing_if = "Option::is_none")]
pub eu_bank_transfer: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,

#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
@@ -1362,6 +1369,18 @@ pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFin
pub permissions: Option<Vec<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>>,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
{
pub country: String,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
{
pub country: String,
}

/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
8 changes: 0 additions & 8 deletions src/resources/generated/subscription_item.rs
Original file line number Diff line number Diff line change
@@ -158,10 +158,6 @@ pub struct CreateSubscriptionItem<'a> {
pub price_data: Option<SubscriptionItemPriceData>,

/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
///
/// Valid values are `create_prorations`, `none`, or `always_invoice`. Passing `create_prorations` will cause proration invoice items to be created when applicable.
/// These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment).
/// In order to always invoice immediately for prorations, pass `always_invoice`. Prorations can be disabled by passing `none`.
#[serde(skip_serializing_if = "Option::is_none")]
pub proration_behavior: Option<SubscriptionProrationBehavior>,

@@ -303,10 +299,6 @@ pub struct UpdateSubscriptionItem<'a> {
pub price_data: Option<SubscriptionItemPriceData>,

/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
///
/// Valid values are `create_prorations`, `none`, or `always_invoice`. Passing `create_prorations` will cause proration invoice items to be created when applicable.
/// These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment).
/// In order to always invoice immediately for prorations, pass `always_invoice`. Prorations can be disabled by passing `none`.
#[serde(skip_serializing_if = "Option::is_none")]
pub proration_behavior: Option<SubscriptionProrationBehavior>,

2 changes: 1 addition & 1 deletion src/resources/generated/treasury_received_debit.rs
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ pub struct ReceivedDebitsResourceTreasuryLinkedFlows {
#[serde(skip_serializing_if = "Option::is_none")]
pub inbound_transfer: Option<String>,

/// Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object.
/// Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object.
#[serde(skip_serializing_if = "Option::is_none")]
pub issuing_authorization: Option<String>,

0 comments on commit 113f7d5

Please sign in to comment.