From 90270a4a1adbef80defa572f3161af5517fbab23 Mon Sep 17 00:00:00 2001 From: arlyon Date: Fri, 21 Jul 2023 00:26:00 +0000 Subject: [PATCH] Generate latest changes from OpenApi spec --- openapi/version.json | 2 +- src/resources/generated/api_errors.rs | 2 + src/resources/generated/balance.rs | 2 +- src/resources/generated/charge.rs | 3 + src/resources/generated/checkout_session.rs | 12 +- src/resources/generated/customer.rs | 4 +- .../customer_cash_balance_transaction.rs | 1 - src/resources/generated/invoice.rs | 4 +- .../generated/invoices_shipping_cost.rs | 8 - src/resources/generated/item.rs | 8 - src/resources/generated/payment_intent.rs | 84 ++++++++++ .../quotes_resource_total_details.rs | 8 - src/resources/generated/setup_intent.rs | 89 +++++++++++ src/resources/generated/tax_calculation.rs | 14 +- .../generated/tax_calculation_line_item.rs | 10 +- src/resources/generated/tax_id.rs | 4 +- .../tax_product_resource_customer_details.rs | 4 +- src/resources/generated/tax_rate.rs | 2 + src/resources/generated/tax_settings.rs | 150 ++++++++++++++++++ src/resources/generated/tax_transaction.rs | 8 +- .../generated/tax_transaction_line_item.rs | 3 + src/resources/generated/webhook_endpoint.rs | 3 + 22 files changed, 378 insertions(+), 47 deletions(-) create mode 100644 src/resources/generated/tax_settings.rs diff --git a/openapi/version.json b/openapi/version.json index 8c0816acc..d25911e26 100644 --- a/openapi/version.json +++ b/openapi/version.json @@ -1,3 +1,3 @@ { - "version": "v409" + "version": "v425" } \ No newline at end of file diff --git a/src/resources/generated/api_errors.rs b/src/resources/generated/api_errors.rs index ed3ad5ba1..6ab81205d 100644 --- a/src/resources/generated/api_errors.rs +++ b/src/resources/generated/api_errors.rs @@ -134,6 +134,7 @@ pub enum ApiErrorsCode { InvalidExpiryYear, InvalidNumber, InvalidSourceUsage, + InvalidTaxLocation, InvoiceNoCustomerLineItems, InvoiceNoPaymentMethodTypes, InvoiceNoSubscriptionLineItems, @@ -298,6 +299,7 @@ impl ApiErrorsCode { ApiErrorsCode::InvalidExpiryYear => "invalid_expiry_year", ApiErrorsCode::InvalidNumber => "invalid_number", ApiErrorsCode::InvalidSourceUsage => "invalid_source_usage", + ApiErrorsCode::InvalidTaxLocation => "invalid_tax_location", ApiErrorsCode::InvoiceNoCustomerLineItems => "invoice_no_customer_line_items", ApiErrorsCode::InvoiceNoPaymentMethodTypes => "invoice_no_payment_method_types", ApiErrorsCode::InvoiceNoSubscriptionLineItems => "invoice_no_subscription_line_items", diff --git a/src/resources/generated/balance.rs b/src/resources/generated/balance.rs index 485ce8d42..8dae5e112 100644 --- a/src/resources/generated/balance.rs +++ b/src/resources/generated/balance.rs @@ -33,7 +33,7 @@ pub struct Balance { /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. pub livemode: bool, - /// Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. + /// Funds that are not yet available in the balance. /// /// The pending balance for each currency, and for each payment type, can be found in the `source_types` property. pub pending: Vec, diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs index aa256b017..8e2739394 100644 --- a/src/resources/generated/charge.rs +++ b/src/resources/generated/charge.rs @@ -588,6 +588,9 @@ pub struct PaymentMethodDetailsAffirm {} #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentMethodDetailsAfterpayClearpay { + /// The Afterpay order ID associated with this payment intent. + pub order_id: Option, + /// Order identifier shown to the merchant in Afterpay’s online portal. pub reference: Option, } diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs index b117bbef7..8d2e3dfef 100644 --- a/src/resources/generated/checkout_session.rs +++ b/src/resources/generated/checkout_session.rs @@ -1005,7 +1005,7 @@ pub struct PaymentPagesCheckoutSessionShippingOption { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentPagesCheckoutSessionTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. #[serde(rename = "type")] pub type_: PaymentPagesCheckoutSessionTaxIdType, @@ -7354,8 +7354,6 @@ impl std::default::Default #[serde(rename_all = "snake_case")] pub enum LineItemsTaxAmountTaxabilityReason { CustomerExempt, - ExcludedTerritory, - JurisdictionUnsupported, NotCollecting, NotSubjectToTax, NotSupported, @@ -7369,7 +7367,6 @@ pub enum LineItemsTaxAmountTaxabilityReason { ReverseCharge, StandardRated, TaxableBasisReduced, - VatExempt, ZeroRated, } @@ -7377,10 +7374,6 @@ impl LineItemsTaxAmountTaxabilityReason { pub fn as_str(self) -> &'static str { match self { LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::ExcludedTerritory => "excluded_territory", - LineItemsTaxAmountTaxabilityReason::JurisdictionUnsupported => { - "jurisdiction_unsupported" - } LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", @@ -7394,7 +7387,6 @@ impl LineItemsTaxAmountTaxabilityReason { LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::VatExempt => "vat_exempt", LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", } } @@ -8488,6 +8480,7 @@ pub enum PaymentPagesCheckoutSessionTaxIdType { NzGst, PeRuc, PhTin, + RoTin, RsPib, RuInn, RuKpp, @@ -8559,6 +8552,7 @@ impl PaymentPagesCheckoutSessionTaxIdType { PaymentPagesCheckoutSessionTaxIdType::NzGst => "nz_gst", PaymentPagesCheckoutSessionTaxIdType::PeRuc => "pe_ruc", PaymentPagesCheckoutSessionTaxIdType::PhTin => "ph_tin", + PaymentPagesCheckoutSessionTaxIdType::RoTin => "ro_tin", PaymentPagesCheckoutSessionTaxIdType::RsPib => "rs_pib", PaymentPagesCheckoutSessionTaxIdType::RuInn => "ru_inn", PaymentPagesCheckoutSessionTaxIdType::RuKpp => "ru_kpp", diff --git a/src/resources/generated/customer.rs b/src/resources/generated/customer.rs index 38471be58..28b32b713 100644 --- a/src/resources/generated/customer.rs +++ b/src/resources/generated/customer.rs @@ -657,7 +657,7 @@ pub struct CustomerInvoiceSettings { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TaxIdData { - /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. #[serde(rename = "type")] pub type_: TaxIdType, @@ -1068,6 +1068,7 @@ pub enum TaxIdType { NzGst, PeRuc, PhTin, + RoTin, RsPib, RuInn, RuKpp, @@ -1138,6 +1139,7 @@ impl TaxIdType { TaxIdType::NzGst => "nz_gst", TaxIdType::PeRuc => "pe_ruc", TaxIdType::PhTin => "ph_tin", + TaxIdType::RoTin => "ro_tin", TaxIdType::RsPib => "rs_pib", TaxIdType::RuInn => "ru_inn", TaxIdType::RuKpp => "ru_kpp", diff --git a/src/resources/generated/customer_cash_balance_transaction.rs b/src/resources/generated/customer_cash_balance_transaction.rs index dc2108245..260503566 100644 --- a/src/resources/generated/customer_cash_balance_transaction.rs +++ b/src/resources/generated/customer_cash_balance_transaction.rs @@ -52,7 +52,6 @@ pub struct CustomerCashBalanceTransaction { /// The type of the cash balance transaction. /// - /// One of `applied_to_payment`, `unapplied_from_payment`, `refunded_from_payment`, `funded`, `return_initiated`, or `return_canceled`. /// New types may be added in future. /// See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. #[serde(rename = "type")] diff --git a/src/resources/generated/invoice.rs b/src/resources/generated/invoice.rs index 8e52a83e2..8ad805b8e 100644 --- a/src/resources/generated/invoice.rs +++ b/src/resources/generated/invoice.rs @@ -641,7 +641,7 @@ pub struct InvoiceInstallmentsCard { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct InvoicesResourceInvoiceTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. #[serde(rename = "type")] pub type_: TaxIdType, @@ -2488,6 +2488,7 @@ pub enum TaxIdType { NzGst, PeRuc, PhTin, + RoTin, RsPib, RuInn, RuKpp, @@ -2559,6 +2560,7 @@ impl TaxIdType { TaxIdType::NzGst => "nz_gst", TaxIdType::PeRuc => "pe_ruc", TaxIdType::PhTin => "ph_tin", + TaxIdType::RoTin => "ro_tin", TaxIdType::RsPib => "rs_pib", TaxIdType::RuInn => "ru_inn", TaxIdType::RuKpp => "ru_kpp", diff --git a/src/resources/generated/invoices_shipping_cost.rs b/src/resources/generated/invoices_shipping_cost.rs index c0089b27d..6877b6e66 100644 --- a/src/resources/generated/invoices_shipping_cost.rs +++ b/src/resources/generated/invoices_shipping_cost.rs @@ -50,8 +50,6 @@ pub struct LineItemsTaxAmount { #[serde(rename_all = "snake_case")] pub enum LineItemsTaxAmountTaxabilityReason { CustomerExempt, - ExcludedTerritory, - JurisdictionUnsupported, NotCollecting, NotSubjectToTax, NotSupported, @@ -65,7 +63,6 @@ pub enum LineItemsTaxAmountTaxabilityReason { ReverseCharge, StandardRated, TaxableBasisReduced, - VatExempt, ZeroRated, } @@ -73,10 +70,6 @@ impl LineItemsTaxAmountTaxabilityReason { pub fn as_str(self) -> &'static str { match self { LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::ExcludedTerritory => "excluded_territory", - LineItemsTaxAmountTaxabilityReason::JurisdictionUnsupported => { - "jurisdiction_unsupported" - } LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", @@ -90,7 +83,6 @@ impl LineItemsTaxAmountTaxabilityReason { LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::VatExempt => "vat_exempt", LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", } } diff --git a/src/resources/generated/item.rs b/src/resources/generated/item.rs index 4eb8c410c..d507fd3c5 100644 --- a/src/resources/generated/item.rs +++ b/src/resources/generated/item.rs @@ -95,8 +95,6 @@ pub struct LineItemsTaxAmount { #[serde(rename_all = "snake_case")] pub enum LineItemsTaxAmountTaxabilityReason { CustomerExempt, - ExcludedTerritory, - JurisdictionUnsupported, NotCollecting, NotSubjectToTax, NotSupported, @@ -110,7 +108,6 @@ pub enum LineItemsTaxAmountTaxabilityReason { ReverseCharge, StandardRated, TaxableBasisReduced, - VatExempt, ZeroRated, } @@ -118,10 +115,6 @@ impl LineItemsTaxAmountTaxabilityReason { pub fn as_str(self) -> &'static str { match self { LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::ExcludedTerritory => "excluded_territory", - LineItemsTaxAmountTaxabilityReason::JurisdictionUnsupported => { - "jurisdiction_unsupported" - } LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", @@ -135,7 +128,6 @@ impl LineItemsTaxAmountTaxabilityReason { LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::VatExempt => "vat_exempt", LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", } } diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs index 4822bc414..1a2642215 100644 --- a/src/resources/generated/payment_intent.rs +++ b/src/resources/generated/payment_intent.rs @@ -257,6 +257,14 @@ pub struct PaymentFlowsAmountDetailsResourceTip { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentFlowsAutomaticPaymentMethodsPaymentIntent { + /// Controls whether this PaymentIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// + /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Automatically calculates compatible payment methods. pub enabled: bool, } @@ -1861,6 +1869,14 @@ impl<'a> UpdatePaymentIntent<'a> { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentIntentAutomaticPaymentMethods { + /// Controls whether this PaymentIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// + /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Whether this feature is enabled. pub enabled: bool, } @@ -4644,6 +4660,40 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuB pub country: String, } +/// An enum representing the possible values of an `CreatePaymentIntentAutomaticPaymentMethods`'s `allow_redirects` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + Always, + Never, +} + +impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::Always => "always", + CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::Never => "never", + } + } +} + +impl AsRef for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn default() -> Self { + Self::Always + } +} + /// An enum representing the possible values of an `CreatePaymentIntentMandateDataCustomerAcceptance`'s `type` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -7619,6 +7669,40 @@ impl std::default::Default for FundingInstructionsBankTransferFinancialAddressTy } } +/// An enum representing the possible values of an `PaymentFlowsAutomaticPaymentMethodsPaymentIntent`'s `allow_redirects` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + Always, + Never, +} + +impl PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + pub fn as_str(self) -> &'static str { + match self { + PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::Always => "always", + PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::Never => "never", + } + } +} + +impl AsRef for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn default() -> Self { + Self::Always + } +} + /// An enum representing the possible values of an `PaymentIntent`'s `cancellation_reason` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/quotes_resource_total_details.rs b/src/resources/generated/quotes_resource_total_details.rs index 55bdd68a4..87b015146 100644 --- a/src/resources/generated/quotes_resource_total_details.rs +++ b/src/resources/generated/quotes_resource_total_details.rs @@ -60,8 +60,6 @@ pub struct LineItemsTaxAmount { #[serde(rename_all = "snake_case")] pub enum LineItemsTaxAmountTaxabilityReason { CustomerExempt, - ExcludedTerritory, - JurisdictionUnsupported, NotCollecting, NotSubjectToTax, NotSupported, @@ -75,7 +73,6 @@ pub enum LineItemsTaxAmountTaxabilityReason { ReverseCharge, StandardRated, TaxableBasisReduced, - VatExempt, ZeroRated, } @@ -83,10 +80,6 @@ impl LineItemsTaxAmountTaxabilityReason { pub fn as_str(self) -> &'static str { match self { LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::ExcludedTerritory => "excluded_territory", - LineItemsTaxAmountTaxabilityReason::JurisdictionUnsupported => { - "jurisdiction_unsupported" - } LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", @@ -100,7 +93,6 @@ impl LineItemsTaxAmountTaxabilityReason { LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::VatExempt => "vat_exempt", LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", } } diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs index dea2c9538..377e6b828 100644 --- a/src/resources/generated/setup_intent.rs +++ b/src/resources/generated/setup_intent.rs @@ -164,6 +164,14 @@ impl Object for SetupIntent { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentFlowsAutomaticPaymentMethodsSetupIntent { + /// Controls whether this SetupIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// + /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Automatically calculates compatible payment methods. pub enabled: Option, } @@ -496,6 +504,10 @@ pub struct CreateSetupIntent<'a> { /// If this hash is populated, this SetupIntent will generate a single_use Mandate on success. #[serde(skip_serializing_if = "Option::is_none")] pub single_use: Option, + + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, } impl<'a> CreateSetupIntent<'a> { @@ -517,6 +529,7 @@ impl<'a> CreateSetupIntent<'a> { payment_method_types: Default::default(), return_url: Default::default(), single_use: Default::default(), + use_stripe_sdk: Default::default(), } } } @@ -677,6 +690,14 @@ impl<'a> UpdateSetupIntent<'a> { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreateSetupIntentAutomaticPaymentMethods { + /// Controls whether this SetupIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// + /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Whether this feature is enabled. pub enabled: bool, } @@ -2003,6 +2024,40 @@ pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks { pub requested: Option>, } +/// An enum representing the possible values of an `CreateSetupIntentAutomaticPaymentMethods`'s `allow_redirects` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + Always, + Never, +} + +impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + pub fn as_str(self) -> &'static str { + match self { + CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::Always => "always", + CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::Never => "never", + } + } +} + +impl AsRef for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn default() -> Self { + Self::Always + } +} + /// An enum representing the possible values of an `CreateSetupIntent`'s `flow_directions` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -3113,6 +3168,40 @@ impl std::default::Default } } +/// An enum representing the possible values of an `PaymentFlowsAutomaticPaymentMethodsSetupIntent`'s `allow_redirects` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + Always, + Never, +} + +impl PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + pub fn as_str(self) -> &'static str { + match self { + PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::Always => "always", + PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::Never => "never", + } + } +} + +impl AsRef for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn default() -> Self { + Self::Always + } +} + /// An enum representing the possible values of an `SetupIntent`'s `cancellation_reason` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] diff --git a/src/resources/generated/tax_calculation.rs b/src/resources/generated/tax_calculation.rs index 04b4c79de..9223d376e 100644 --- a/src/resources/generated/tax_calculation.rs +++ b/src/resources/generated/tax_calculation.rs @@ -347,6 +347,8 @@ impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityR #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { + AmusementTax, + CommunicationsTax, Gst, Hst, Igst, @@ -362,6 +364,10 @@ pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { impl TaxProductResourceLineItemTaxRateDetailsTaxType { pub fn as_str(self) -> &'static str { match self { + TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", + TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => { + "communications_tax" + } TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", @@ -389,7 +395,7 @@ impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { } impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { fn default() -> Self { - Self::Gst + Self::AmusementTax } } @@ -503,6 +509,8 @@ impl std::default::Default for TaxProductResourceTaxCalculationShippingCostTaxBe #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] pub enum TaxProductResourceTaxRateDetailsTaxType { + AmusementTax, + CommunicationsTax, Gst, Hst, Igst, @@ -518,6 +526,8 @@ pub enum TaxProductResourceTaxRateDetailsTaxType { impl TaxProductResourceTaxRateDetailsTaxType { pub fn as_str(self) -> &'static str { match self { + TaxProductResourceTaxRateDetailsTaxType::AmusementTax => "amusement_tax", + TaxProductResourceTaxRateDetailsTaxType::CommunicationsTax => "communications_tax", TaxProductResourceTaxRateDetailsTaxType::Gst => "gst", TaxProductResourceTaxRateDetailsTaxType::Hst => "hst", TaxProductResourceTaxRateDetailsTaxType::Igst => "igst", @@ -545,6 +555,6 @@ impl std::fmt::Display for TaxProductResourceTaxRateDetailsTaxType { } impl std::default::Default for TaxProductResourceTaxRateDetailsTaxType { fn default() -> Self { - Self::Gst + Self::AmusementTax } } diff --git a/src/resources/generated/tax_calculation_line_item.rs b/src/resources/generated/tax_calculation_line_item.rs index acf4f5a10..f8135e39d 100644 --- a/src/resources/generated/tax_calculation_line_item.rs +++ b/src/resources/generated/tax_calculation_line_item.rs @@ -25,7 +25,7 @@ pub struct TaxCalculationLineItem { /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. pub livemode: bool, - /// A Product ID. + /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). pub product: Option, /// The number of units of the item being purchased. @@ -311,6 +311,8 @@ impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityR #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { + AmusementTax, + CommunicationsTax, Gst, Hst, Igst, @@ -326,6 +328,10 @@ pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { impl TaxProductResourceLineItemTaxRateDetailsTaxType { pub fn as_str(self) -> &'static str { match self { + TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", + TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => { + "communications_tax" + } TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", @@ -353,6 +359,6 @@ impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { } impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { fn default() -> Self { - Self::Gst + Self::AmusementTax } } diff --git a/src/resources/generated/tax_id.rs b/src/resources/generated/tax_id.rs index f6171e807..2ebb701bb 100644 --- a/src/resources/generated/tax_id.rs +++ b/src/resources/generated/tax_id.rs @@ -38,7 +38,7 @@ pub struct TaxId { #[serde(skip_serializing_if = "Option::is_none")] pub livemode: Option, - /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. /// /// Note that some legacy tax IDs have type `unknown`. #[serde(rename = "type")] @@ -128,6 +128,7 @@ pub enum TaxIdType { NzGst, PeRuc, PhTin, + RoTin, RsPib, RuInn, RuKpp, @@ -199,6 +200,7 @@ impl TaxIdType { TaxIdType::NzGst => "nz_gst", TaxIdType::PeRuc => "pe_ruc", TaxIdType::PhTin => "ph_tin", + TaxIdType::RoTin => "ro_tin", TaxIdType::RsPib => "rs_pib", TaxIdType::RuInn => "ru_inn", TaxIdType::RuKpp => "ru_kpp", diff --git a/src/resources/generated/tax_product_resource_customer_details.rs b/src/resources/generated/tax_product_resource_customer_details.rs index 41b7d01da..e44865f70 100644 --- a/src/resources/generated/tax_product_resource_customer_details.rs +++ b/src/resources/generated/tax_product_resource_customer_details.rs @@ -25,7 +25,7 @@ pub struct TaxProductResourceCustomerDetails { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct TaxProductResourceCustomerDetailsResourceTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. #[serde(rename = "type")] pub type_: TaxProductResourceCustomerDetailsResourceTaxIdType, @@ -142,6 +142,7 @@ pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { NzGst, PeRuc, PhTin, + RoTin, RsPib, RuInn, RuKpp, @@ -213,6 +214,7 @@ impl TaxProductResourceCustomerDetailsResourceTaxIdType { TaxProductResourceCustomerDetailsResourceTaxIdType::NzGst => "nz_gst", TaxProductResourceCustomerDetailsResourceTaxIdType::PeRuc => "pe_ruc", TaxProductResourceCustomerDetailsResourceTaxIdType::PhTin => "ph_tin", + TaxProductResourceCustomerDetailsResourceTaxIdType::RoTin => "ro_tin", TaxProductResourceCustomerDetailsResourceTaxIdType::RsPib => "rs_pib", TaxProductResourceCustomerDetailsResourceTaxIdType::RuInn => "ru_inn", TaxProductResourceCustomerDetailsResourceTaxIdType::RuKpp => "ru_kpp", diff --git a/src/resources/generated/tax_rate.rs b/src/resources/generated/tax_rate.rs index 3cb8aed06..110a924ea 100644 --- a/src/resources/generated/tax_rate.rs +++ b/src/resources/generated/tax_rate.rs @@ -326,6 +326,7 @@ pub enum TaxRateTaxType { Qst, Rst, SalesTax, + ServiceTax, Vat, } @@ -343,6 +344,7 @@ impl TaxRateTaxType { TaxRateTaxType::Qst => "qst", TaxRateTaxType::Rst => "rst", TaxRateTaxType::SalesTax => "sales_tax", + TaxRateTaxType::ServiceTax => "service_tax", TaxRateTaxType::Vat => "vat", } } diff --git a/src/resources/generated/tax_settings.rs b/src/resources/generated/tax_settings.rs new file mode 100644 index 000000000..be6357b5d --- /dev/null +++ b/src/resources/generated/tax_settings.rs @@ -0,0 +1,150 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use crate::params::{Object}; +use crate::resources::{Address}; +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "TaxProductResourceTaxSettings". +/// +/// For more details see +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxSettings { + + pub defaults: TaxProductResourceTaxSettingsDefaults, + + /// The place where your business is located. + pub head_office: Option, + + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + + /// The `active` status indicates you have all required settings to calculate tax. + /// + /// A status can transition out of `active` when new required settings are introduced. + pub status: TaxSettingsStatus, + + pub status_details: TaxProductResourceTaxSettingsStatusDetails, +} + +impl Object for TaxSettings { + type Id = (); + fn id(&self) -> Self::Id {} + fn object(&self) -> &'static str { + "tax.settings" + } +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxSettingsDefaults { + + /// Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. + /// + /// If the item's price has a tax behavior set, it will take precedence over the default tax behavior. + pub tax_behavior: Option, + + /// Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices. + pub tax_code: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxSettingsHeadOffice { + + pub address: Address, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxSettingsStatusDetails { + + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pending: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxSettingsStatusDetailsResourceActive { +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct TaxProductResourceTaxSettingsStatusDetailsResourcePending { + + /// The list of missing fields that are required to perform calculations. + /// + /// It includes the entry `head_office` when the status is `pending`. + /// It is recommended to set the optional values even if they aren't listed as required for calculating taxes. + /// Calculations can fail if missing fields aren't explicitly provided on every call. + pub missing_fields: Option>, +} + +/// An enum representing the possible values of an `TaxProductResourceTaxSettingsDefaults`'s `tax_behavior` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxProductResourceTaxSettingsDefaultsTaxBehavior { + Exclusive, + Inclusive, + InferredByCurrency, +} + +impl TaxProductResourceTaxSettingsDefaultsTaxBehavior { + pub fn as_str(self) -> &'static str { + match self { + TaxProductResourceTaxSettingsDefaultsTaxBehavior::Exclusive => "exclusive", + TaxProductResourceTaxSettingsDefaultsTaxBehavior::Inclusive => "inclusive", + TaxProductResourceTaxSettingsDefaultsTaxBehavior::InferredByCurrency => "inferred_by_currency", + } + } +} + +impl AsRef for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn default() -> Self { + Self::Exclusive + } +} + +/// An enum representing the possible values of an `TaxSettings`'s `status` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum TaxSettingsStatus { + Active, + Pending, +} + +impl TaxSettingsStatus { + pub fn as_str(self) -> &'static str { + match self { + TaxSettingsStatus::Active => "active", + TaxSettingsStatus::Pending => "pending", + } + } +} + +impl AsRef for TaxSettingsStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for TaxSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for TaxSettingsStatus { + fn default() -> Self { + Self::Active + } +} diff --git a/src/resources/generated/tax_transaction.rs b/src/resources/generated/tax_transaction.rs index e72ace371..b8a56578c 100644 --- a/src/resources/generated/tax_transaction.rs +++ b/src/resources/generated/tax_transaction.rs @@ -88,8 +88,6 @@ pub struct TaxProductResourceTaxTransactionShippingCost { pub amount_tax: i64, /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). - /// - /// (It is not populated for the transaction resource object and will be removed in the next API version.). #[serde(skip_serializing_if = "Option::is_none")] pub shipping_rate: Option, @@ -306,6 +304,8 @@ impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityR #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { + AmusementTax, + CommunicationsTax, Gst, Hst, Igst, @@ -321,6 +321,8 @@ pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { impl TaxProductResourceLineItemTaxRateDetailsTaxType { pub fn as_str(self) -> &'static str { match self { + TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", + TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => "communications_tax", TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", @@ -348,7 +350,7 @@ impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { } impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { fn default() -> Self { - Self::Gst + Self::AmusementTax } } diff --git a/src/resources/generated/tax_transaction_line_item.rs b/src/resources/generated/tax_transaction_line_item.rs index a9a47e0e3..ce0858997 100644 --- a/src/resources/generated/tax_transaction_line_item.rs +++ b/src/resources/generated/tax_transaction_line_item.rs @@ -29,6 +29,9 @@ pub struct TaxTransactionLineItem { /// This can be useful for storing additional information about the object in a structured format. pub metadata: Metadata, + /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). + pub product: Option, + /// The number of units of the item being purchased. /// /// For reversals, this is the quantity reversed. diff --git a/src/resources/generated/webhook_endpoint.rs b/src/resources/generated/webhook_endpoint.rs index ec11fd825..10bf90b40 100644 --- a/src/resources/generated/webhook_endpoint.rs +++ b/src/resources/generated/webhook_endpoint.rs @@ -629,6 +629,8 @@ pub enum EventFilter { SubscriptionScheduleReleased, #[serde(rename = "subscription_schedule.updated")] SubscriptionScheduleUpdated, + #[serde(rename = "tax.settings.updated")] + TaxSettingsUpdated, #[serde(rename = "tax_rate.created")] TaxRateCreated, #[serde(rename = "tax_rate.updated")] @@ -942,6 +944,7 @@ impl EventFilter { EventFilter::SubscriptionScheduleExpiring => "subscription_schedule.expiring", EventFilter::SubscriptionScheduleReleased => "subscription_schedule.released", EventFilter::SubscriptionScheduleUpdated => "subscription_schedule.updated", + EventFilter::TaxSettingsUpdated => "tax.settings.updated", EventFilter::TaxRateCreated => "tax_rate.created", EventFilter::TaxRateUpdated => "tax_rate.updated", EventFilter::TerminalReaderActionFailed => "terminal.reader.action_failed",