Class: Orb::Models::InvoiceLevelDiscount::TieredPercentage::Tier

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

Instance Attribute 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(tiers:, applies_to_price_ids: nil, filters: nil, reason: nil, discount_type: :tiered_percentage) ⇒ Object

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

Parameters:

  • tiers (Array<Orb::Models::InvoiceLevelDiscount::TieredPercentage::Tier>) —

    Only available if discount_type is tiered_percentage. The ordered, contiguous

  • applies_to_price_ids (Array<String>, nil) (defaults to: nil) —

    List of price_ids that this discount applies to. For plan/plan phase discounts,

  • filters (Array<Orb::Models::InvoiceLevelDiscount::TieredPercentage::Filter>, nil) (defaults to: nil) —

    The filters that determine which prices to apply this discount to.

  • reason (String, nil) (defaults to: nil)
  • discount_type (Symbol, :tiered_percentage) (defaults to: :tiered_percentage)


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/orb/models/invoice_level_discount.rb', line 66

class Tier < Orb::Internal::Type::BaseModel
  # @!attribute lower_bound
  #   Exclusive lower bound of cumulative spend for this tier.
  #
  #   @return [Float]
  required :lower_bound, Float

  # @!attribute percentage
  #   The percentage (between 0 and 1) discounted from spend that falls within this
  #   tier.
  #
  #   @return [Float]
  required :percentage, Float

  # @!attribute upper_bound
  #   Inclusive upper bound of cumulative spend for this tier; null for the final
  #   open-ended tier.
  #
  #   @return [Float, nil]
  optional :upper_bound, Float, nil?: true

  # @!method initialize(lower_bound:, percentage:, upper_bound: nil)
  #   Some parameter documentations has been truncated, see
  #   {Orb::Models::InvoiceLevelDiscount::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.
  #
  #   @param lower_bound [Float] Exclusive lower bound of cumulative spend for this tier.
  #
  #   @param percentage [Float] The percentage (between 0 and 1) discounted from spend that falls within this ti
  #
  #   @param upper_bound [Float, nil] Inclusive upper bound of cumulative spend for this tier; null for the final open
end

Instance Attribute Details

#lower_bound ⇒ Float

Exclusive lower bound of cumulative spend for this tier.

Parameters:

  • value (Float)

Returns:

  • (Float)


71
# File 'lib/orb/models/invoice_level_discount.rb', line 71

required :lower_bound, Float

#percentage ⇒ Float

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

Parameters:

  • value (Float)

Returns:

  • (Float)


78
# File 'lib/orb/models/invoice_level_discount.rb', line 78

required :percentage, Float

#upper_bound ⇒ Float?

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

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


85
# File 'lib/orb/models/invoice_level_discount.rb', line 85

optional :upper_bound, Float, nil?: true

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


64
# File 'sig/orb/models/invoice_level_discount.rbs', line 64

def to_hash: -> {