# File generated from our OpenAPI spec
# frozen_string_literal: true

# typed: true
module Stripe
  # A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes.
  #
  # Related guide: [Subscription schedules](https://docs.stripe.com/billing/subscriptions/subscription-schedules)
  class SubscriptionSchedule < APIResource
    class BillingMode < ::Stripe::StripeObject
      class Flexible < ::Stripe::StripeObject
        # Controls how invoices and invoice items display proration amounts and discount amounts.
        sig { returns(T.nilable(String)) }
        def proration_discounts; end
        def self.inner_class_types
          @inner_class_types = {}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      # Configure behavior for flexible billing mode
      sig { returns(T.nilable(Flexible)) }
      def flexible; end
      # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
      sig { returns(String) }
      def type; end
      # Details on when the current billing_mode was adopted.
      sig { returns(T.nilable(Integer)) }
      def updated_at; end
      def self.inner_class_types
        @inner_class_types = {flexible: Flexible}
      end
      def self.field_remappings
        @field_remappings = {}
      end
    end
    class CurrentPhase < ::Stripe::StripeObject
      # The end of this phase of the subscription schedule.
      sig { returns(Integer) }
      def end_date; end
      # The start of this phase of the subscription schedule.
      sig { returns(Integer) }
      def start_date; end
      def self.inner_class_types
        @inner_class_types = {}
      end
      def self.field_remappings
        @field_remappings = {}
      end
    end
    class DefaultSettings < ::Stripe::StripeObject
      class AutomaticTax < ::Stripe::StripeObject
        class Liability < ::Stripe::StripeObject
          # The connected account being referenced when `type` is `account`.
          sig { returns(T.nilable(T.any(String, ::Stripe::Account))) }
          def account; end
          # Type of the account referenced.
          sig { returns(String) }
          def type; end
          def self.inner_class_types
            @inner_class_types = {}
          end
          def self.field_remappings
            @field_remappings = {}
          end
        end
        # If Stripe disabled automatic tax, this enum describes why.
        sig { returns(T.nilable(String)) }
        def disabled_reason; end
        # Whether Stripe automatically computes tax on invoices created during this phase.
        sig { returns(T::Boolean) }
        def enabled; end
        # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
        sig { returns(T.nilable(Liability)) }
        def liability; end
        def self.inner_class_types
          @inner_class_types = {liability: Liability}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class BillingThresholds < ::Stripe::StripeObject
        # Monetary threshold that triggers the subscription to create an invoice
        sig { returns(T.nilable(Integer)) }
        def amount_gte; end
        # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
        sig { returns(T.nilable(T::Boolean)) }
        def reset_billing_cycle_anchor; end
        def self.inner_class_types
          @inner_class_types = {}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class InvoiceSettings < ::Stripe::StripeObject
        class Issuer < ::Stripe::StripeObject
          # The connected account being referenced when `type` is `account`.
          sig { returns(T.nilable(T.any(String, ::Stripe::Account))) }
          def account; end
          # Type of the account referenced.
          sig { returns(String) }
          def type; end
          def self.inner_class_types
            @inner_class_types = {}
          end
          def self.field_remappings
            @field_remappings = {}
          end
        end
        # The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule.
        sig { returns(T.nilable(T::Array[T.any(String, ::Stripe::TaxId)])) }
        def account_tax_ids; end
        # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
        sig { returns(T.nilable(Integer)) }
        def days_until_due; end
        # Attribute for field issuer
        sig { returns(Issuer) }
        def issuer; end
        def self.inner_class_types
          @inner_class_types = {issuer: Issuer}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class TransferData < ::Stripe::StripeObject
        # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
        sig { returns(T.nilable(Float)) }
        def amount_percent; end
        # The account where funds from the payment will be transferred to upon payment success.
        sig { returns(T.any(String, ::Stripe::Account)) }
        def destination; end
        def self.inner_class_types
          @inner_class_types = {}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule.
      sig { returns(T.nilable(Float)) }
      def application_fee_percent; end
      # Attribute for field automatic_tax
      sig { returns(T.nilable(AutomaticTax)) }
      def automatic_tax; end
      # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle).
      sig { returns(String) }
      def billing_cycle_anchor; end
      # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
      sig { returns(T.nilable(BillingThresholds)) }
      def billing_thresholds; end
      # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
      sig { returns(T.nilable(String)) }
      def collection_method; end
      # ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
      sig { returns(T.nilable(T.any(String, ::Stripe::PaymentMethod))) }
      def default_payment_method; end
      # Subscription 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)) }
      def description; end
      # Attribute for field invoice_settings
      sig { returns(InvoiceSettings) }
      def invoice_settings; end
      # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details.
      sig { returns(T.nilable(T.any(String, ::Stripe::Account))) }
      def on_behalf_of; end
      # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
      sig { returns(T.nilable(TransferData)) }
      def transfer_data; end
      def self.inner_class_types
        @inner_class_types = {
          automatic_tax: AutomaticTax,
          billing_thresholds: BillingThresholds,
          invoice_settings: InvoiceSettings,
          transfer_data: TransferData,
        }
      end
      def self.field_remappings
        @field_remappings = {}
      end
    end
    class Phase < ::Stripe::StripeObject
      class AddInvoiceItem < ::Stripe::StripeObject
        class Discount < ::Stripe::StripeObject
          # ID of the coupon to create a new discount for.
          sig { returns(T.nilable(T.any(String, ::Stripe::Coupon))) }
          def coupon; end
          # ID of an existing discount on the object (or one of its ancestors) to reuse.
          sig { returns(T.nilable(T.any(String, ::Stripe::Discount))) }
          def discount; end
          # ID of the promotion code to create a new discount for.
          sig { returns(T.nilable(T.any(String, ::Stripe::PromotionCode))) }
          def promotion_code; end
          def self.inner_class_types
            @inner_class_types = {}
          end
          def self.field_remappings
            @field_remappings = {}
          end
        end
        class Period < ::Stripe::StripeObject
          class End < ::Stripe::StripeObject
            # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
            sig { returns(T.nilable(Integer)) }
            def timestamp; end
            # Select how to calculate the end of the invoice item period.
            sig { returns(String) }
            def type; end
            def self.inner_class_types
              @inner_class_types = {}
            end
            def self.field_remappings
              @field_remappings = {}
            end
          end
          class Start < ::Stripe::StripeObject
            # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
            sig { returns(T.nilable(Integer)) }
            def timestamp; end
            # Select how to calculate the start of the invoice item period.
            sig { returns(String) }
            def type; end
            def self.inner_class_types
              @inner_class_types = {}
            end
            def self.field_remappings
              @field_remappings = {}
            end
          end
          # Attribute for field end
          sig { returns(End) }
          def end; end
          # Attribute for field start
          sig { returns(Start) }
          def start; end
          def self.inner_class_types
            @inner_class_types = {end: End, start: Start}
          end
          def self.field_remappings
            @field_remappings = {}
          end
        end
        # The stackable discounts that will be applied to the item.
        sig { returns(T::Array[Discount]) }
        def discounts; end
        # Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
        sig { returns(T.nilable(T::Hash[String, String])) }
        def metadata; end
        # Attribute for field period
        sig { returns(Period) }
        def period; end
        # ID of the price used to generate the invoice item.
        sig { returns(T.any(String, ::Stripe::Price)) }
        def price; end
        # The quantity of the invoice item.
        sig { returns(T.nilable(Integer)) }
        def quantity; end
        # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
        sig { returns(T.nilable(T::Array[::Stripe::TaxRate])) }
        def tax_rates; end
        def self.inner_class_types
          @inner_class_types = {discounts: Discount, period: Period}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class AutomaticTax < ::Stripe::StripeObject
        class Liability < ::Stripe::StripeObject
          # The connected account being referenced when `type` is `account`.
          sig { returns(T.nilable(T.any(String, ::Stripe::Account))) }
          def account; end
          # Type of the account referenced.
          sig { returns(String) }
          def type; end
          def self.inner_class_types
            @inner_class_types = {}
          end
          def self.field_remappings
            @field_remappings = {}
          end
        end
        # If Stripe disabled automatic tax, this enum describes why.
        sig { returns(T.nilable(String)) }
        def disabled_reason; end
        # Whether Stripe automatically computes tax on invoices created during this phase.
        sig { returns(T::Boolean) }
        def enabled; end
        # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
        sig { returns(T.nilable(Liability)) }
        def liability; end
        def self.inner_class_types
          @inner_class_types = {liability: Liability}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class BillingThresholds < ::Stripe::StripeObject
        # Monetary threshold that triggers the subscription to create an invoice
        sig { returns(T.nilable(Integer)) }
        def amount_gte; end
        # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
        sig { returns(T.nilable(T::Boolean)) }
        def reset_billing_cycle_anchor; end
        def self.inner_class_types
          @inner_class_types = {}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class Discount < ::Stripe::StripeObject
        # ID of the coupon to create a new discount for.
        sig { returns(T.nilable(T.any(String, ::Stripe::Coupon))) }
        def coupon; end
        # ID of an existing discount on the object (or one of its ancestors) to reuse.
        sig { returns(T.nilable(T.any(String, ::Stripe::Discount))) }
        def discount; end
        # ID of the promotion code to create a new discount for.
        sig { returns(T.nilable(T.any(String, ::Stripe::PromotionCode))) }
        def promotion_code; end
        def self.inner_class_types
          @inner_class_types = {}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class InvoiceSettings < ::Stripe::StripeObject
        class Issuer < ::Stripe::StripeObject
          # The connected account being referenced when `type` is `account`.
          sig { returns(T.nilable(T.any(String, ::Stripe::Account))) }
          def account; end
          # Type of the account referenced.
          sig { returns(String) }
          def type; end
          def self.inner_class_types
            @inner_class_types = {}
          end
          def self.field_remappings
            @field_remappings = {}
          end
        end
        # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
        sig { returns(T.nilable(T::Array[T.any(String, ::Stripe::TaxId)])) }
        def account_tax_ids; end
        # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
        sig { returns(T.nilable(Integer)) }
        def days_until_due; end
        # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
        sig { returns(T.nilable(Issuer)) }
        def issuer; end
        def self.inner_class_types
          @inner_class_types = {issuer: Issuer}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class Item < ::Stripe::StripeObject
        class BillingThresholds < ::Stripe::StripeObject
          # Usage threshold that triggers the subscription to create an invoice
          sig { returns(T.nilable(Integer)) }
          def usage_gte; end
          def self.inner_class_types
            @inner_class_types = {}
          end
          def self.field_remappings
            @field_remappings = {}
          end
        end
        class Discount < ::Stripe::StripeObject
          # ID of the coupon to create a new discount for.
          sig { returns(T.nilable(T.any(String, ::Stripe::Coupon))) }
          def coupon; end
          # ID of an existing discount on the object (or one of its ancestors) to reuse.
          sig { returns(T.nilable(T.any(String, ::Stripe::Discount))) }
          def discount; end
          # ID of the promotion code to create a new discount for.
          sig { returns(T.nilable(T.any(String, ::Stripe::PromotionCode))) }
          def promotion_code; end
          def self.inner_class_types
            @inner_class_types = {}
          end
          def self.field_remappings
            @field_remappings = {}
          end
        end
        # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period
        sig { returns(T.nilable(BillingThresholds)) }
        def billing_thresholds; end
        # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
        sig { returns(T::Array[Discount]) }
        def discounts; end
        # Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered.
        sig { returns(T.nilable(T::Hash[String, String])) }
        def metadata; end
        # ID of the plan to which the customer should be subscribed.
        sig { returns(T.any(String, ::Stripe::Plan)) }
        def plan; end
        # ID of the price to which the customer should be subscribed.
        sig { returns(T.any(String, ::Stripe::Price)) }
        def price; end
        # Quantity of the plan to which the customer should be subscribed.
        sig { returns(T.nilable(Integer)) }
        def quantity; end
        # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`.
        sig { returns(T.nilable(T::Array[::Stripe::TaxRate])) }
        def tax_rates; end
        def self.inner_class_types
          @inner_class_types = {billing_thresholds: BillingThresholds, discounts: Discount}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      class TransferData < ::Stripe::StripeObject
        # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination.
        sig { returns(T.nilable(Float)) }
        def amount_percent; end
        # The account where funds from the payment will be transferred to upon payment success.
        sig { returns(T.any(String, ::Stripe::Account)) }
        def destination; end
        def self.inner_class_types
          @inner_class_types = {}
        end
        def self.field_remappings
          @field_remappings = {}
        end
      end
      # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase.
      sig { returns(T::Array[AddInvoiceItem]) }
      def add_invoice_items; end
      # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule.
      sig { returns(T.nilable(Float)) }
      def application_fee_percent; end
      # Attribute for field automatic_tax
      sig { returns(T.nilable(AutomaticTax)) }
      def automatic_tax; end
      # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle).
      sig { returns(T.nilable(String)) }
      def billing_cycle_anchor; end
      # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
      sig { returns(T.nilable(BillingThresholds)) }
      def billing_thresholds; end
      # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
      sig { returns(T.nilable(String)) }
      def collection_method; end
      # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
      sig { returns(String) }
      def currency; end
      # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
      sig { returns(T.nilable(T.any(String, ::Stripe::PaymentMethod))) }
      def default_payment_method; end
      # The default tax rates to apply to the subscription during this phase of the subscription schedule.
      sig { returns(T.nilable(T::Array[::Stripe::TaxRate])) }
      def default_tax_rates; end
      # Subscription 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)) }
      def description; end
      # The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts.
      sig { returns(T::Array[Discount]) }
      def discounts; end
      # The end of this phase of the subscription schedule.
      sig { returns(Integer) }
      def end_date; end
      # The invoice settings applicable during this phase.
      sig { returns(T.nilable(InvoiceSettings)) }
      def invoice_settings; end
      # Subscription items to configure the subscription to during this phase of the subscription schedule.
      sig { returns(T::Array[Item]) }
      def items; end
      # Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`.
      sig { returns(T.nilable(T::Hash[String, String])) }
      def metadata; end
      # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details.
      sig { returns(T.nilable(T.any(String, ::Stripe::Account))) }
      def on_behalf_of; end
      # When transitioning phases, controls how prorations are handled (if any). Possible values are `create_prorations`, `none`, and `always_invoice`.
      sig { returns(String) }
      def proration_behavior; end
      # The start of this phase of the subscription schedule.
      sig { returns(Integer) }
      def start_date; end
      # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
      sig { returns(T.nilable(TransferData)) }
      def transfer_data; end
      # When the trial ends within the phase.
      sig { returns(T.nilable(Integer)) }
      def trial_end; end
      def self.inner_class_types
        @inner_class_types = {
          add_invoice_items: AddInvoiceItem,
          automatic_tax: AutomaticTax,
          billing_thresholds: BillingThresholds,
          discounts: Discount,
          invoice_settings: InvoiceSettings,
          items: Item,
          transfer_data: TransferData,
        }
      end
      def self.field_remappings
        @field_remappings = {}
      end
    end
    # ID of the Connect Application that created the schedule.
    sig { returns(T.nilable(T.any(String, ::Stripe::Application))) }
    def application; end
    # The billing mode of the subscription.
    sig { returns(BillingMode) }
    def billing_mode; end
    # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
    sig { returns(T.nilable(Integer)) }
    def canceled_at; end
    # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
    sig { returns(T.nilable(Integer)) }
    def completed_at; end
    # Time at which the object was created. Measured in seconds since the Unix epoch.
    sig { returns(Integer) }
    def created; end
    # Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
    sig { returns(T.nilable(CurrentPhase)) }
    def current_phase; end
    # ID of the customer who owns the subscription schedule.
    sig { returns(T.any(String, ::Stripe::Customer)) }
    def customer; end
    # ID of the account who owns the subscription schedule.
    sig { returns(T.nilable(String)) }
    def customer_account; end
    # Attribute for field default_settings
    sig { returns(DefaultSettings) }
    def default_settings; end
    # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
    sig { returns(String) }
    def end_behavior; end
    # Unique identifier for the object.
    sig { returns(String) }
    def id; end
    # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
    sig { returns(T::Boolean) }
    def livemode; end
    # Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
    sig { returns(T.nilable(T::Hash[String, String])) }
    def metadata; end
    # String representing the object's type. Objects of the same type share the same value.
    sig { returns(String) }
    def object; end
    # Configuration for the subscription schedule's phases.
    sig { returns(T::Array[Phase]) }
    def phases; end
    # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
    sig { returns(T.nilable(Integer)) }
    def released_at; end
    # ID of the subscription once managed by the subscription schedule (if it is released).
    sig { returns(T.nilable(String)) }
    def released_subscription; end
    # The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://docs.stripe.com/billing/subscriptions/subscription-schedules).
    sig { returns(String) }
    def status; end
    # ID of the subscription managed by the subscription schedule.
    sig { returns(T.nilable(T.any(String, ::Stripe::Subscription))) }
    def subscription; end
    # ID of the test clock this subscription schedule belongs to.
    sig { returns(T.nilable(T.any(String, ::Stripe::TestHelpers::TestClock))) }
    def test_clock; end
    # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
    sig {
      params(params: T.any(::Stripe::SubscriptionScheduleCancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::SubscriptionSchedule)
     }
    def cancel(params = {}, opts = {}); end

    # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
    sig {
      params(schedule: String, params: T.any(::Stripe::SubscriptionScheduleCancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::SubscriptionSchedule)
     }
    def self.cancel(schedule, params = {}, opts = {}); end

    # Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
    sig {
      params(params: T.any(::Stripe::SubscriptionScheduleCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::SubscriptionSchedule)
     }
    def self.create(params = {}, opts = {}); end

    # Retrieves the list of your subscription schedules.
    sig {
      params(params: T.any(::Stripe::SubscriptionScheduleListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::ListObject)
     }
    def self.list(params = {}, opts = {}); end

    # Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
    sig {
      params(params: T.any(::Stripe::SubscriptionScheduleReleaseParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::SubscriptionSchedule)
     }
    def release(params = {}, opts = {}); end

    # Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
    sig {
      params(schedule: String, params: T.any(::Stripe::SubscriptionScheduleReleaseParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::SubscriptionSchedule)
     }
    def self.release(schedule, params = {}, opts = {}); end

    # Updates an existing subscription schedule.
    sig {
      params(schedule: String, params: T.any(::Stripe::SubscriptionScheduleUpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::SubscriptionSchedule)
     }
    def self.update(schedule, params = {}, opts = {}); end
  end
end