Class: MetronomeSDK::Models::V1::Contracts::QuantityConversion
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- MetronomeSDK::Models::V1::Contracts::QuantityConversion
- Defined in:
- lib/metronome_sdk/models/v1/contracts/quantity_conversion.rb
Defined Under Namespace
Modules: Operation
Instance Attribute Summary collapse
-
#conversion_factor ⇒ Float
The factor to multiply or divide the quantity by.
-
#name ⇒ String?
Optional name for this conversion.
-
#operation ⇒ Symbol, MetronomeSDK::Models::V1::Contracts::QuantityConversion::Operation
The operation to perform on the quantity.
Instance Method Summary collapse
-
#initialize(conversion_factor: , operation: , name: nil) ⇒ Object
constructor
Optional.
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(conversion_factor: , operation: , name: nil) ⇒ Object
Optional. Only valid for USAGE products. If provided, the quantity will be converted using the provided conversion factor and operation. For example, if the operation is “multiply” and the conversion factor is 100, then the quantity will be multiplied by 100. This can be used in cases where data is sent in one unit and priced in another. For example, data could be sent in MB and priced in GB. In this case, the conversion factor would be 1024 and the operation would be “divide”.
|
|
# File 'lib/metronome_sdk/models/v1/contracts/quantity_conversion.rb', line 26
|
Instance Attribute Details
#conversion_factor ⇒ Float
The factor to multiply or divide the quantity by.
12 |
# File 'lib/metronome_sdk/models/v1/contracts/quantity_conversion.rb', line 12 required :conversion_factor, Float |
#name ⇒ String?
Optional name for this conversion.
24 |
# File 'lib/metronome_sdk/models/v1/contracts/quantity_conversion.rb', line 24 optional :name, String |
#operation ⇒ Symbol, MetronomeSDK::Models::V1::Contracts::QuantityConversion::Operation
The operation to perform on the quantity
18 |
# File 'lib/metronome_sdk/models/v1/contracts/quantity_conversion.rb', line 18 required :operation, enum: -> { MetronomeSDK::V1::Contracts::QuantityConversion::Operation } |