From 4c256490d60e8d1e158f8f6ed7300a766c1f449d Mon Sep 17 00:00:00 2001 From: arlyon Date: Fri, 8 Dec 2023 00:23:34 +0000 Subject: [PATCH 1/2] feat: generate latest changes from OpenApi spec --- openapi/version.json | 2 +- src/resources/generated/account_session.rs | 152 +++++++++++++ src/resources/generated/api_errors.rs | 6 + src/resources/generated/climate_product.rs | 3 +- src/resources/generated/climate_supplier.rs | 2 - .../connect_embedded_base_features.rs | 10 + src/resources/generated/payment_intent.rs | 15 +- src/resources/generated/payment_link.rs | 202 +++++++++++++++++- src/resources/generated/price.rs | 2 - src/resources/generated/setup_intent.rs | 9 +- src/resources/generated/subscription.rs | 52 +---- ...riptions_trials_resource_trial_settings.rs | 55 +++++ 12 files changed, 434 insertions(+), 76 deletions(-) create mode 100644 src/resources/generated/connect_embedded_base_features.rs create mode 100644 src/resources/generated/subscriptions_trials_resource_trial_settings.rs diff --git a/openapi/version.json b/openapi/version.json index 4c02c170b..370745136 100644 --- a/openapi/version.json +++ b/openapi/version.json @@ -1,3 +1,3 @@ { - "version": "v692" + "version": "v706" } \ No newline at end of file diff --git a/src/resources/generated/account_session.rs b/src/resources/generated/account_session.rs index d6f03a17e..81fd874f4 100644 --- a/src/resources/generated/account_session.rs +++ b/src/resources/generated/account_session.rs @@ -5,6 +5,7 @@ use crate::client::{Client, Response}; use crate::ids::{AccountId}; use crate::params::{Expand, Object, Timestamp}; +use crate::resources::{ConnectEmbeddedBaseFeatures}; use serde::{Deserialize, Serialize}; /// The resource representing a Stripe "ConnectEmbeddedMethodAccountSessionCreateMethodAccountSession". @@ -52,6 +53,25 @@ impl Object for AccountSession { pub struct ConnectEmbeddedAccountSessionCreateComponents { pub account_onboarding: ConnectEmbeddedBaseConfigClaim, + + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_details: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub payments: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectEmbeddedBaseConfig { + + /// Whether the embedded component is enabled. + pub enabled: bool, + + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -59,6 +79,37 @@ pub struct ConnectEmbeddedBaseConfigClaim { /// Whether the embedded component is enabled. pub enabled: bool, + + pub features: ConnectEmbeddedBaseFeatures, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectEmbeddedPaymentsConfig { + + /// Whether the embedded component is enabled. + pub enabled: bool, + + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectEmbeddedPaymentsFeatures { + + /// Whether to allow capturing and cancelling payment intents. + /// + /// This is `true` by default. + pub capture_payments: bool, + + /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. + /// + /// This is `true` by default. + pub dispute_management: bool, + + /// Whether to allow sending refunds. + /// + /// This is `true` by default. + pub refund_management: bool, } /// The parameters for `AccountSession::create`. @@ -94,6 +145,18 @@ pub struct CreateAccountSessionComponents { /// Configuration for the account onboarding embedded component. #[serde(skip_serializing_if = "Option::is_none")] pub account_onboarding: Option, + + /// Configuration for the payment details embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_details: Option, + + /// Configuration for the payments embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub payments: Option, + + /// Configuration for the payouts embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -101,4 +164,93 @@ pub struct CreateAccountSessionComponentsAccountOnboarding { /// Whether the embedded component is enabled. pub enabled: bool, + + /// The list of features enabled in the embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsPaymentDetails { + + /// Whether the embedded component is enabled. + pub enabled: bool, + + /// The list of features enabled in the embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsPayments { + + /// Whether the embedded component is enabled. + pub enabled: bool, + + /// The list of features enabled in the embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsPayouts { + + /// Whether the embedded component is enabled. + pub enabled: bool, + + /// The list of features enabled in the embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsAccountOnboardingFeatures { +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsPaymentDetailsFeatures { + + /// Whether to allow capturing and cancelling payment intents. + /// + /// This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_payments: Option, + + /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. + /// + /// This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub dispute_management: Option, + + /// Whether to allow sending refunds. + /// + /// This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_management: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsPaymentsFeatures { + + /// Whether to allow capturing and cancelling payment intents. + /// + /// This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_payments: Option, + + /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. + /// + /// This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub dispute_management: Option, + + /// Whether to allow sending refunds. + /// + /// This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_management: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreateAccountSessionComponentsPayoutsFeatures { } diff --git a/src/resources/generated/api_errors.rs b/src/resources/generated/api_errors.rs index 8692749e3..ba4195c7b 100644 --- a/src/resources/generated/api_errors.rs +++ b/src/resources/generated/api_errors.rs @@ -112,10 +112,12 @@ pub enum ApiErrorsCode { CouponExpired, CustomerMaxPaymentMethods, CustomerMaxSubscriptions, + CustomerTaxLocationInvalid, DebitNotAuthorized, EmailInvalid, ExpiredCard, FinancialConnectionsAccountInactive, + FinancialConnectionsNoSuccessfulTransactionRefresh, IdempotencyKeyInUse, IncorrectAddress, IncorrectCvc, @@ -282,12 +284,16 @@ impl ApiErrorsCode { ApiErrorsCode::CouponExpired => "coupon_expired", ApiErrorsCode::CustomerMaxPaymentMethods => "customer_max_payment_methods", ApiErrorsCode::CustomerMaxSubscriptions => "customer_max_subscriptions", + ApiErrorsCode::CustomerTaxLocationInvalid => "customer_tax_location_invalid", ApiErrorsCode::DebitNotAuthorized => "debit_not_authorized", ApiErrorsCode::EmailInvalid => "email_invalid", ApiErrorsCode::ExpiredCard => "expired_card", ApiErrorsCode::FinancialConnectionsAccountInactive => { "financial_connections_account_inactive" } + ApiErrorsCode::FinancialConnectionsNoSuccessfulTransactionRefresh => { + "financial_connections_no_successful_transaction_refresh" + } ApiErrorsCode::IdempotencyKeyInUse => "idempotency_key_in_use", ApiErrorsCode::IncorrectAddress => "incorrect_address", ApiErrorsCode::IncorrectCvc => "incorrect_cvc", diff --git a/src/resources/generated/climate_product.rs b/src/resources/generated/climate_product.rs index 8e294fc73..dbad036af 100644 --- a/src/resources/generated/climate_product.rs +++ b/src/resources/generated/climate_product.rs @@ -33,8 +33,7 @@ pub struct ClimateProduct { pub livemode: bool, /// The quantity of metric tons available for reservation. - #[serde(skip_serializing_if = "Option::is_none")] - pub metric_tons_available: Option, + pub metric_tons_available: String, /// The Climate product's name. pub name: String, diff --git a/src/resources/generated/climate_supplier.rs b/src/resources/generated/climate_supplier.rs index 935028cd1..77f347a43 100644 --- a/src/resources/generated/climate_supplier.rs +++ b/src/resources/generated/climate_supplier.rs @@ -66,7 +66,6 @@ pub enum ClimateSupplierRemovalPathway { BiomassCarbonRemovalAndStorage, DirectAirCapture, EnhancedWeathering, - Various, } impl ClimateSupplierRemovalPathway { @@ -75,7 +74,6 @@ impl ClimateSupplierRemovalPathway { ClimateSupplierRemovalPathway::BiomassCarbonRemovalAndStorage => "biomass_carbon_removal_and_storage", ClimateSupplierRemovalPathway::DirectAirCapture => "direct_air_capture", ClimateSupplierRemovalPathway::EnhancedWeathering => "enhanced_weathering", - ClimateSupplierRemovalPathway::Various => "various", } } } diff --git a/src/resources/generated/connect_embedded_base_features.rs b/src/resources/generated/connect_embedded_base_features.rs new file mode 100644 index 000000000..d9e036334 --- /dev/null +++ b/src/resources/generated/connect_embedded_base_features.rs @@ -0,0 +1,10 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "ConnectEmbeddedBaseFeatures". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct ConnectEmbeddedBaseFeatures { +} diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs index bf600be54..9fbff520b 100644 --- a/src/resources/generated/payment_intent.rs +++ b/src/resources/generated/payment_intent.rs @@ -907,8 +907,7 @@ pub struct PaymentIntentPaymentMethodOptionsCard { /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). /// /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. + /// If not provided, this value defaults to `automatic`. /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. pub request_three_d_secure: Option, @@ -3067,8 +3066,7 @@ pub struct CreatePaymentIntentPaymentMethodOptionsCard { /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). /// /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. + /// If not provided, this value defaults to `automatic`. /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. #[serde(skip_serializing_if = "Option::is_none")] pub request_three_d_secure: @@ -3951,8 +3949,7 @@ pub struct UpdatePaymentIntentPaymentMethodOptionsCard { /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). /// /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. + /// If not provided, this value defaults to `automatic`. /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. #[serde(skip_serializing_if = "Option::is_none")] pub request_three_d_secure: @@ -9108,8 +9105,6 @@ impl std::default::Default for PaymentIntentPaymentMethodOptionsCardRequestOverc pub enum PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { Any, Automatic, - Challenge, - ChallengeOnly, } impl PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { @@ -9117,10 +9112,6 @@ impl PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { match self { PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::ChallengeOnly => { - "challenge_only" - } } } } diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs index 3e0642f36..be370b037 100644 --- a/src/resources/generated/payment_link.rs +++ b/src/resources/generated/payment_link.rs @@ -9,7 +9,7 @@ use crate::ids::PaymentLinkId; use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable}; use crate::resources::{ Account, Application, CheckoutSessionItem, Currency, InvoiceSettingRenderingOptions, - ShippingRate, TaxId, + ShippingRate, SubscriptionsTrialsResourceTrialSettings, TaxId, }; /// The resource representing a Stripe "PaymentLink". @@ -62,6 +62,10 @@ pub struct PaymentLink { /// Configuration for Customer creation during checkout. pub customer_creation: PaymentLinkCustomerCreation, + /// The custom message to be displayed to a customer when a payment link is no longer active. + #[serde(skip_serializing_if = "Option::is_none")] + pub inactive_message: Option, + /// Configuration for creating invoice for payment mode payment links. pub invoice_creation: Option, @@ -95,6 +99,10 @@ pub struct PaymentLink { pub phone_number_collection: PaymentLinksResourcePhoneNumberCollection, + /// Settings that restrict the usage of a payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option, + /// Configuration for collecting the customer's shipping address. pub shipping_address_collection: Option, @@ -364,6 +372,11 @@ pub struct PaymentLinksResourcePaymentIntentData { /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. /// Maximum 22 characters for the concatenated descriptor. pub statement_descriptor_suffix: Option, + + /// A string that identifies the resulting payment as part of a group. + /// + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + pub transfer_group: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -372,6 +385,20 @@ pub struct PaymentLinksResourcePhoneNumberCollection { pub enabled: bool, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentLinksResourceRestrictions { + pub completed_sessions: PaymentLinksResourceCompletedSessions, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct PaymentLinksResourceCompletedSessions { + /// The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. + pub count: u64, + + /// The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + pub limit: i64, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct PaymentLinksResourceShippingAddressCollection { /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. @@ -401,6 +428,9 @@ pub struct PaymentLinksResourceSubscriptionData { /// Integer representing the number of trial period days before the customer is charged for the first time. pub trial_period_days: Option, + + /// Settings related to subscription trials. + pub trial_settings: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -480,6 +510,10 @@ pub struct CreatePaymentLink<'a> { #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], + /// The custom message to be displayed to a customer when a payment link is no longer active. + #[serde(skip_serializing_if = "Option::is_none")] + pub inactive_message: Option<&'a str>, + /// Generate a post-purchase Invoice for one-time payments. #[serde(skip_serializing_if = "Option::is_none")] pub invoice_creation: Option, @@ -525,6 +559,10 @@ pub struct CreatePaymentLink<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub phone_number_collection: Option, + /// Settings that restrict the usage of a payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option, + /// Configuration for collecting the customer's shipping address. #[serde(skip_serializing_if = "Option::is_none")] pub shipping_address_collection: Option, @@ -569,6 +607,7 @@ impl<'a> CreatePaymentLink<'a> { custom_text: Default::default(), customer_creation: Default::default(), expand: Default::default(), + inactive_message: Default::default(), invoice_creation: Default::default(), line_items, metadata: Default::default(), @@ -577,6 +616,7 @@ impl<'a> CreatePaymentLink<'a> { payment_method_collection: Default::default(), payment_method_types: Default::default(), phone_number_collection: Default::default(), + restrictions: Default::default(), shipping_address_collection: Default::default(), shipping_options: Default::default(), submit_type: Default::default(), @@ -679,6 +719,10 @@ pub struct UpdatePaymentLink<'a> { #[serde(skip_serializing_if = "Expand::is_empty")] pub expand: &'a [&'a str], + /// The custom message to be displayed to a customer when a payment link is no longer active. + #[serde(skip_serializing_if = "Option::is_none")] + pub inactive_message: Option, + /// Generate a post-purchase Invoice for one-time payments. #[serde(skip_serializing_if = "Option::is_none")] pub invoice_creation: Option, @@ -715,6 +759,10 @@ pub struct UpdatePaymentLink<'a> { #[serde(skip_serializing_if = "Option::is_none")] pub payment_method_types: Option>, + /// Settings that restrict the usage of a payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option, + /// Configuration for collecting the customer's shipping address. #[serde(skip_serializing_if = "Option::is_none")] pub shipping_address_collection: Option, @@ -738,12 +786,14 @@ impl<'a> UpdatePaymentLink<'a> { custom_text: Default::default(), customer_creation: Default::default(), expand: Default::default(), + inactive_message: Default::default(), invoice_creation: Default::default(), line_items: Default::default(), metadata: Default::default(), payment_intent_data: Default::default(), payment_method_collection: Default::default(), payment_method_types: Default::default(), + restrictions: Default::default(), shipping_address_collection: Default::default(), subscription_data: Default::default(), } @@ -904,6 +954,12 @@ pub struct CreatePaymentLinkPaymentIntentData { /// Maximum 22 characters for the concatenated descriptor. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_suffix: Option, + + /// A string that identifies the resulting payment as part of a group. + /// + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -912,6 +968,12 @@ pub struct CreatePaymentLinkPhoneNumberCollection { pub enabled: bool, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentLinkRestrictions { + /// Configuration for the `completed_sessions` restriction type. + pub completed_sessions: CreatePaymentLinkRestrictionsCompletedSessions, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentLinkShippingAddressCollection { /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for @@ -948,6 +1010,10 @@ pub struct CreatePaymentLinkSubscriptionData { /// Has to be at least 1. #[serde(skip_serializing_if = "Option::is_none")] pub trial_period_days: Option, + + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1092,6 +1158,18 @@ pub struct UpdatePaymentLinkPaymentIntentData { /// Maximum 22 characters for the concatenated descriptor. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor_suffix: Option, + + /// A string that identifies the resulting payment as part of a group. + /// + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentLinkRestrictions { + /// Configuration for the `completed_sessions` restriction type. + pub completed_sessions: UpdatePaymentLinkRestrictionsCompletedSessions, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1111,6 +1189,10 @@ pub struct UpdatePaymentLinkSubscriptionData { /// Updates will clear prior values. #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, + + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -1241,6 +1323,18 @@ pub struct CreatePaymentLinkLineItemsAdjustableQuantity { pub minimum: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentLinkRestrictionsCompletedSessions { + /// The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + pub limit: i64, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CreatePaymentLinkSubscriptionDataTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentLinkAfterCompletionHostedConfirmation { /// A custom message to display to the customer after the purchase is complete. @@ -1369,6 +1463,18 @@ pub struct UpdatePaymentLinkLineItemsAdjustableQuantity { pub minimum: Option, } +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentLinkRestrictionsCompletedSessions { + /// The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + pub limit: i64, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct UpdatePaymentLinkSubscriptionDataTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CreatePaymentLinkCustomFieldsDropdownOptions { /// The label for the option, displayed to the customer. @@ -1407,6 +1513,13 @@ pub struct CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { Option, } +#[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. + pub missing_payment_method: + CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct UpdatePaymentLinkCustomFieldsDropdownOptions { /// The label for the option, displayed to the customer. @@ -1445,6 +1558,13 @@ pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { Option, } +#[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. + pub missing_payment_method: + UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, +} + /// An enum representing the possible values of an `CreatePaymentLinkAfterCompletion`'s `type` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -2550,6 +2670,46 @@ impl std::default::Default for CreatePaymentLinkShippingAddressCollectionAllowed } } +/// 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")] +pub enum CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} + +impl CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + match self { + CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", + CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice", + CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", + } + } +} + +impl AsRef for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display + for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default + for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn default() -> Self { + Self::Cancel + } +} + /// An enum representing the possible values of an `PaymentLink`'s `billing_address_collection` field. #[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] #[serde(rename_all = "snake_case")] @@ -4723,3 +4883,43 @@ impl std::default::Default for UpdatePaymentLinkShippingAddressCollectionAllowed Self::Ac } } + +/// 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")] +pub enum UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} + +impl UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + match self { + UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", + UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice", + UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", + } + } +} + +impl AsRef for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display + for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default + for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn default() -> Self { + Self::Cancel + } +} diff --git a/src/resources/generated/price.rs b/src/resources/generated/price.rs index f975b4cb7..ea16cbc08 100644 --- a/src/resources/generated/price.rs +++ b/src/resources/generated/price.rs @@ -222,7 +222,6 @@ pub struct PriceTier { pub struct Recurring { /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. /// - /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. /// Defaults to `sum`. pub aggregate_usage: Option, @@ -641,7 +640,6 @@ pub struct CreatePriceProductData { pub struct CreatePriceRecurring { /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. /// - /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. /// Defaults to `sum`. #[serde(skip_serializing_if = "Option::is_none")] pub aggregate_usage: Option, diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs index e73535bac..ad182681c 100644 --- a/src/resources/generated/setup_intent.rs +++ b/src/resources/generated/setup_intent.rs @@ -274,8 +274,7 @@ pub struct SetupIntentPaymentMethodOptionsCard { /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). /// /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. + /// If not provided, this value defaults to `automatic`. /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. pub request_three_d_secure: Option, } @@ -1343,8 +1342,7 @@ pub struct CreateSetupIntentPaymentMethodOptionsCard { /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). /// /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. + /// If not provided, this value defaults to `automatic`. /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. #[serde(skip_serializing_if = "Option::is_none")] pub request_three_d_secure: @@ -1639,8 +1637,7 @@ pub struct UpdateSetupIntentPaymentMethodOptionsCard { /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). /// /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. + /// If not provided, this value defaults to `automatic`. /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. #[serde(skip_serializing_if = "Option::is_none")] pub request_three_d_secure: diff --git a/src/resources/generated/subscription.rs b/src/resources/generated/subscription.rs index 91cf257ab..ac6a761e4 100644 --- a/src/resources/generated/subscription.rs +++ b/src/resources/generated/subscription.rs @@ -15,7 +15,8 @@ use crate::resources::{ InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini, InvoicePaymentMethodOptionsUsBankAccount, PaymentMethod, PaymentSource, Scheduled, SetupIntent, SubscriptionBillingThresholds, SubscriptionItem, SubscriptionItemBillingThresholds, - SubscriptionSchedule, SubscriptionTransferData, TaxRate, TestHelpersTestClock, + SubscriptionSchedule, SubscriptionTransferData, SubscriptionsTrialsResourceTrialSettings, + TaxRate, TestHelpersTestClock, }; /// The resource representing a Stripe "Subscription". @@ -414,17 +415,6 @@ pub struct SubscriptionsResourcePendingUpdate { pub trial_from_plan: Option, } -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsTrialsResourceTrialSettings { - pub end_behavior: SubscriptionsTrialsResourceEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsTrialsResourceEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod, -} - /// The parameters for `Subscription::create`. #[derive(Clone, Debug, Serialize)] pub struct CreateSubscription<'a> { @@ -2931,44 +2921,6 @@ impl std::default::Default for SubscriptionsResourcePaymentSettingsSaveDefaultPa } } -/// An enum representing the possible values of an `SubscriptionsTrialsResourceEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Cancel => "cancel", - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::CreateInvoice => { - "create_invoice" - } - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn default() -> Self { - Self::Cancel - } -} - /// 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")] diff --git a/src/resources/generated/subscriptions_trials_resource_trial_settings.rs b/src/resources/generated/subscriptions_trials_resource_trial_settings.rs new file mode 100644 index 000000000..fc847865e --- /dev/null +++ b/src/resources/generated/subscriptions_trials_resource_trial_settings.rs @@ -0,0 +1,55 @@ +// ====================================== +// This file was automatically generated. +// ====================================== + +use serde::{Deserialize, Serialize}; + +/// The resource representing a Stripe "SubscriptionsTrialsResourceTrialSettings". +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SubscriptionsTrialsResourceTrialSettings { + + pub end_behavior: SubscriptionsTrialsResourceEndBehavior, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct SubscriptionsTrialsResourceEndBehavior { + + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod, +} + +/// An enum representing the possible values of an `SubscriptionsTrialsResourceEndBehavior`'s `missing_payment_method` field. +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] +#[serde(rename_all = "snake_case")] +pub enum SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} + +impl SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + match self { + SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Cancel => "cancel", + SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice", + SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Pause => "pause", + } + } +} + +impl AsRef for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl std::fmt::Display for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.as_str().fmt(f) + } +} +impl std::default::Default for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn default() -> Self { + Self::Cancel + } +} From 0643ef20ee48c83ddc6f8fceec0bb0c10c4c2d03 Mon Sep 17 00:00:00 2001 From: Alexander Lyon Date: Fri, 8 Dec 2023 12:29:05 +0000 Subject: [PATCH 2/2] add exports --- src/resources.rs | 1 + src/resources/generated.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/resources.rs b/src/resources.rs index 7caa8d610..030883f49 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -229,6 +229,7 @@ pub use { // need to import this afterwards so that the SubscriptionItemPriceDataRecurring // isn't silently ignored subscription::*, + subscriptions_trials_resource_trial_settings::*, subscription::PlanInterval as SubscriptionInterval, subscription::SubscriptionItemPriceDataRecurring as SubscriptionPriceDataRecurring, subscription::SubscriptionItemPriceData as SubscriptionPriceData, diff --git a/src/resources/generated.rs b/src/resources/generated.rs index 18cc7d795..510ff6149 100644 --- a/src/resources/generated.rs +++ b/src/resources/generated.rs @@ -105,6 +105,7 @@ pub mod billing { pub mod subscription_item; pub mod subscription_item_billing_thresholds; pub mod subscription_schedule; + pub mod subscriptions_trials_resource_trial_settings; pub mod tax_id; pub mod tax_rate; pub mod usage_record;