From 9b3a844a94c090fd66ce7d223ccd8ddcd93a5c45 Mon Sep 17 00:00:00 2001 From: arlyon Date: Fri, 19 Jan 2024 00:23:47 +0000 Subject: [PATCH] feat: generate latest changes from OpenApi spec --- openapi/src/codegen.rs | 1 + openapi/version.json | 2 +- src/resources.rs | 1 + src/resources/generated.rs | 1 + src/resources/generated/account.rs | 53 ++- src/resources/generated/account_link.rs | 92 ++++- src/resources/generated/charge.rs | 13 +- src/resources/generated/checkout_session.rs | 180 ++++++++- .../generated/connect_account_reference.rs | 54 +++ src/resources/generated/customer_session.rs | 10 +- src/resources/generated/invoice.rs | 131 ++++++- src/resources/generated/mandate.rs | 43 +++ src/resources/generated/payment_intent.rs | 8 +- src/resources/generated/payment_link.rs | 350 +++++++++++++++++- src/resources/generated/payment_method.rs | 49 ++- .../generated/payment_method_configuration.rs | 123 ++++++ src/resources/generated/price.rs | 2 +- src/resources/generated/product.rs | 2 +- src/resources/generated/quote.rs | 13 +- src/resources/generated/setup_attempt.rs | 7 +- src/resources/generated/setup_intent.rs | 4 + src/resources/generated/subscription.rs | 241 +++++++++++- src/resources/generated/subscription_item.rs | 2 +- .../generated/subscription_schedule.rs | 236 +++++++++++- 24 files changed, 1565 insertions(+), 53 deletions(-) create mode 100644 src/resources/generated/connect_account_reference.rs diff --git a/openapi/src/codegen.rs b/openapi/src/codegen.rs index e5596c79f..f3ba27340 100644 --- a/openapi/src/codegen.rs +++ b/openapi/src/codegen.rs @@ -698,6 +698,7 @@ pub fn gen_unions(out: &mut String, unions: &BTreeMap, me pub fn gen_variant_name(wire_name: &str, meta: &Metadata) -> String { match wire_name { "*" => "All".to_string(), + "self" => "Self_".to_string(), n => { if n.chars().next().unwrap().is_digit(10) { format!("V{}", n.to_string().replace('-', "_").replace('.', "_")) diff --git a/openapi/version.json b/openapi/version.json index 3b5bfd072..7b7d6a1af 100644 --- a/openapi/version.json +++ b/openapi/version.json @@ -1,3 +1,3 @@ { - "version": "v755" + "version": "v790" } \ No newline at end of file diff --git a/src/resources.rs b/src/resources.rs index 816af0845..a4adeca74 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -121,6 +121,7 @@ pub use { balance_transaction::*, billing_details::*, charge::*, + connect_account_reference::*, customer::*, custom_unit_amount::*, cash_balance::*, diff --git a/src/resources/generated.rs b/src/resources/generated.rs index 5b9f298c5..2656f058f 100644 --- a/src/resources/generated.rs +++ b/src/resources/generated.rs @@ -19,6 +19,7 @@ pub mod core { pub mod billing_details; pub mod cash_balance; pub mod charge; + pub mod connect_account_reference; pub mod custom_unit_amount; pub mod customer; pub mod dispute; diff --git a/src/resources/generated/account.rs b/src/resources/generated/account.rs index d1f03ce51..a5da67231 100644 --- a/src/resources/generated/account.rs +++ b/src/resources/generated/account.rs @@ -27,6 +27,8 @@ pub struct Account { pub business_profile: Option, /// The business type. + /// + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property is only returned for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub business_type: Option, @@ -76,6 +78,8 @@ pub struct Account { pub email: Option, /// External accounts (bank accounts and debit cards) currently attached to this account. + /// + /// External accounts are only returned for requests where `controller[is_controller]` is true. #[serde(default)] pub external_accounts: List, @@ -141,8 +145,7 @@ impl Account { /// /// Any parameters not provided are left unchanged. For Custom accounts, you can update any information on the account. /// For other accounts, you can update all information until that account has started to go through Connect Onboarding. - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) for a Standard or Express account, some parameters can no longer be changed. - /// These are marked as **Custom Only** or **Custom and Express** below. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), some properties can only be changed or updated for Custom accounts. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). /// Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. pub fn update(client: &Client, id: &AccountId, params: UpdateAccount<'_>) -> Response { client.post_form(&format!("/accounts/{}", id), ¶ms) @@ -171,6 +174,14 @@ impl Object for Account { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct BusinessProfile { + /// The applicant's gross annual revenue for its preceding fiscal year. + pub annual_revenue: Option, + + /// An estimated upper bound of employees, contractors, vendors, etc. + /// + /// currently working for the business. + pub estimated_worker_count: Option, + /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). /// /// MCCs are used to classify businesses based on the goods or services they provide. @@ -204,6 +215,23 @@ pub struct BusinessProfile { pub url: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct AccountAnnualRevenue { + /// A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: Option, + + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Option, + + /// The close-out date of the preceding fiscal year in ISO 8601 format. + /// + /// E.g. + /// 2023-12-31 for the 31st of December, 2023. + pub fiscal_year_end: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct AccountCapabilities { /// The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. @@ -854,6 +882,8 @@ pub struct CreateAccount<'a> { pub business_profile: Option, /// The business type. + /// + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub business_type: Option, @@ -868,6 +898,7 @@ pub struct CreateAccount<'a> { /// Information about the company or business. /// /// This field is available for any `business_type`. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub company: Option, @@ -904,13 +935,14 @@ pub struct CreateAccount<'a> { /// /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. - /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub external_account: Option<&'a str>, /// Information about the person represented by the account. /// /// This field is null unless `business_type` is set to `individual`. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub individual: Option, @@ -926,7 +958,7 @@ pub struct CreateAccount<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub settings: Option, - /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub tos_acceptance: Option, @@ -1021,6 +1053,8 @@ pub struct UpdateAccount<'a> { pub business_profile: Option, /// The business type. + /// + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub business_type: Option, @@ -1035,6 +1069,7 @@ pub struct UpdateAccount<'a> { /// Information about the company or business. /// /// This field is available for any `business_type`. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub company: Option, @@ -1063,13 +1098,14 @@ pub struct UpdateAccount<'a> { /// /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. - /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub external_account: Option<&'a str>, /// Information about the person represented by the account. /// /// This field is null unless `business_type` is set to `individual`. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub individual: Option, @@ -1085,7 +1121,7 @@ pub struct UpdateAccount<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub settings: Option, - /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). + /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. #[serde(skip_serializing_if = "Option::is_none")] pub tos_acceptance: Option, } @@ -1231,6 +1267,7 @@ pub struct CompanyParams { /// The category identifying the legal structure of the company or legal entity. /// /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + /// Pass an empty string to unset this value. #[serde(skip_serializing_if = "Option::is_none")] pub structure: Option, @@ -4234,6 +4271,7 @@ pub enum CompanyParamsStructure { PublicCompany, PublicCorporation, PublicPartnership, + RegisteredCharity, SingleMemberLlc, SoleEstablishment, SoleProprietorship, @@ -4261,6 +4299,7 @@ impl CompanyParamsStructure { CompanyParamsStructure::PublicCompany => "public_company", CompanyParamsStructure::PublicCorporation => "public_corporation", CompanyParamsStructure::PublicPartnership => "public_partnership", + CompanyParamsStructure::RegisteredCharity => "registered_charity", CompanyParamsStructure::SingleMemberLlc => "single_member_llc", CompanyParamsStructure::SoleEstablishment => "sole_establishment", CompanyParamsStructure::SoleProprietorship => "sole_proprietorship", @@ -4310,6 +4349,7 @@ pub enum CompanyStructure { PublicCompany, PublicCorporation, PublicPartnership, + RegisteredCharity, SingleMemberLlc, SoleEstablishment, SoleProprietorship, @@ -4337,6 +4377,7 @@ impl CompanyStructure { CompanyStructure::PublicCompany => "public_company", CompanyStructure::PublicCorporation => "public_corporation", CompanyStructure::PublicPartnership => "public_partnership", + CompanyStructure::RegisteredCharity => "registered_charity", CompanyStructure::SingleMemberLlc => "single_member_llc", CompanyStructure::SoleEstablishment => "sole_establishment", CompanyStructure::SoleProprietorship => "sole_proprietorship", diff --git a/src/resources/generated/account_link.rs b/src/resources/generated/account_link.rs index def9a7e3e..487d6b4bb 100644 --- a/src/resources/generated/account_link.rs +++ b/src/resources/generated/account_link.rs @@ -46,13 +46,16 @@ pub struct CreateAccountLink<'a> { /// The identifier of the account to create an account link for. pub account: AccountId, - /// Which information the platform needs to collect from the user. + /// The collect parameter is deprecated. /// - /// One of `currently_due` or `eventually_due`. - /// Default is `currently_due`. + /// Use `collection_options` instead. #[serde(skip_serializing_if = "Option::is_none")] pub collect: Option, + /// Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_options: Option, + /// Specifies which fields in the response should be expanded. #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], @@ -80,6 +83,7 @@ impl<'a> CreateAccountLink<'a> { CreateAccountLink { account, collect: Default::default(), + collection_options: Default::default(), expand: Default::default(), refresh_url: Default::default(), return_url: Default::default(), @@ -88,6 +92,20 @@ impl<'a> CreateAccountLink<'a> { } } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountLinkCollectionOptions { + /// Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). + /// + /// If you don't specify `collection_options`, the default value is `currently_due`. + pub fields: CreateAccountLinkCollectionOptionsFields, + + /// Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. + /// + /// The default value is `omit`. + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, +} + /// An enum representing the possible values of an `CreateAccountLink`'s `collect` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -155,3 +173,71 @@ impl std::default::Default for AccountLinkType { Self::AccountOnboarding } } + +/// An enum representing the possible values of an `CreateAccountLinkCollectionOptions`'s `fields` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateAccountLinkCollectionOptionsFields { + CurrentlyDue, + EventuallyDue, +} + +impl CreateAccountLinkCollectionOptionsFields { + pub fn as_str(self) -> &'static str { + match self { + CreateAccountLinkCollectionOptionsFields::CurrentlyDue => "currently_due", + CreateAccountLinkCollectionOptionsFields::EventuallyDue => "eventually_due", + } + } +} + +impl AsRef for CreateAccountLinkCollectionOptionsFields { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateAccountLinkCollectionOptionsFields { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateAccountLinkCollectionOptionsFields { + fn default() -> Self { + Self::CurrentlyDue + } +} + +/// An enum representing the possible values of an `CreateAccountLinkCollectionOptions`'s `future_requirements` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateAccountLinkCollectionOptionsFutureRequirements { + Include, + Omit, +} + +impl CreateAccountLinkCollectionOptionsFutureRequirements { + pub fn as_str(self) -> &'static str { + match self { + CreateAccountLinkCollectionOptionsFutureRequirements::Include => "include", + CreateAccountLinkCollectionOptionsFutureRequirements::Omit => "omit", + } + } +} + +impl AsRef for CreateAccountLinkCollectionOptionsFutureRequirements { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateAccountLinkCollectionOptionsFutureRequirements { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateAccountLinkCollectionOptionsFutureRequirements { + fn default() -> Self { + Self::Include + } +} diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs index da427cf8e..d98e5d525 100644 --- a/src/resources/generated/charge.rs +++ b/src/resources/generated/charge.rs @@ -216,10 +216,10 @@ impl Charge { client.get_query("/charges", ¶ms) } - /// Use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead - /// of using this method. + /// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) + /// to initiate a new payment instead. /// - /// Confirmation of the PaymentIntent creates the `Charge` object used to request payment, so this method is limited to legacy integrations. + /// Confirmation of the PaymentIntent creates the `Charge` object used to request payment. pub fn create(client: &Client, params: CreateCharge<'_>) -> Response { client.post_form("/charges", ¶ms) } @@ -1116,7 +1116,7 @@ pub struct PaymentMethodDetailsGrabpay { pub struct PaymentMethodDetailsIdeal { /// The customer's bank. /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. pub bank: Option, /// The Bank Identifier Code of the customer's bank. @@ -2478,6 +2478,7 @@ pub enum PaymentMethodDetailsIdealBank { Knab, Moneyou, N26, + Nn, Rabobank, Regiobank, Revolut, @@ -2498,6 +2499,7 @@ impl PaymentMethodDetailsIdealBank { PaymentMethodDetailsIdealBank::Knab => "knab", PaymentMethodDetailsIdealBank::Moneyou => "moneyou", PaymentMethodDetailsIdealBank::N26 => "n26", + PaymentMethodDetailsIdealBank::Nn => "nn", PaymentMethodDetailsIdealBank::Rabobank => "rabobank", PaymentMethodDetailsIdealBank::Regiobank => "regiobank", PaymentMethodDetailsIdealBank::Revolut => "revolut", @@ -2548,6 +2550,8 @@ pub enum PaymentMethodDetailsIdealBic { Knabnl2h, #[serde(rename = "MOYONL21")] Moyonl21, + #[serde(rename = "NNBANL2G")] + Nnbanl2g, #[serde(rename = "NTSBDEB1")] Ntsbdeb1, #[serde(rename = "RABONL2U")] @@ -2576,6 +2580,7 @@ impl PaymentMethodDetailsIdealBic { PaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A", PaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H", PaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", + PaymentMethodDetailsIdealBic::Nnbanl2g => "NNBANL2G", PaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1", PaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", PaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs index 649e3cadc..6bdf65f8b 100644 --- a/src/resources/generated/checkout_session.rs +++ b/src/resources/generated/checkout_session.rs @@ -13,7 +13,7 @@ use crate::params::{ CurrencyMap, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, }; use crate::resources::{ - Address, CheckoutSessionItem, Currency, Customer, Discount, Invoice, + Address, CheckoutSessionItem, ConnectAccountReference, Currency, Customer, Discount, Invoice, InvoiceSettingRenderingOptions, LinkedAccountOptionsUsBankAccount, PaymentIntent, PaymentLink, PaymentMethodConfigBizPaymentMethodConfigurationDetails, PaymentMethodOptionsCustomerBalanceEuBankAccount, SetupIntent, Shipping, ShippingRate, @@ -77,7 +77,7 @@ pub struct CheckoutSession { /// Collect additional information from your customer using custom fields. /// - /// Up to 2 fields are supported. + /// Up to 3 fields are supported. pub custom_fields: Vec, pub custom_text: PaymentPagesCheckoutSessionCustomText, @@ -790,6 +790,12 @@ pub struct PaymentPagesCheckoutSessionAutomaticTax { /// Indicates whether automatic tax is enabled for the session. pub enabled: bool, + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, + /// The status of the most recent automated tax calculation for this session. pub status: Option, } @@ -996,6 +1002,11 @@ pub struct PaymentPagesCheckoutSessionInvoiceSettings { /// Footer displayed on the invoice. pub footer: Option, + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + pub issuer: Option, + /// 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. @@ -1174,7 +1185,7 @@ pub struct CreateCheckoutSession<'a> { /// Collect additional information from your customer using custom fields. /// - /// Up to 2 fields are supported. + /// Up to 3 fields are supported. #[serde(skip_serializing_if = "Option::is_none")] pub custom_fields: Option>, @@ -1501,6 +1512,13 @@ pub struct CreateCheckoutSessionAfterExpiration { pub struct CreateCheckoutSessionAutomaticTax { /// Set to true to enable automatic taxes. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1938,6 +1956,10 @@ pub struct CreateCheckoutSessionSubscriptionData { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// 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. @@ -2006,6 +2028,17 @@ pub struct CreateCheckoutSessionAfterExpirationRecovery { pub enabled: bool, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateCheckoutSessionAutomaticTaxLiabilityType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement { /// Determines the position and visibility of the payment method reuse agreement in the UI. @@ -2101,6 +2134,12 @@ pub struct CreateCheckoutSessionInvoiceCreationInvoiceData { #[serde(skip_serializing_if = "Option::is_none")] pub footer: Option, + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// 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. @@ -2701,6 +2740,15 @@ pub struct CreateCheckoutSessionShippingOptionsShippingRateData { pub type_: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionSubscriptionDataInvoiceSettings { + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionSubscriptionDataTransferData { /// A non-negative decimal between 0 and 100, with at most two decimal places. @@ -2746,6 +2794,17 @@ pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields { pub value: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions { /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. @@ -2796,7 +2855,7 @@ pub struct CreateCheckoutSessionLineItemsPriceDataRecurring { /// The number of intervals between subscription billings. /// /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). #[serde(skip_serializing_if = "Option::is_none")] pub interval_count: Option, } @@ -2939,6 +2998,17 @@ pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount { >, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior { /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. @@ -4624,6 +4694,40 @@ impl std::default::Default for CheckoutUsBankAccountPaymentMethodOptionsVerifica } } +/// An enum representing the possible values of an `CreateCheckoutSessionAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl CreateCheckoutSessionAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionAutomaticTaxLiabilityType::Account => "account", + CreateCheckoutSessionAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for CreateCheckoutSessionAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement`'s `position` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -4904,6 +5008,40 @@ impl std::default::Default for CreateCheckoutSessionCustomerUpdateShipping { } } +/// An enum representing the possible values of an `CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + Account, + Self_, +} + +impl CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType::Account => "account", + CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType::Self_ => "self", + } + } +} + +impl AsRef for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -7690,6 +7828,40 @@ impl std::default::Default for CreateCheckoutSessionShippingOptionsShippingRateD } } +/// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + Account, + Self_, +} + +impl CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + match self { + CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType::Account => "account", + CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType::Self_ => "self", + } + } +} + +impl AsRef for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionData`'s `proration_behavior` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/connect_account_reference.rs b/src/resources/generated/connect_account_reference.rs new file mode 100644 index 000000000..d7278b120 --- /dev/null +++ b/src/resources/generated/connect_account_reference.rs @@ -0,0 +1,54 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +use crate::params::Expandable; +use crate::resources::Account; + +/// The resource representing a Stripe "ConnectAccountReference". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectAccountReference { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + + /// Type of the account referenced. + #[serde(rename = "type")] + pub type_: ConnectAccountReferenceType, +} + +/// An enum representing the possible values of an `ConnectAccountReference`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum ConnectAccountReferenceType { + Account, + Self_, +} + +impl ConnectAccountReferenceType { + pub fn as_str(self) -> &'static str { + match self { + ConnectAccountReferenceType::Account => "account", + ConnectAccountReferenceType::Self_ => "self", + } + } +} + +impl AsRef for ConnectAccountReferenceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for ConnectAccountReferenceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for ConnectAccountReferenceType { + fn default() -> Self { + Self::Account + } +} diff --git a/src/resources/generated/customer_session.rs b/src/resources/generated/customer_session.rs index 95e71e6cf..13bd934d7 100644 --- a/src/resources/generated/customer_session.rs +++ b/src/resources/generated/customer_session.rs @@ -9,6 +9,8 @@ use crate::resources::{Customer}; use serde::{Deserialize, Serialize}; /// The resource representing a Stripe "CustomerSessionResourceCustomerSession". +/// +/// For more details see #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CustomerSession { @@ -56,11 +58,9 @@ impl Object for CustomerSession { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CustomerSessionResourceComponents { - #[serde(skip_serializing_if = "Option::is_none")] - pub buy_button: Option, + pub buy_button: CustomerSessionResourceComponentsResourceBuyButton, - #[serde(skip_serializing_if = "Option::is_none")] - pub pricing_table: Option, + pub pricing_table: CustomerSessionResourceComponentsResourcePricingTable, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -83,7 +83,7 @@ pub struct CreateCustomerSession<'a> { /// Configuration for each component. /// - /// 1 component must be enabled. + /// Exactly 1 component must be enabled. pub components: CreateCustomerSessionComponents, /// The ID of an existing customer for which to create the customer session. diff --git a/src/resources/generated/invoice.rs b/src/resources/generated/invoice.rs index dd7af7c20..2f5dea1de 100644 --- a/src/resources/generated/invoice.rs +++ b/src/resources/generated/invoice.rs @@ -11,12 +11,12 @@ use crate::params::{ Timestamp, }; use crate::resources::{ - Account, Address, ApiErrors, Application, Charge, Currency, Customer, Discount, - InvoiceLineItem, InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact, - InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini, - InvoicePaymentMethodOptionsUsBankAccount, InvoiceSettingRenderingOptions, InvoicesShippingCost, - PaymentIntent, PaymentMethod, PaymentSource, Quote, Shipping, Subscription, TaxId, TaxRate, - TestHelpersTestClock, + Account, Address, ApiErrors, Application, Charge, ConnectAccountReference, Currency, Customer, + Discount, InvoiceLineItem, InvoicePaymentMethodOptionsAcssDebit, + InvoicePaymentMethodOptionsBancontact, InvoicePaymentMethodOptionsCustomerBalance, + InvoicePaymentMethodOptionsKonbini, InvoicePaymentMethodOptionsUsBankAccount, + InvoiceSettingRenderingOptions, InvoicesShippingCost, PaymentIntent, PaymentMethod, + PaymentSource, Quote, Shipping, Subscription, TaxId, TaxRate, TestHelpersTestClock, }; /// The resource representing a Stripe "Invoice". @@ -268,6 +268,9 @@ pub struct Invoice { #[serde(skip_serializing_if = "Option::is_none")] pub invoice_pdf: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The error encountered during the previous attempt to finalize the invoice. /// /// This field is cleared when the invoice is successfully finalized. @@ -511,6 +514,12 @@ pub struct AutomaticTax { /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. pub enabled: bool, + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, + /// The status of the most recent automated tax calculation for this invoice. pub status: Option, } @@ -812,6 +821,12 @@ pub struct CreateInvoice<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub from_invoice: Option, + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// 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. @@ -902,6 +917,7 @@ impl<'a> CreateInvoice<'a> { expand: Default::default(), footer: Default::default(), from_invoice: Default::default(), + issuer: Default::default(), metadata: Default::default(), on_behalf_of: Default::default(), payment_settings: Default::default(), @@ -999,6 +1015,13 @@ pub struct CreateInvoiceAutomaticTax { /// /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1036,6 +1059,17 @@ pub struct CreateInvoiceFromInvoice { pub invoice: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateInvoiceIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateInvoiceIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoicePaymentSettings { /// ID of the mandate to be used for this invoice. @@ -1118,6 +1152,17 @@ pub struct CreateInvoiceTransferData { pub destination: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateInvoiceAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateInvoiceAutomaticTaxLiabilityType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateInvoicePaymentSettingsPaymentMethodOptions { /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. @@ -1505,6 +1550,40 @@ impl std::default::Default for CollectionMethod { } } +/// An enum representing the possible values of an `CreateInvoiceAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateInvoiceAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl CreateInvoiceAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + CreateInvoiceAutomaticTaxLiabilityType::Account => "account", + CreateInvoiceAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for CreateInvoiceAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateInvoiceAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreateInvoiceFromInvoice`'s `action` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -1537,6 +1616,40 @@ impl std::default::Default for CreateInvoiceFromInvoiceAction { } } +/// An enum representing the possible values of an `CreateInvoiceIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateInvoiceIssuerType { + Account, + Self_, +} + +impl CreateInvoiceIssuerType { + pub fn as_str(self) -> &'static str { + match self { + CreateInvoiceIssuerType::Account => "account", + CreateInvoiceIssuerType::Self_ => "self", + } + } +} + +impl AsRef for CreateInvoiceIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateInvoiceIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -1739,6 +1852,7 @@ impl std::default::Default pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { Any, Automatic, + Challenge, } impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { @@ -1748,6 +1862,9 @@ impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => { "automatic" } + CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Challenge => { + "challenge" + } } } } @@ -2378,6 +2495,7 @@ impl std::default::Default for InvoiceCustomerTaxExempt { pub enum InvoicePaymentMethodOptionsCardRequestThreeDSecure { Any, Automatic, + Challenge, } impl InvoicePaymentMethodOptionsCardRequestThreeDSecure { @@ -2385,6 +2503,7 @@ impl InvoicePaymentMethodOptionsCardRequestThreeDSecure { match self { InvoicePaymentMethodOptionsCardRequestThreeDSecure::Any => "any", InvoicePaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", + InvoicePaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", } } } diff --git a/src/resources/generated/mandate.rs b/src/resources/generated/mandate.rs index 9fae48f1d..ec4a08129 100644 --- a/src/resources/generated/mandate.rs +++ b/src/resources/generated/mandate.rs @@ -156,6 +156,9 @@ pub struct MandateBacsDebit { /// The unique reference identifying the mandate on the Bacs network. pub reference: String, + /// When the mandate is revoked on the Bacs network this field displays the reason for the revocation. + pub revocation_reason: Option, + /// The URL that will contain the mandate that the customer has signed. pub url: String, } @@ -394,6 +397,46 @@ impl std::default::Default for MandateBacsDebitNetworkStatus { } } +/// An enum representing the possible values of an `MandateBacsDebit`'s `revocation_reason` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum MandateBacsDebitRevocationReason { + AccountClosed, + BankAccountRestricted, + BankOwnershipChanged, + CouldNotProcess, + DebitNotAuthorized, +} + +impl MandateBacsDebitRevocationReason { + pub fn as_str(self) -> &'static str { + match self { + MandateBacsDebitRevocationReason::AccountClosed => "account_closed", + MandateBacsDebitRevocationReason::BankAccountRestricted => "bank_account_restricted", + MandateBacsDebitRevocationReason::BankOwnershipChanged => "bank_ownership_changed", + MandateBacsDebitRevocationReason::CouldNotProcess => "could_not_process", + MandateBacsDebitRevocationReason::DebitNotAuthorized => "debit_not_authorized", + } + } +} + +impl AsRef for MandateBacsDebitRevocationReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for MandateBacsDebitRevocationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for MandateBacsDebitRevocationReason { + fn default() -> Self { + Self::AccountClosed + } +} + /// An enum representing the possible values of an `Mandate`'s `status` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs index 80b74a7b1..64d567978 100644 --- a/src/resources/generated/payment_intent.rs +++ b/src/resources/generated/payment_intent.rs @@ -2236,7 +2236,7 @@ pub struct CreatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub promptpay: Option, - /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. + /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub revolut_pay: Option, @@ -2581,7 +2581,7 @@ pub struct UpdatePaymentIntentPaymentMethodOptions { #[serde(skip_serializing_if = "Option::is_none")] pub promptpay: Option, - /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Demo Pay payment method options. + /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. #[serde(skip_serializing_if = "Option::is_none")] pub revolut_pay: Option, @@ -5335,6 +5335,7 @@ pub enum CreatePaymentIntentPaymentMethodDataIdealBank { Knab, Moneyou, N26, + Nn, Rabobank, Regiobank, Revolut, @@ -5355,6 +5356,7 @@ impl CreatePaymentIntentPaymentMethodDataIdealBank { CreatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab", CreatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", CreatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26", + CreatePaymentIntentPaymentMethodDataIdealBank::Nn => "nn", CreatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", CreatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", CreatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut", @@ -11234,6 +11236,7 @@ pub enum UpdatePaymentIntentPaymentMethodDataIdealBank { Knab, Moneyou, N26, + Nn, Rabobank, Regiobank, Revolut, @@ -11254,6 +11257,7 @@ impl UpdatePaymentIntentPaymentMethodDataIdealBank { UpdatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab", UpdatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", UpdatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26", + UpdatePaymentIntentPaymentMethodDataIdealBank::Nn => "nn", UpdatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", UpdatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", UpdatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut", diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs index f0f75562a..6cfa2e234 100644 --- a/src/resources/generated/payment_link.rs +++ b/src/resources/generated/payment_link.rs @@ -8,8 +8,8 @@ use crate::client::{Client, Response}; use crate::ids::PaymentLinkId; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable}; use crate::resources::{ - Account, Application, CheckoutSessionItem, Currency, InvoiceSettingRenderingOptions, - ShippingRate, SubscriptionsTrialsResourceTrialSettings, TaxId, + Account, Application, CheckoutSessionItem, ConnectAccountReference, Currency, + InvoiceSettingRenderingOptions, ShippingRate, SubscriptionsTrialsResourceTrialSettings, TaxId, }; /// The resource representing a Stripe "PaymentLink". @@ -54,7 +54,7 @@ pub struct PaymentLink { /// Collect additional information from your customer using custom fields. /// - /// Up to 2 fields are supported. + /// Up to 3 fields are supported. pub custom_fields: Vec, pub custom_text: PaymentLinksResourceCustomText, @@ -177,6 +177,12 @@ pub struct PaymentLinksResourceAfterCompletion { pub struct PaymentLinksResourceAutomaticTax { /// If `true`, tax will be calculated automatically using the customer's location. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -332,6 +338,11 @@ pub struct PaymentLinksResourceInvoiceSettings { /// Footer to be displayed on the invoice. pub footer: Option, + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + pub issuer: Option, + /// 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. @@ -435,6 +446,8 @@ pub struct PaymentLinksResourceSubscriptionData { /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. pub description: Option, + pub invoice_settings: PaymentLinksResourceSubscriptionDataInvoiceSettings, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. pub metadata: Metadata, @@ -445,6 +458,11 @@ pub struct PaymentLinksResourceSubscriptionData { pub trial_settings: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentLinksResourceSubscriptionDataInvoiceSettings { + pub issuer: ConnectAccountReference, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentLinksResourceTaxIdCollection { /// Indicates whether tax ID collection is enabled for the session. @@ -506,7 +524,7 @@ pub struct CreatePaymentLink<'a> { /// Collect additional information from your customer using custom fields. /// - /// Up to 2 fields are supported. + /// Up to 3 fields are supported. #[serde(skip_serializing_if = "Option::is_none")] pub custom_fields: Option>, @@ -715,7 +733,7 @@ pub struct UpdatePaymentLink<'a> { /// Collect additional information from your customer using custom fields. /// - /// Up to 2 fields are supported. + /// Up to 3 fields are supported. #[serde(skip_serializing_if = "Option::is_none")] pub custom_fields: Option>, @@ -833,6 +851,13 @@ pub struct CreatePaymentLinkAfterCompletion { pub struct CreatePaymentLinkAutomaticTax { /// If `true`, tax will be calculated automatically using the customer's location. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1021,6 +1046,10 @@ pub struct CreatePaymentLinkSubscriptionData { #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. /// /// Unlike object-level metadata, this field is declarative. @@ -1080,6 +1109,13 @@ pub struct UpdatePaymentLinkAfterCompletion { pub struct UpdatePaymentLinkAutomaticTax { /// If `true`, tax will be calculated automatically using the customer's location. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1210,6 +1246,10 @@ pub struct UpdatePaymentLinkShippingAddressCollection { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentLinkSubscriptionData { + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. /// /// Unlike object-level metadata, this field is declarative. @@ -1237,6 +1277,17 @@ pub struct CreatePaymentLinkAfterCompletionRedirect { pub url: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentLinkAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkAutomaticTaxLiabilityType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreement { /// Determines the position and visibility of the payment method reuse agreement in the UI. @@ -1332,6 +1383,12 @@ pub struct CreatePaymentLinkInvoiceCreationInvoiceData { #[serde(skip_serializing_if = "Option::is_none")] pub footer: Option, + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// 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. @@ -1371,6 +1428,15 @@ pub struct CreatePaymentLinkRestrictionsCompletedSessions { pub limit: i64, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentLinkSubscriptionDataInvoiceSettings { + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentLinkSubscriptionDataTrialSettings { /// Defines how the subscription should behave when the user's free trial ends. @@ -1392,6 +1458,17 @@ pub struct UpdatePaymentLinkAfterCompletionRedirect { pub url: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentLinkAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkAutomaticTaxLiabilityType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentLinkCustomFieldsDropdown { /// The options available for the customer to select. @@ -1478,6 +1555,12 @@ pub struct UpdatePaymentLinkInvoiceCreationInvoiceData { #[serde(skip_serializing_if = "Option::is_none")] pub footer: Option, + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// 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. @@ -1517,6 +1600,15 @@ pub struct UpdatePaymentLinkRestrictionsCompletedSessions { pub limit: i64, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentLinkSubscriptionDataInvoiceSettings { + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentLinkSubscriptionDataTrialSettings { /// Defines how the subscription should behave when the user's free trial ends. @@ -1549,6 +1641,17 @@ pub struct CreatePaymentLinkInvoiceCreationInvoiceDataCustomFields { pub value: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentLinkInvoiceCreationInvoiceDataIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. @@ -1561,6 +1664,17 @@ pub struct CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior { /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. @@ -1594,6 +1708,17 @@ pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataCustomFields { pub value: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. @@ -1606,6 +1731,17 @@ pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior { /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. @@ -1647,6 +1783,40 @@ impl std::default::Default for CreatePaymentLinkAfterCompletionType { } } +/// An enum representing the possible values of an `CreatePaymentLinkAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentLinkAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl CreatePaymentLinkAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentLinkAutomaticTaxLiabilityType::Account => "account", + CreatePaymentLinkAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for CreatePaymentLinkAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentLinkAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentLinkAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreement`'s `position` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -1821,6 +1991,40 @@ impl std::default::Default for CreatePaymentLinkCustomFieldsType { } } +/// An enum representing the possible values of an `CreatePaymentLinkInvoiceCreationInvoiceDataIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + Account, + Self_, +} + +impl CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType::Account => "account", + CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType::Self_ => "self", + } + } +} + +impl AsRef for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -2756,6 +2960,40 @@ impl std::default::Default for CreatePaymentLinkShippingAddressCollectionAllowed } } +/// An enum representing the possible values of an `CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + Account, + Self_, +} + +impl CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::Account => "account", + CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::Self_ => "self", + } + } +} + +impl AsRef for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior`'s `missing_payment_method` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -4071,6 +4309,40 @@ impl std::default::Default for UpdatePaymentLinkAfterCompletionType { } } +/// An enum representing the possible values of an `UpdatePaymentLinkAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentLinkAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl UpdatePaymentLinkAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentLinkAutomaticTaxLiabilityType::Account => "account", + UpdatePaymentLinkAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for UpdatePaymentLinkAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentLinkAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentLinkAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `UpdatePaymentLinkCustomFieldsLabel`'s `type` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -4139,6 +4411,40 @@ impl std::default::Default for UpdatePaymentLinkCustomFieldsType { } } +/// An enum representing the possible values of an `UpdatePaymentLinkInvoiceCreationInvoiceDataIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + Account, + Self_, +} + +impl UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType::Account => "account", + UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType::Self_ => "self", + } + } +} + +impl AsRef for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -5004,6 +5310,40 @@ impl std::default::Default for UpdatePaymentLinkShippingAddressCollectionAllowed } } +/// An enum representing the possible values of an `UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + Account, + Self_, +} + +impl UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::Account => "account", + UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::Self_ => "self", + } + } +} + +impl AsRef for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior`'s `missing_payment_method` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/payment_method.rs b/src/resources/generated/payment_method.rs index 6bc17ce14..34db22f67 100644 --- a/src/resources/generated/payment_method.rs +++ b/src/resources/generated/payment_method.rs @@ -567,7 +567,7 @@ pub struct PaymentMethodGrabpay {} pub struct PaymentMethodIdeal { /// The customer's bank, if provided. /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. pub bank: Option, /// The Bank Identifier Code of the customer's bank, if the bank was provided. @@ -1332,9 +1332,13 @@ pub struct UpdatePaymentMethodLink {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentMethodUsBankAccount { - /// Bank account type. + /// Bank account holder type. #[serde(skip_serializing_if = "Option::is_none")] pub account_holder_type: Option, + + /// Bank account type. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1607,6 +1611,7 @@ pub enum CreatePaymentMethodIdealBank { Knab, Moneyou, N26, + Nn, Rabobank, Regiobank, Revolut, @@ -1627,6 +1632,7 @@ impl CreatePaymentMethodIdealBank { CreatePaymentMethodIdealBank::Knab => "knab", CreatePaymentMethodIdealBank::Moneyou => "moneyou", CreatePaymentMethodIdealBank::N26 => "n26", + CreatePaymentMethodIdealBank::Nn => "nn", CreatePaymentMethodIdealBank::Rabobank => "rabobank", CreatePaymentMethodIdealBank::Regiobank => "regiobank", CreatePaymentMethodIdealBank::Revolut => "revolut", @@ -2069,6 +2075,7 @@ pub enum PaymentMethodIdealBank { Knab, Moneyou, N26, + Nn, Rabobank, Regiobank, Revolut, @@ -2089,6 +2096,7 @@ impl PaymentMethodIdealBank { PaymentMethodIdealBank::Knab => "knab", PaymentMethodIdealBank::Moneyou => "moneyou", PaymentMethodIdealBank::N26 => "n26", + PaymentMethodIdealBank::Nn => "nn", PaymentMethodIdealBank::Rabobank => "rabobank", PaymentMethodIdealBank::Regiobank => "regiobank", PaymentMethodIdealBank::Revolut => "revolut", @@ -2139,6 +2147,8 @@ pub enum PaymentMethodIdealBic { Knabnl2h, #[serde(rename = "MOYONL21")] Moyonl21, + #[serde(rename = "NNBANL2G")] + Nnbanl2g, #[serde(rename = "NTSBDEB1")] Ntsbdeb1, #[serde(rename = "RABONL2U")] @@ -2167,6 +2177,7 @@ impl PaymentMethodIdealBic { PaymentMethodIdealBic::Ingbnl2a => "INGBNL2A", PaymentMethodIdealBic::Knabnl2h => "KNABNL2H", PaymentMethodIdealBic::Moyonl21 => "MOYONL21", + PaymentMethodIdealBic::Nnbanl2g => "NNBANL2G", PaymentMethodIdealBic::Ntsbdeb1 => "NTSBDEB1", PaymentMethodIdealBic::Rabonl2u => "RABONL2U", PaymentMethodIdealBic::Rbrbnl21 => "RBRBNL21", @@ -2725,6 +2736,40 @@ impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountHolderType } } +/// An enum representing the possible values of an `UpdatePaymentMethodUsBankAccount`'s `account_type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentMethodUsBankAccountAccountType { + Checking, + Savings, +} + +impl UpdatePaymentMethodUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentMethodUsBankAccountAccountType::Checking => "checking", + UpdatePaymentMethodUsBankAccountAccountType::Savings => "savings", + } + } +} + +impl AsRef for UpdatePaymentMethodUsBankAccountAccountType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountType { + fn default() -> Self { + Self::Checking + } +} + /// An enum representing the possible values of an `UsBankAccountNetworks`'s `supported` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/payment_method_configuration.rs b/src/resources/generated/payment_method_configuration.rs index 82c877991..71fd1b576 100644 --- a/src/resources/generated/payment_method_configuration.rs +++ b/src/resources/generated/payment_method_configuration.rs @@ -60,6 +60,9 @@ pub struct PaymentMethodConfiguration { #[serde(skip_serializing_if = "Option::is_none")] pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub eps: Option, @@ -282,6 +285,13 @@ pub struct CreatePaymentMethodConfiguration<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub cashapp: Option, + /// Uses a customer’s [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. + /// + /// The cash balance can be funded via a bank transfer. + /// Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. /// /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. @@ -450,6 +460,7 @@ impl<'a> CreatePaymentMethodConfiguration<'a> { card: Default::default(), cartes_bancaires: Default::default(), cashapp: Default::default(), + customer_balance: Default::default(), eps: Default::default(), expand: Default::default(), fpx: Default::default(), @@ -596,6 +607,13 @@ pub struct UpdatePaymentMethodConfiguration<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub cashapp: Option, + /// Uses a customer’s [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. + /// + /// The cash balance can be funded via a bank transfer. + /// Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. /// /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. @@ -759,6 +777,7 @@ impl<'a> UpdatePaymentMethodConfiguration<'a> { card: Default::default(), cartes_bancaires: Default::default(), cashapp: Default::default(), + customer_balance: Default::default(), eps: Default::default(), expand: Default::default(), fpx: Default::default(), @@ -889,6 +908,14 @@ pub struct CreatePaymentMethodConfigurationCashapp { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationCustomerBalance { + + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentMethodConfigurationEps { @@ -1153,6 +1180,14 @@ pub struct UpdatePaymentMethodConfigurationCashapp { pub display_preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationCustomerBalance { + + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentMethodConfigurationEps { @@ -1417,6 +1452,14 @@ pub struct CreatePaymentMethodConfigurationCashappDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentMethodConfigurationCustomerBalanceDisplayPreference { + + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentMethodConfigurationEpsDisplayPreference { @@ -1681,6 +1724,14 @@ pub struct UpdatePaymentMethodConfigurationCashappDisplayPreference { pub preference: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreference { + + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentMethodConfigurationEpsDisplayPreference { @@ -2309,6 +2360,42 @@ impl std::default::Default for CreatePaymentMethodConfigurationCashappDisplayPre } } +/// An enum representing the possible values of an `CreatePaymentMethodConfigurationCustomerBalanceDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + None, + Off, + On, +} + +impl CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::None => "none", + CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::Off => "off", + CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `CreatePaymentMethodConfigurationEpsDisplayPreference`'s `preference` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -3567,6 +3654,42 @@ impl std::default::Default for UpdatePaymentMethodConfigurationCashappDisplayPre } } +/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreference`'s `preference` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + None, + Off, + On, +} + +impl UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::None => "none", + UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::Off => "off", + UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::On => "on", + } + } +} + +impl AsRef for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + fn default() -> Self { + Self::None + } +} + /// An enum representing the possible values of an `UpdatePaymentMethodConfigurationEpsDisplayPreference`'s `preference` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/price.rs b/src/resources/generated/price.rs index 2b1ada8d6..eef046fe2 100644 --- a/src/resources/generated/price.rs +++ b/src/resources/generated/price.rs @@ -652,7 +652,7 @@ pub struct CreatePriceRecurring { /// The number of intervals between subscription billings. /// /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). #[serde(skip_serializing_if = "Option::is_none")] pub interval_count: Option, diff --git a/src/resources/generated/product.rs b/src/resources/generated/product.rs index 91d137532..49a6f6e14 100644 --- a/src/resources/generated/product.rs +++ b/src/resources/generated/product.rs @@ -565,7 +565,7 @@ pub struct CreateProductDefaultPriceDataRecurring { /// The number of intervals between subscription billings. /// /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). #[serde(skip_serializing_if = "Option::is_none")] pub interval_count: Option, } diff --git a/src/resources/generated/quote.rs b/src/resources/generated/quote.rs index ce5e8f2fb..e1cca6e89 100644 --- a/src/resources/generated/quote.rs +++ b/src/resources/generated/quote.rs @@ -8,8 +8,9 @@ use crate::client::{Client, Response}; use crate::ids::{CustomerId, QuoteId}; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp}; use crate::resources::{ - Account, Application, CheckoutSessionItem, Currency, Customer, Discount, Invoice, - QuotesResourceTotalDetails, Subscription, SubscriptionSchedule, TaxRate, TestHelpersTestClock, + Account, Application, CheckoutSessionItem, ConnectAccountReference, Currency, Customer, + Discount, Invoice, QuotesResourceTotalDetails, Subscription, SubscriptionSchedule, TaxRate, + TestHelpersTestClock, }; /// The resource representing a Stripe "Quote". @@ -170,6 +171,8 @@ pub struct InvoiceSettingQuoteSetting { /// /// This value will be `null` for quotes where `collection_method=charge_automatically`. pub days_until_due: Option, + + pub issuer: ConnectAccountReference, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -177,6 +180,12 @@ pub struct QuotesResourceAutomaticTax { /// Automatically calculate taxes. pub enabled: bool, + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, + /// The status of the most recent automated tax calculation for this quote. pub status: Option, } diff --git a/src/resources/generated/setup_attempt.rs b/src/resources/generated/setup_attempt.rs index c9f22ae79..3a920a65d 100644 --- a/src/resources/generated/setup_attempt.rs +++ b/src/resources/generated/setup_attempt.rs @@ -293,7 +293,7 @@ pub struct SetupAttemptPaymentMethodDetailsCashapp {} pub struct SetupAttemptPaymentMethodDetailsIdeal { /// The customer's bank. /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. pub bank: Option, /// The Bank Identifier Code of the customer's bank. @@ -563,6 +563,7 @@ pub enum SetupAttemptPaymentMethodDetailsIdealBank { Knab, Moneyou, N26, + Nn, Rabobank, Regiobank, Revolut, @@ -583,6 +584,7 @@ impl SetupAttemptPaymentMethodDetailsIdealBank { SetupAttemptPaymentMethodDetailsIdealBank::Knab => "knab", SetupAttemptPaymentMethodDetailsIdealBank::Moneyou => "moneyou", SetupAttemptPaymentMethodDetailsIdealBank::N26 => "n26", + SetupAttemptPaymentMethodDetailsIdealBank::Nn => "nn", SetupAttemptPaymentMethodDetailsIdealBank::Rabobank => "rabobank", SetupAttemptPaymentMethodDetailsIdealBank::Regiobank => "regiobank", SetupAttemptPaymentMethodDetailsIdealBank::Revolut => "revolut", @@ -633,6 +635,8 @@ pub enum SetupAttemptPaymentMethodDetailsIdealBic { Knabnl2h, #[serde(rename = "MOYONL21")] Moyonl21, + #[serde(rename = "NNBANL2G")] + Nnbanl2g, #[serde(rename = "NTSBDEB1")] Ntsbdeb1, #[serde(rename = "RABONL2U")] @@ -661,6 +665,7 @@ impl SetupAttemptPaymentMethodDetailsIdealBic { SetupAttemptPaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A", SetupAttemptPaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H", SetupAttemptPaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", + SetupAttemptPaymentMethodDetailsIdealBic::Nnbanl2g => "NNBANL2G", SetupAttemptPaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1", SetupAttemptPaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", SetupAttemptPaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs index 47d21f12a..a16f8f224 100644 --- a/src/resources/generated/setup_intent.rs +++ b/src/resources/generated/setup_intent.rs @@ -2533,6 +2533,7 @@ pub enum CreateSetupIntentPaymentMethodDataIdealBank { Knab, Moneyou, N26, + Nn, Rabobank, Regiobank, Revolut, @@ -2553,6 +2554,7 @@ impl CreateSetupIntentPaymentMethodDataIdealBank { CreateSetupIntentPaymentMethodDataIdealBank::Knab => "knab", CreateSetupIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", CreateSetupIntentPaymentMethodDataIdealBank::N26 => "n26", + CreateSetupIntentPaymentMethodDataIdealBank::Nn => "nn", CreateSetupIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", CreateSetupIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", CreateSetupIntentPaymentMethodDataIdealBank::Revolut => "revolut", @@ -4463,6 +4465,7 @@ pub enum UpdateSetupIntentPaymentMethodDataIdealBank { Knab, Moneyou, N26, + Nn, Rabobank, Regiobank, Revolut, @@ -4483,6 +4486,7 @@ impl UpdateSetupIntentPaymentMethodDataIdealBank { UpdateSetupIntentPaymentMethodDataIdealBank::Knab => "knab", UpdateSetupIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", UpdateSetupIntentPaymentMethodDataIdealBank::N26 => "n26", + UpdateSetupIntentPaymentMethodDataIdealBank::Nn => "nn", UpdateSetupIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", UpdateSetupIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", UpdateSetupIntentPaymentMethodDataIdealBank::Revolut => "revolut", diff --git a/src/resources/generated/subscription.rs b/src/resources/generated/subscription.rs index 334c15520..45670e784 100644 --- a/src/resources/generated/subscription.rs +++ b/src/resources/generated/subscription.rs @@ -10,8 +10,8 @@ use crate::params::{ Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, }; use crate::resources::{ - Account, Application, CollectionMethod, Currency, Customer, Discount, Invoice, - InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact, + Account, Application, CollectionMethod, ConnectAccountReference, Currency, Customer, Discount, + Invoice, InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact, InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini, InvoicePaymentMethodOptionsUsBankAccount, PaymentMethod, PaymentSource, Scheduled, SetupIntent, SubscriptionBillingThresholds, SubscriptionItem, SubscriptionItemBillingThresholds, @@ -44,7 +44,6 @@ pub struct Subscription { pub billing_cycle_anchor: Timestamp, /// The fixed values used to calculate the `billing_cycle_anchor`. - #[serde(skip_serializing_if = "Option::is_none")] pub billing_cycle_anchor_config: Option, /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. @@ -298,6 +297,12 @@ pub struct CancellationDetails { pub struct SubscriptionAutomaticTax { /// Whether Stripe automatically computes tax on this subscription. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -559,6 +564,10 @@ pub struct CreateSubscription<'a> { #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// A list of up to 20 subscription items, each with an attached price. #[serde(skip_serializing_if = "Option::is_none")] pub items: Option>, @@ -674,6 +683,7 @@ impl<'a> CreateSubscription<'a> { default_tax_rates: Default::default(), description: Default::default(), expand: Default::default(), + invoice_settings: Default::default(), items: Default::default(), metadata: Default::default(), off_session: Default::default(), @@ -896,6 +906,10 @@ pub struct UpdateSubscription<'a> { #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// A list of up to 20 subscription items, each with an attached price. #[serde(skip_serializing_if = "Option::is_none")] pub items: Option>, @@ -1011,6 +1025,7 @@ impl<'a> UpdateSubscription<'a> { default_tax_rates: Default::default(), description: Default::default(), expand: Default::default(), + invoice_settings: Default::default(), items: Default::default(), metadata: Default::default(), off_session: Default::default(), @@ -1057,6 +1072,13 @@ pub struct AddInvoiceItems { pub struct CreateSubscriptionAutomaticTax { /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1091,6 +1113,15 @@ pub struct CreateSubscriptionBillingCycleAnchorConfig { pub second: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionInvoiceSettings { + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionItems { /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. @@ -1196,6 +1227,13 @@ pub struct ListSubscriptionsAutomaticTax { pub struct UpdateSubscriptionAutomaticTax { /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1209,6 +1247,15 @@ pub struct UpdateSubscriptionCancellationDetails { pub feedback: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionInvoiceSettings { + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionItems { /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. @@ -1332,6 +1379,28 @@ pub struct UpdateSubscriptionTrialSettings { pub end_behavior: UpdateSubscriptionTrialSettingsEndBehavior, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionAutomaticTaxLiabilityType, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionInvoiceSettingsIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionInvoiceSettingsIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionItemsBillingThresholds { /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). @@ -1433,6 +1502,28 @@ pub struct SubscriptionItemPriceData { pub unit_amount_decimal: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionAutomaticTaxLiabilityType, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionInvoiceSettingsIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionInvoiceSettingsIssuerType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptions { /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. @@ -1553,7 +1644,7 @@ pub struct SubscriptionItemPriceDataRecurring { /// The number of intervals between subscription billings. /// /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). #[serde(skip_serializing_if = "Option::is_none")] pub interval_count: Option, } @@ -1850,6 +1941,74 @@ impl std::default::Default for CancellationDetailsReason { } } +/// An enum representing the possible values of an `CreateSubscriptionAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateSubscriptionAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl CreateSubscriptionAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + CreateSubscriptionAutomaticTaxLiabilityType::Account => "account", + CreateSubscriptionAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for CreateSubscriptionAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateSubscriptionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateSubscriptionAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + +/// An enum representing the possible values of an `CreateSubscriptionInvoiceSettingsIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateSubscriptionInvoiceSettingsIssuerType { + Account, + Self_, +} + +impl CreateSubscriptionInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + match self { + CreateSubscriptionInvoiceSettingsIssuerType::Account => "account", + CreateSubscriptionInvoiceSettingsIssuerType::Self_ => "self", + } + } +} + +impl AsRef for CreateSubscriptionInvoiceSettingsIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateSubscriptionInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateSubscriptionInvoiceSettingsIssuerType { + fn default() -> Self { + Self::Account + } +} + /// 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")] @@ -2085,6 +2244,7 @@ impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOpt pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { Any, Automatic, + Challenge, } impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { @@ -2092,6 +2252,7 @@ impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecur match self { CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", + CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", } } } @@ -2671,6 +2832,7 @@ impl std::default::Default for SubscriptionPaymentMethodOptionsCardNetwork { pub enum SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { Any, Automatic, + Challenge, } impl SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { @@ -2678,6 +2840,7 @@ impl SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { match self { SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", + SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", } } } @@ -2993,6 +3156,40 @@ impl std::default::Default for SubscriptionsResourcePaymentSettingsSaveDefaultPa } } +/// An enum representing the possible values of an `UpdateSubscriptionAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdateSubscriptionAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl UpdateSubscriptionAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + UpdateSubscriptionAutomaticTaxLiabilityType::Account => "account", + UpdateSubscriptionAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for UpdateSubscriptionAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdateSubscriptionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdateSubscriptionAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `UpdateSubscriptionCancellationDetails`'s `feedback` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -3039,6 +3236,40 @@ impl std::default::Default for UpdateSubscriptionCancellationDetailsFeedback { } } +/// An enum representing the possible values of an `UpdateSubscriptionInvoiceSettingsIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdateSubscriptionInvoiceSettingsIssuerType { + Account, + Self_, +} + +impl UpdateSubscriptionInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + match self { + UpdateSubscriptionInvoiceSettingsIssuerType::Account => "account", + UpdateSubscriptionInvoiceSettingsIssuerType::Self_ => "self", + } + } +} + +impl AsRef for UpdateSubscriptionInvoiceSettingsIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdateSubscriptionInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdateSubscriptionInvoiceSettingsIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `UpdateSubscriptionPauseCollection`'s `behavior` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -3310,6 +3541,7 @@ impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOpt pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { Any, Automatic, + Challenge, } impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { @@ -3317,6 +3549,7 @@ impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecur match self { UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", } } } diff --git a/src/resources/generated/subscription_item.rs b/src/resources/generated/subscription_item.rs index 9a61c08b1..dd5929829 100644 --- a/src/resources/generated/subscription_item.rs +++ b/src/resources/generated/subscription_item.rs @@ -397,7 +397,7 @@ pub struct SubscriptionItemPriceDataRecurring { /// The number of intervals between subscription billings. /// /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). #[serde(skip_serializing_if = "Option::is_none")] pub interval_count: Option, } diff --git a/src/resources/generated/subscription_schedule.rs b/src/resources/generated/subscription_schedule.rs index 5700fa137..3fdb800f6 100644 --- a/src/resources/generated/subscription_schedule.rs +++ b/src/resources/generated/subscription_schedule.rs @@ -8,9 +8,9 @@ use crate::client::{Client, Response}; use crate::ids::{CustomerId, SubscriptionScheduleId}; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; use crate::resources::{ - Account, Application, CollectionMethod, Coupon, Currency, Customer, PaymentMethod, Plan, Price, - Scheduled, Subscription, SubscriptionBillingThresholds, SubscriptionItemBillingThresholds, - SubscriptionTransferData, TaxRate, TestHelpersTestClock, + Account, Application, CollectionMethod, ConnectAccountReference, Coupon, Currency, Customer, + PaymentMethod, Plan, Price, Scheduled, Subscription, SubscriptionBillingThresholds, + SubscriptionItemBillingThresholds, SubscriptionTransferData, TaxRate, TestHelpersTestClock, }; /// The resource representing a Stripe "SubscriptionSchedule". @@ -238,12 +238,23 @@ pub struct InvoiceSettingSubscriptionSchedulePhaseSetting { /// /// This value will be `null` for subscription schedules where `billing=charge_automatically`. pub days_until_due: Option, + + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + pub issuer: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct SchedulesPhaseAutomaticTax { /// Whether Stripe automatically computes tax on invoices created during this phase. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -339,6 +350,12 @@ pub struct SubscriptionScheduleDefaultSettings { pub struct SubscriptionSchedulesResourceDefaultSettingsAutomaticTax { /// Whether Stripe automatically computes tax on invoices created during this phase. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, } /// The parameters for `SubscriptionSchedule::create`. @@ -883,6 +900,13 @@ pub struct AddInvoiceItems { pub struct CreateSubscriptionSchedulePhasesAutomaticTax { /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -959,6 +983,13 @@ pub struct SubscriptionScheduleBillingThresholds { pub struct SubscriptionScheduleDefaultSettingsParamsAutomaticTax { /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -981,12 +1012,25 @@ pub struct SubscriptionScheduleInvoiceSettings { /// This value will be `null` for subscription schedules where `billing=charge_automatically`. #[serde(skip_serializing_if = "Option::is_none")] pub days_until_due: Option, + + /// The connected account that issues the invoice. + /// + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionSchedulePhasesAutomaticTax { /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. pub enabled: bool, + + /// The account that's liable for tax. + /// + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1046,6 +1090,17 @@ pub struct UpdateSubscriptionSchedulePhasesTransferData { pub destination: String, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateSubscriptionSchedulePhasesAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSubscriptionSchedulePhasesItemsBillingThresholds { /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). @@ -1113,6 +1168,39 @@ pub struct InvoiceItemPriceData { pub unit_amount_decimal: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SubscriptionScheduleInvoiceSettingsIssuer { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: SubscriptionScheduleInvoiceSettingsIssuerType, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdateSubscriptionSchedulePhasesAutomaticTaxLiability { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdateSubscriptionSchedulePhasesItemsBillingThresholds { /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). @@ -1161,7 +1249,7 @@ pub struct CreateSubscriptionSchedulePhasesItemsPriceDataRecurring { /// The number of intervals between subscription billings. /// /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). #[serde(skip_serializing_if = "Option::is_none")] pub interval_count: Option, } @@ -1176,11 +1264,45 @@ pub struct UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring { /// The number of intervals between subscription billings. /// /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). #[serde(skip_serializing_if = "Option::is_none")] pub interval_count: Option, } +/// An enum representing the possible values of an `CreateSubscriptionSchedulePhasesAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::Account => "account", + CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `CreateSubscriptionSchedulePhases`'s `billing_cycle_anchor` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -1431,6 +1553,42 @@ impl std::default::Default for SubscriptionScheduleDefaultSettingsCollectionMeth } } +/// An enum representing the possible values of an `SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType::Account => { + "account" + } + SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `SubscriptionScheduleDefaultSettingsParams`'s `billing_cycle_anchor` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -1505,6 +1663,40 @@ impl std::default::Default for SubscriptionScheduleEndBehavior { } } +/// An enum representing the possible values of an `SubscriptionScheduleInvoiceSettingsIssuer`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum SubscriptionScheduleInvoiceSettingsIssuerType { + Account, + Self_, +} + +impl SubscriptionScheduleInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + match self { + SubscriptionScheduleInvoiceSettingsIssuerType::Account => "account", + SubscriptionScheduleInvoiceSettingsIssuerType::Self_ => "self", + } + } +} + +impl AsRef for SubscriptionScheduleInvoiceSettingsIssuerType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for SubscriptionScheduleInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for SubscriptionScheduleInvoiceSettingsIssuerType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `SubscriptionSchedulePhaseConfiguration`'s `billing_cycle_anchor` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -1579,6 +1771,40 @@ impl std::default::Default for SubscriptionScheduleStatus { } } +/// An enum representing the possible values of an `UpdateSubscriptionSchedulePhasesAutomaticTaxLiability`'s `type` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + Account, + Self_, +} + +impl UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + match self { + UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::Account => "account", + UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::Self_ => "self", + } + } +} + +impl AsRef for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn default() -> Self { + Self::Account + } +} + /// An enum representing the possible values of an `UpdateSubscriptionSchedulePhases`'s `billing_cycle_anchor` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")]