Class: Orb::Models::Plan

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

Overview

See Also:

  • Orb::Resources::Plans#create

Defined Under Namespace

Modules: Adjustment, Status Classes: BasePlan, PlanPhase, Product, TrialConfig

Constant Summary collapse

Orb =

Returns:

  • (:PlanPhaseUsageDiscountAdjustment)

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(id:, created_at:, name:) ⇒ Object

Parameters:

  • id (String)
  • created_at (Time)
  • name (String)


# File 'lib/orb/models/plan.rb', line 398

Instance Attribute Details

#base_planOrb::Models::Plan::BasePlan?

Deprecated.

Legacy field representing the parent plan if the current plan is a 'child plan', overriding prices from the parent.

Parameters:

  • value (Orb::Plan::BasePlan, nil)

Returns:



26
# File 'lib/orb/models/plan.rb', line 26

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

#base_plan_idString?

Deprecated.

Legacy field representing the parent plan ID if the current plan is a 'child plan', overriding prices from the parent.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


35
# File 'lib/orb/models/plan.rb', line 35

required :base_plan_id, String, nil?: true

#created_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


40
# File 'lib/orb/models/plan.rb', line 40

required :created_at, Time

#currencyString

Deprecated.

An ISO 4217 currency string or custom pricing unit (credits) for this plan's prices.

Parameters:

  • value (String)

Returns:

  • (String)


49
# File 'lib/orb/models/plan.rb', line 49

required :currency, String

#default_invoice_memoString?

The default memo text on the invoices corresponding to subscriptions on this plan. Note that each subscription may configure its own memo.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


56
# File 'lib/orb/models/plan.rb', line 56

required :default_invoice_memo, String, nil?: true

#descriptionString

Parameters:

  • value (String)

Returns:

  • (String)


61
# File 'lib/orb/models/plan.rb', line 61

required :description, String

#discountOrb::Models::PercentageDiscount, ...

Deprecated.


67
# File 'lib/orb/models/plan.rb', line 67

required :discount, union: -> { Orb::Discount }, nil?: true

#external_plan_idString?

An optional user-defined ID for this plan resource, used throughout the system as an alias for this Plan. Use this field to identify a plan by an existing identifier in your system.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


75
# File 'lib/orb/models/plan.rb', line 75

required :external_plan_id, String, nil?: true

#idString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#invoicing_currencyString

An ISO 4217 currency string for which this plan is billed in. Matches currency unless currency is a custom pricing unit.

Parameters:

  • value (String)

Returns:

  • (String)


82
# File 'lib/orb/models/plan.rb', line 82

required :invoicing_currency, String

#maximumOrb::Models::Maximum?

Deprecated.

Parameters:

Returns:



88
# File 'lib/orb/models/plan.rb', line 88

required :maximum, -> { Orb::Maximum }, nil?: true

#maximum_amountString?

Deprecated.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


94
# File 'lib/orb/models/plan.rb', line 94

required :maximum_amount, String, nil?: true

#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})


103
# File 'lib/orb/models/plan.rb', line 103

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

#minimumOrb::Models::Minimum?

Deprecated.

Parameters:

Returns:



109
# File 'lib/orb/models/plan.rb', line 109

required :minimum, -> { Orb::Minimum }, nil?: true

#minimum_amountString?

Deprecated.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :minimum_amount, String, nil?: true

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


120
# File 'lib/orb/models/plan.rb', line 120

required :name, String

#net_termsInteger?

Determines the difference between the invoice issue date and the due date. A value of "0" here signifies that invoices are due on issue, whereas a value of "30" means that the customer has a month to pay the invoice before its overdue. Note that individual subscriptions or invoices may set a different net terms configuration.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


130
# File 'lib/orb/models/plan.rb', line 130

required :net_terms, Integer, nil?: true

#plan_phasesArray<Orb::Models::Plan::PlanPhase>?

Parameters:

  • value (::Array[Orb::Plan::PlanPhase], nil)

Returns:



135
# File 'lib/orb/models/plan.rb', line 135

required :plan_phases, -> { Orb::Internal::Type::ArrayOf[Orb::Plan::PlanPhase] }, nil?: true

#pricesArray<Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::BulkWithFilters, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::MatrixWithThresholdDiscounts, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::CumulativeGroupedAllocation, Orb::Models::Price::DailyCreditAllowance, Orb::Models::Price::MeteredAllowance, Orb::Models::Price::MinimumComposite, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput>

Prices for this plan. If the plan has phases, this includes prices across all phases of the plan.



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

required :prices, -> { Orb::Internal::Type::ArrayOf[union: Orb::Price] }

#productOrb::Models::Plan::Product

Parameters:

  • value (Orb::Plan::Product)

Returns:



147
# File 'lib/orb/models/plan.rb', line 147

required :product, -> { Orb::Plan::Product }

#statusSymbol, Orb::Models::Plan::Status

Parameters:

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

Returns:



152
# File 'lib/orb/models/plan.rb', line 152

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

#trial_configOrb::Models::Plan::TrialConfig

Parameters:

  • value (Orb::Plan::TrialConfig)

Returns:



157
# File 'lib/orb/models/plan.rb', line 157

required :trial_config, -> { Orb::Plan::TrialConfig }

#versionInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


162
# File 'lib/orb/models/plan.rb', line 162

required :version, Integer

Instance Method Details

#to_hash{

Returns:

  • ({)


107
# File 'sig/orb/models/plan.rbs', line 107

def to_hash: -> {