From d030a99fd2a677bd9d05f23a1d1107a0721d6c65 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 16:32:05 +0000 Subject: [PATCH] Update generated code for v1805 and 2025-05-28.preview --- OPENAPI_VERSION | 2 +- lib/stripe/resources/quote.rb | 7 ++- .../quote_preview_subscription_schedule.rb | 9 +++- lib/stripe/resources/subscription.rb | 10 ++-- lib/stripe/resources/subscription_schedule.rb | 9 +++- lib/stripe/services/subscription_service.rb | 2 +- rbi/stripe.rbi | 49 +++++++++++++------ rbi/stripe/resources/quote.rbi | 9 +++- .../quote_preview_subscription_schedule.rbi | 12 ++++- rbi/stripe/resources/subscription.rbi | 14 +++--- .../resources/subscription_schedule.rbi | 12 ++++- rbi/stripe/services/subscription_service.rbi | 2 +- 12 files changed, 99 insertions(+), 38 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e8f2c5d0..867356ad 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1803 \ No newline at end of file +v1805 \ No newline at end of file diff --git a/lib/stripe/resources/quote.rb b/lib/stripe/resources/quote.rb index 925ad0cd..d6ec95b3 100644 --- a/lib/stripe/resources/quote.rb +++ b/lib/stripe/resources/quote.rb @@ -297,6 +297,11 @@ module Stripe attr_reader :bill_until end + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + attr_reader :type + end + class Prebilling < Stripe::StripeObject # Attribute for field iterations attr_reader :iterations @@ -307,7 +312,7 @@ module Stripe attr_reader :billing_behavior # Whether the subscription will always start a new billing period when the quote is accepted. attr_reader :billing_cycle_anchor - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be set on the subscription once the quote is accepted. + # The billing mode of the quote. attr_reader :billing_mode # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. attr_reader :description diff --git a/lib/stripe/resources/quote_preview_subscription_schedule.rb b/lib/stripe/resources/quote_preview_subscription_schedule.rb index 46d29c5b..00f0902d 100644 --- a/lib/stripe/resources/quote_preview_subscription_schedule.rb +++ b/lib/stripe/resources/quote_preview_subscription_schedule.rb @@ -17,6 +17,13 @@ module Stripe attr_reader :type end + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + attr_reader :type + # Details on when the current billing_mode was adopted. + attr_reader :updated_at + end + class CurrentPhase < Stripe::StripeObject # The end of this phase of the subscription schedule. attr_reader :end_date @@ -318,7 +325,7 @@ module Stripe attr_reader :applies_to # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. attr_reader :billing_behavior - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. + # The billing mode of the subscription. attr_reader :billing_mode # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. attr_reader :canceled_at diff --git a/lib/stripe/resources/subscription.rb b/lib/stripe/resources/subscription.rb index 9fbe531f..e0cd5cd1 100644 --- a/lib/stripe/resources/subscription.rb +++ b/lib/stripe/resources/subscription.rb @@ -44,7 +44,9 @@ module Stripe attr_reader :second end - class BillingModeDetails < Stripe::StripeObject + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + attr_reader :type # Details on when the current billing_mode was adopted. attr_reader :updated_at end @@ -1762,7 +1764,7 @@ module Stripe attr_accessor :application_fee_percent # Automatic tax settings for this subscription. attr_accessor :automatic_tax - # For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + # A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. attr_accessor :backdate_start_date # A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. attr_accessor :billing_cycle_anchor @@ -1986,10 +1988,8 @@ module Stripe attr_reader :billing_cycle_anchor # The fixed values used to calculate the `billing_cycle_anchor`. attr_reader :billing_cycle_anchor_config - # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + # The billing mode of the subscription. attr_reader :billing_mode - # Details about when the current billing_mode was updated. - attr_reader :billing_mode_details # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period attr_reader :billing_thresholds # A date in the future at which the subscription will automatically get canceled diff --git a/lib/stripe/resources/subscription_schedule.rb b/lib/stripe/resources/subscription_schedule.rb index 194cf22c..acb13be3 100644 --- a/lib/stripe/resources/subscription_schedule.rb +++ b/lib/stripe/resources/subscription_schedule.rb @@ -15,6 +15,13 @@ module Stripe "subscription_schedule" end + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + attr_reader :type + # Details on when the current billing_mode was adopted. + attr_reader :updated_at + end + class CurrentPhase < Stripe::StripeObject # The end of this phase of the subscription schedule. attr_reader :end_date @@ -2360,7 +2367,7 @@ module Stripe attr_reader :application # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. attr_reader :billing_behavior - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. + # The billing mode of the subscription. attr_reader :billing_mode # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. attr_reader :canceled_at diff --git a/lib/stripe/services/subscription_service.rb b/lib/stripe/services/subscription_service.rb index 202b2213..43c6c560 100644 --- a/lib/stripe/services/subscription_service.rb +++ b/lib/stripe/services/subscription_service.rb @@ -1524,7 +1524,7 @@ module Stripe attr_accessor :application_fee_percent # Automatic tax settings for this subscription. attr_accessor :automatic_tax - # For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + # A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. attr_accessor :backdate_start_date # A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. attr_accessor :billing_cycle_anchor diff --git a/rbi/stripe.rbi b/rbi/stripe.rbi index e143fa59..ed597a6a 100644 --- a/rbi/stripe.rbi +++ b/rbi/stripe.rbi @@ -73637,6 +73637,11 @@ module Stripe sig { returns(T.nilable(BillUntil)) } attr_reader :bill_until end + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + sig { returns(String) } + attr_reader :type + end class Prebilling < Stripe::StripeObject # Attribute for field iterations sig { returns(Integer) } @@ -73651,8 +73656,8 @@ module Stripe # Whether the subscription will always start a new billing period when the quote is accepted. sig { returns(T.nilable(String)) } attr_reader :billing_cycle_anchor - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be set on the subscription once the quote is accepted. - sig { returns(String) } + # The billing mode of the quote. + sig { returns(BillingMode) } attr_reader :billing_mode # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. sig { returns(T.nilable(String)) } @@ -77761,6 +77766,14 @@ module Stripe sig { returns(String) } attr_reader :type end + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + sig { returns(String) } + attr_reader :type + # Details on when the current billing_mode was adopted. + sig { returns(Integer) } + attr_reader :updated_at + end class CurrentPhase < Stripe::StripeObject # The end of this phase of the subscription schedule. sig { returns(Integer) } @@ -78156,8 +78169,8 @@ module Stripe # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. sig { returns(String) } attr_reader :billing_behavior - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. - sig { returns(String) } + # The billing mode of the subscription. + sig { returns(BillingMode) } attr_reader :billing_mode # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. sig { returns(T.nilable(Integer)) } @@ -86457,7 +86470,10 @@ module Stripe sig { returns(T.nilable(Integer)) } attr_reader :second end - class BillingModeDetails < Stripe::StripeObject + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + sig { returns(String) } + attr_reader :type # Details on when the current billing_mode was adopted. sig { returns(Integer) } attr_reader :updated_at @@ -86727,12 +86743,9 @@ module Stripe # The fixed values used to calculate the `billing_cycle_anchor`. sig { returns(T.nilable(BillingCycleAnchorConfig)) } attr_reader :billing_cycle_anchor_config - # Controls how prorations and invoices for subscriptions are calculated and orchestrated. - sig { returns(String) } + # The billing mode of the subscription. + sig { returns(BillingMode) } attr_reader :billing_mode - # Details about when the current billing_mode was updated. - sig { returns(T.nilable(BillingModeDetails)) } - attr_reader :billing_mode_details # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period sig { returns(T.nilable(BillingThresholds)) } attr_reader :billing_thresholds @@ -88478,7 +88491,7 @@ module Stripe # Automatic tax settings for this subscription. sig { returns(T.nilable(::Stripe::Subscription::CreateParams::AutomaticTax)) } attr_accessor :automatic_tax - # For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + # A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. sig { returns(T.nilable(Integer)) } attr_accessor :backdate_start_date # A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. @@ -89298,6 +89311,14 @@ module Stripe # # Related guide: [Subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules) class SubscriptionSchedule < APIResource + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + sig { returns(String) } + attr_reader :type + # Details on when the current billing_mode was adopted. + sig { returns(Integer) } + attr_reader :updated_at + end class CurrentPhase < Stripe::StripeObject # The end of this phase of the subscription schedule. sig { returns(Integer) } @@ -89690,8 +89711,8 @@ module Stripe # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. sig { returns(String) } attr_reader :billing_behavior - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. - sig { returns(String) } + # The billing mode of the subscription. + sig { returns(BillingMode) } attr_reader :billing_mode # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. sig { returns(T.nilable(Integer)) } @@ -172660,7 +172681,7 @@ module Stripe # Automatic tax settings for this subscription. sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax)) } attr_accessor :automatic_tax - # For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + # A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. sig { returns(T.nilable(Integer)) } attr_accessor :backdate_start_date # A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. diff --git a/rbi/stripe/resources/quote.rbi b/rbi/stripe/resources/quote.rbi index c1a9ee1d..1ef5129a 100644 --- a/rbi/stripe/resources/quote.rbi +++ b/rbi/stripe/resources/quote.rbi @@ -363,6 +363,11 @@ module Stripe sig { returns(T.nilable(BillUntil)) } attr_reader :bill_until end + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + sig { returns(String) } + attr_reader :type + end class Prebilling < Stripe::StripeObject # Attribute for field iterations sig { returns(Integer) } @@ -377,8 +382,8 @@ module Stripe # Whether the subscription will always start a new billing period when the quote is accepted. sig { returns(T.nilable(String)) } attr_reader :billing_cycle_anchor - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be set on the subscription once the quote is accepted. - sig { returns(String) } + # The billing mode of the quote. + sig { returns(BillingMode) } attr_reader :billing_mode # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. sig { returns(T.nilable(String)) } diff --git a/rbi/stripe/resources/quote_preview_subscription_schedule.rbi b/rbi/stripe/resources/quote_preview_subscription_schedule.rbi index d34d307e..1f241fee 100644 --- a/rbi/stripe/resources/quote_preview_subscription_schedule.rbi +++ b/rbi/stripe/resources/quote_preview_subscription_schedule.rbi @@ -15,6 +15,14 @@ module Stripe sig { returns(String) } attr_reader :type end + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + sig { returns(String) } + attr_reader :type + # Details on when the current billing_mode was adopted. + sig { returns(Integer) } + attr_reader :updated_at + end class CurrentPhase < Stripe::StripeObject # The end of this phase of the subscription schedule. sig { returns(Integer) } @@ -410,8 +418,8 @@ module Stripe # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. sig { returns(String) } attr_reader :billing_behavior - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. - sig { returns(String) } + # The billing mode of the subscription. + sig { returns(BillingMode) } attr_reader :billing_mode # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. sig { returns(T.nilable(Integer)) } diff --git a/rbi/stripe/resources/subscription.rbi b/rbi/stripe/resources/subscription.rbi index 536b89c7..76675bd9 100644 --- a/rbi/stripe/resources/subscription.rbi +++ b/rbi/stripe/resources/subscription.rbi @@ -43,7 +43,10 @@ module Stripe sig { returns(T.nilable(Integer)) } attr_reader :second end - class BillingModeDetails < Stripe::StripeObject + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + sig { returns(String) } + attr_reader :type # Details on when the current billing_mode was adopted. sig { returns(Integer) } attr_reader :updated_at @@ -313,12 +316,9 @@ module Stripe # The fixed values used to calculate the `billing_cycle_anchor`. sig { returns(T.nilable(BillingCycleAnchorConfig)) } attr_reader :billing_cycle_anchor_config - # Controls how prorations and invoices for subscriptions are calculated and orchestrated. - sig { returns(String) } + # The billing mode of the subscription. + sig { returns(BillingMode) } attr_reader :billing_mode - # Details about when the current billing_mode was updated. - sig { returns(T.nilable(BillingModeDetails)) } - attr_reader :billing_mode_details # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period sig { returns(T.nilable(BillingThresholds)) } attr_reader :billing_thresholds @@ -2064,7 +2064,7 @@ module Stripe # Automatic tax settings for this subscription. sig { returns(T.nilable(::Stripe::Subscription::CreateParams::AutomaticTax)) } attr_accessor :automatic_tax - # For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + # A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. sig { returns(T.nilable(Integer)) } attr_accessor :backdate_start_date # A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. diff --git a/rbi/stripe/resources/subscription_schedule.rbi b/rbi/stripe/resources/subscription_schedule.rbi index 9ac17317..0cff60f8 100644 --- a/rbi/stripe/resources/subscription_schedule.rbi +++ b/rbi/stripe/resources/subscription_schedule.rbi @@ -7,6 +7,14 @@ module Stripe # # Related guide: [Subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules) class SubscriptionSchedule < APIResource + class BillingMode < Stripe::StripeObject + # Controls how prorations and invoices for subscriptions are calculated and orchestrated. + sig { returns(String) } + attr_reader :type + # Details on when the current billing_mode was adopted. + sig { returns(Integer) } + attr_reader :updated_at + end class CurrentPhase < Stripe::StripeObject # The end of this phase of the subscription schedule. sig { returns(Integer) } @@ -399,8 +407,8 @@ module Stripe # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. sig { returns(String) } attr_reader :billing_behavior - # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. - sig { returns(String) } + # The billing mode of the subscription. + sig { returns(BillingMode) } attr_reader :billing_mode # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. sig { returns(T.nilable(Integer)) } diff --git a/rbi/stripe/services/subscription_service.rbi b/rbi/stripe/services/subscription_service.rbi index 072d328a..0a99cd0a 100644 --- a/rbi/stripe/services/subscription_service.rbi +++ b/rbi/stripe/services/subscription_service.rbi @@ -1641,7 +1641,7 @@ module Stripe # Automatic tax settings for this subscription. sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax)) } attr_accessor :automatic_tax - # For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + # A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. sig { returns(T.nilable(Integer)) } attr_accessor :backdate_start_date # A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals.