Class: Orb::Models::Subscription

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/orb/models/subscription.rb,
sig/orb/models/subscription.rbs

Overview

See Also:

  • Orb::Resources::Subscriptions#update

Defined Under Namespace

Modules: DiscountInterval, Status

Constant Summary collapse

Orb =

Returns:

  • (:AmountDiscountInterval)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(lower_bound:, percentage:, upper_bound: nil) ⇒ Object

Some parameter documentations has been truncated, see Orb::Models::Subscription::DiscountInterval::TieredPercentage::Tier for more details.

One band of a tiered percentage discount. Bounds are denominated in the discount's currency. lower_bound is the exclusive start of the band and upper_bound is the inclusive end; upper_bound is null only for the open-ended final tier.

Parameters:

  • lower_bound (Float)

    Exclusive lower bound of cumulative spend for this tier.

  • percentage (Float)

    The percentage (between 0 and 1) discounted from spend that falls within this ti

  • upper_bound (Float, nil) (defaults to: nil)

    Inclusive upper bound of cumulative spend for this tier; null for the final open



# File 'lib/orb/models/subscription.rb', line 445

Instance Attribute Details

#active_plan_phase_orderInteger?

The current plan phase that is active, only if the subscription's plan has phases.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


17
# File 'lib/orb/models/subscription.rb', line 17

required :active_plan_phase_order, Integer, nil?: true

#adjustment_intervalsArray<Orb::Models::AdjustmentInterval>

The adjustment intervals for this subscription sorted by the start_date of the adjustment interval.

Parameters:

Returns:



24
# File 'lib/orb/models/subscription.rb', line 24

required :adjustment_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::AdjustmentInterval] }

#auto_collectionBoolean?

Determines whether issued invoices for this subscription will automatically be charged with the saved payment method on the due date. This property defaults to the plan's behavior. If null, defaults to the customer's setting.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


32
# File 'lib/orb/models/subscription.rb', line 32

required :auto_collection, Orb::Internal::Type::Boolean, nil?: true

#auto_issuanceBoolean?

Determines whether invoices for this subscription will be automatically issued. This resolves the effective setting for the subscription: a subscription-level override if set, otherwise the customer-level setting, otherwise the account-level default.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


41
# File 'lib/orb/models/subscription.rb', line 41

required :auto_issuance, Orb::Internal::Type::Boolean, nil?: true

#billing_cycle_anchor_configurationOrb::Models::BillingCycleAnchorConfiguration



46
# File 'lib/orb/models/subscription.rb', line 46

required :billing_cycle_anchor_configuration, -> { Orb::BillingCycleAnchorConfiguration }

#billing_cycle_dayInteger

The day of the month on which the billing cycle is anchored. If the maximum number of days in a month is greater than this value, the last day of the month is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing period begins on the 30th.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


55
# File 'lib/orb/models/subscription.rb', line 55

required :billing_cycle_day, Integer

#created_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


60
# File 'lib/orb/models/subscription.rb', line 60

required :created_at, Time

#current_billing_period_end_dateTime?

The end of the current billing period. This is an exclusive timestamp, such that the instant returned is not part of the billing period. Set to null for subscriptions that are not currently active.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


68
# File 'lib/orb/models/subscription.rb', line 68

required :current_billing_period_end_date, Time, nil?: true

#current_billing_period_start_dateTime?

The start date of the current billing period. This is an inclusive timestamp; the instant returned is exactly the beginning of the billing period. Set to null if the subscription is not currently active.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


76
# File 'lib/orb/models/subscription.rb', line 76

required :current_billing_period_start_date, Time, nil?: true

#customerOrb::Models::Customer

A customer is a buyer of your products, and the other party to the billing relationship.

In Orb, customers are assigned system generated identifiers automatically, but it's often desirable to have these match existing identifiers in your system. To avoid having to denormalize Orb ID information, you can pass in an external_customer_id with your own identifier. See Customer ID Aliases for further information about how these aliases work in Orb.

In addition to having an identifier in your system, a customer may exist in a payment provider solution like Stripe. Use the payment_provider_id and the payment_provider enum field to express this mapping.

A customer also has a timezone (from the standard IANA timezone database), which defaults to your account's timezone. See Timezone localization for information on what this timezone parameter influences within Orb.

Parameters:

Returns:



99
# File 'lib/orb/models/subscription.rb', line 99

required :customer, -> { Orb::Customer }

#default_invoice_memoString?

Determines the default memo on this subscriptions' invoices. Note that if this is not provided, it is determined by the plan configuration.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


106
# File 'lib/orb/models/subscription.rb', line 106

required :default_invoice_memo, String, nil?: true

#discount_intervalsArray<Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval, Orb::Models::Subscription::DiscountInterval::TieredPercentage>

Deprecated.

The discount intervals for this subscription sorted by the start_date. This field is deprecated in favor of adjustment_intervals.



115
116
# File 'lib/orb/models/subscription.rb', line 115

required :discount_intervals,
-> { Orb::Internal::Type::ArrayOf[union: Orb::Subscription::DiscountInterval] }

#end_dateTime?

The date Orb stops billing for this subscription.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


122
# File 'lib/orb/models/subscription.rb', line 122

required :end_date, Time, nil?: true

#fixed_fee_quantity_scheduleArray<Orb::Models::FixedFeeQuantityScheduleEntry>



127
128
# File 'lib/orb/models/subscription.rb', line 127

required :fixed_fee_quantity_schedule,
-> { Orb::Internal::Type::ArrayOf[Orb::FixedFeeQuantityScheduleEntry] }

#idString

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/orb/models/subscription.rb', line 10

required :id, String

#invoicing_thresholdString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


133
# File 'lib/orb/models/subscription.rb', line 133

required :invoicing_threshold, String, nil?: true

#maximum_intervalsArray<Orb::Models::MaximumInterval>

Deprecated.

The maximum intervals for this subscription sorted by the start_date. This field is deprecated in favor of adjustment_intervals.

Parameters:

Returns:



142
# File 'lib/orb/models/subscription.rb', line 142

required :maximum_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::MaximumInterval] }

#metadataHash{Symbol=>String}

User specified key-value pairs for the resource. If not present, this defaults to an empty dictionary. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

Parameters:

  • value (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String})


151
# File 'lib/orb/models/subscription.rb', line 151

required :metadata, Orb::Internal::Type::HashOf[String]

#minimum_intervalsArray<Orb::Models::MinimumInterval>

Deprecated.

The minimum intervals for this subscription sorted by the start_date. This field is deprecated in favor of adjustment_intervals.

Parameters:

Returns:



160
# File 'lib/orb/models/subscription.rb', line 160

required :minimum_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::MinimumInterval] }

#nameString

The name of the subscription.

Parameters:

  • value (String)

Returns:

  • (String)


166
# File 'lib/orb/models/subscription.rb', line 166

required :name, String

#net_termsInteger

Determines the difference between the invoice issue date for subscription invoices as the date that they are due. A value of 0 here represents that the invoice is due on issue, whereas a value of 30 represents that the customer has a month to pay the invoice.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


175
# File 'lib/orb/models/subscription.rb', line 175

required :net_terms, Integer

#pending_subscription_changeOrb::Models::SubscriptionChangeMinified?

A pending subscription change if one exists on this subscription.



181
# File 'lib/orb/models/subscription.rb', line 181

required :pending_subscription_change, -> { Orb::SubscriptionChangeMinified }, nil?: true

#planOrb::Models::Plan?

The Plan resource represents a plan that can be subscribed to by a customer. Plans define the billing behavior of the subscription. You can see more about how to configure prices in the Price resource.

Parameters:

Returns:



190
# File 'lib/orb/models/subscription.rb', line 190

required :plan, -> { Orb::Plan }, nil?: true

#price_intervalsArray<Orb::Models::PriceInterval>

The price intervals for this subscription.

Parameters:

Returns:



196
# File 'lib/orb/models/subscription.rb', line 196

required :price_intervals, -> { Orb::Internal::Type::ArrayOf[Orb::PriceInterval] }

#redeemed_couponOrb::Models::CouponRedemption?

Parameters:

Returns:



201
# File 'lib/orb/models/subscription.rb', line 201

required :redeemed_coupon, -> { Orb::CouponRedemption }, nil?: true

#start_dateTime

The date Orb starts billing for this subscription.

Parameters:

  • value (Time)

Returns:

  • (Time)


207
# File 'lib/orb/models/subscription.rb', line 207

required :start_date, Time

#statusSymbol, Orb::Models::Subscription::Status

Parameters:

  • value (Orb::Models::Subscription::status)

Returns:



212
# File 'lib/orb/models/subscription.rb', line 212

required :status, enum: -> { Orb::Subscription::Status }

#trial_infoOrb::Models::SubscriptionTrialInfo



217
# File 'lib/orb/models/subscription.rb', line 217

required :trial_info, -> { Orb::SubscriptionTrialInfo }

Instance Method Details

#to_hash{

Returns:

  • ({)


123
# File 'sig/orb/models/subscription.rbs', line 123

def to_hash: -> {