Class: Orb::Models::InvoiceCreateParams::LineItem

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

Defined Under Namespace

Modules: ModelType

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(end_date:, item_id:, model_type:, name:, quantity:, start_date:, unit_config:) ⇒ Object

Parameters:

  • end_date (Date)

    A date string to specify the line item's end date in the customer's timezone.

  • item_id (String)
  • model_type (Symbol, Orb::Models::InvoiceCreateParams::LineItem::ModelType)
  • name (String)

    The name of the line item.

  • quantity (Float)

    The number of units on the line item

  • start_date (Date)

    A date string to specify the line item's start date in the customer's timezone.

  • unit_config (Orb::Models::UnitConfig)

    Configuration for unit pricing



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/orb/models/invoice_create_params.rb', line 128

class LineItem < Orb::Internal::Type::BaseModel
  # @!attribute end_date
  #   A date string to specify the line item's end date in the customer's timezone.
  #
  #   @return [Date]
  required :end_date, Date

  # @!attribute item_id
  #
  #   @return [String]
  required :item_id, String

  # @!attribute model_type
  #
  #   @return [Symbol, Orb::Models::InvoiceCreateParams::LineItem::ModelType]
  required :model_type, enum: -> { Orb::InvoiceCreateParams::LineItem::ModelType }

  # @!attribute name
  #   The name of the line item.
  #
  #   @return [String]
  required :name, String

  # @!attribute quantity
  #   The number of units on the line item
  #
  #   @return [Float]
  required :quantity, Float

  # @!attribute start_date
  #   A date string to specify the line item's start date in the customer's timezone.
  #
  #   @return [Date]
  required :start_date, Date

  # @!attribute unit_config
  #   Configuration for unit pricing
  #
  #   @return [Orb::Models::UnitConfig]
  required :unit_config, -> { Orb::UnitConfig }

  # @!method initialize(end_date:, item_id:, model_type:, name:, quantity:, start_date:, unit_config:)
  #   @param end_date [Date] A date string to specify the line item's end date in the customer's timezone.
  #
  #   @param item_id [String]
  #
  #   @param model_type [Symbol, Orb::Models::InvoiceCreateParams::LineItem::ModelType]
  #
  #   @param name [String] The name of the line item.
  #
  #   @param quantity [Float] The number of units on the line item
  #
  #   @param start_date [Date] A date string to specify the line item's start date in the customer's timezone.
  #
  #   @param unit_config [Orb::Models::UnitConfig] Configuration for unit pricing

  # @see Orb::Models::InvoiceCreateParams::LineItem#model_type
  module ModelType
    extend Orb::Internal::Type::Enum

    UNIT = :unit

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#end_dateDate

A date string to specify the line item's end date in the customer's timezone.

Parameters:

  • value (Date)

Returns:

  • (Date)


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

required :end_date, Date

#item_idString

Parameters:

  • value (String)

Returns:

  • (String)


138
# File 'lib/orb/models/invoice_create_params.rb', line 138

required :item_id, String

#model_typeSymbol, Orb::Models::InvoiceCreateParams::LineItem::ModelType

Parameters:

  • value (Orb::Models::InvoiceCreateParams::LineItem::model_type)

Returns:



143
# File 'lib/orb/models/invoice_create_params.rb', line 143

required :model_type, enum: -> { Orb::InvoiceCreateParams::LineItem::ModelType }

#nameString

The name of the line item.

Parameters:

  • value (String)

Returns:

  • (String)


149
# File 'lib/orb/models/invoice_create_params.rb', line 149

required :name, String

#quantityFloat

The number of units on the line item

Parameters:

  • value (Float)

Returns:

  • (Float)


155
# File 'lib/orb/models/invoice_create_params.rb', line 155

required :quantity, Float

#start_dateDate

A date string to specify the line item's start date in the customer's timezone.

Parameters:

  • value (Date)

Returns:

  • (Date)


161
# File 'lib/orb/models/invoice_create_params.rb', line 161

required :start_date, Date

#unit_configOrb::Models::UnitConfig

Configuration for unit pricing

Parameters:

Returns:



167
# File 'lib/orb/models/invoice_create_params.rb', line 167

required :unit_config, -> { Orb::UnitConfig }

Instance Method Details

#to_hash{

Returns:

  • ({)


118
# File 'sig/orb/models/invoice_create_params.rbs', line 118

def to_hash: -> {