Class: ModernTreasury::Models::InvoiceCreateParams::InvoiceLineItem

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/modern_treasury/models/invoice_create_params.rb,
sig/modern_treasury/models/invoice_create_params.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

#initializeObject



288
# File 'sig/modern_treasury/models/invoice_create_params.rbs', line 288

def initialize: (

Instance Attribute Details

#descriptionString?

An optional free-form description of the line item.

Parameters:

  • (String)

Returns:

  • (String, nil)


357
# File 'lib/modern_treasury/models/invoice_create_params.rb', line 357

optional :description, String

#directionString?

Either debit or credit. debit indicates that a client owes the business money and increases the invoice's total_amount due. credit has the opposite intention and effect.

Parameters:

  • (String)

Returns:

  • (String, nil)


365
# File 'lib/modern_treasury/models/invoice_create_params.rb', line 365

optional :direction, String

#metadataHash{Symbol=>String}?

Additional data represented as key-value pairs. Both the key and value must be strings.

Parameters:

  • (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String}, nil)


372
# File 'lib/modern_treasury/models/invoice_create_params.rb', line 372

optional :metadata, ModernTreasury::Internal::Type::HashOf[String]

#nameString

The name of the line item, typically a product or SKU name.

Parameters:

  • value (String)

Returns:

  • (String)


344
# File 'lib/modern_treasury/models/invoice_create_params.rb', line 344

required :name, String

#quantityInteger?

The number of units of a product or service that this line item is for. Must be a whole number. Defaults to 1 if not provided.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


379
# File 'lib/modern_treasury/models/invoice_create_params.rb', line 379

optional :quantity, Integer

#unit_amountInteger

The cost per unit of the product or service that this line item is for, specified in the invoice currency's smallest unit.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


351
# File 'lib/modern_treasury/models/invoice_create_params.rb', line 351

required :unit_amount, Integer

#unit_amount_decimalString?

The cost per unit of the product or service that this line item is for, specified in the invoice currency's smallest unit. Accepts decimal strings with up to 12 decimals

Parameters:

  • (String)

Returns:

  • (String, nil)


387
# File 'lib/modern_treasury/models/invoice_create_params.rb', line 387

optional :unit_amount_decimal, String

Instance Method Details

#to_hash{

Returns:

  • ({)


298
# File 'sig/modern_treasury/models/invoice_create_params.rbs', line 298

def to_hash: -> {