Class: Paid::AgentPricePointTiers
- Inherits:
-
Object
- Object
- Paid::AgentPricePointTiers
- Defined in:
- lib/paid_ruby/types/agent_price_point_tiers.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #max_quantity ⇒ Float readonly
- #min_quantity ⇒ Float readonly
- #unit_price ⇒ Float readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(min_quantity: OMIT, max_quantity: OMIT, unit_price:, additional_properties: nil) ⇒ Paid::AgentPricePointTiers constructor
- #to_json ⇒ String
Constructor Details
#initialize(min_quantity: OMIT, max_quantity: OMIT, unit_price:, additional_properties: nil) ⇒ Paid::AgentPricePointTiers
26 27 28 29 30 31 32 33 34 |
# File 'lib/paid_ruby/types/agent_price_point_tiers.rb', line 26 def initialize(min_quantity: OMIT, max_quantity: OMIT, unit_price:, additional_properties: nil) @min_quantity = min_quantity if min_quantity != OMIT @max_quantity = max_quantity if max_quantity != OMIT @unit_price = unit_price @additional_properties = additional_properties @_field_set = { "minQuantity": min_quantity, "maxQuantity": max_quantity, "unitPrice": unit_price }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/paid_ruby/types/agent_price_point_tiers.rb', line 14 def additional_properties @additional_properties end |
#max_quantity ⇒ Float (readonly)
10 11 12 |
# File 'lib/paid_ruby/types/agent_price_point_tiers.rb', line 10 def max_quantity @max_quantity end |
#min_quantity ⇒ Float (readonly)
8 9 10 |
# File 'lib/paid_ruby/types/agent_price_point_tiers.rb', line 8 def min_quantity @min_quantity end |
#unit_price ⇒ Float (readonly)
12 13 14 |
# File 'lib/paid_ruby/types/agent_price_point_tiers.rb', line 12 def unit_price @unit_price end |
Class Method Details
.from_json(json_object:) ⇒ Paid::AgentPricePointTiers
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/paid_ruby/types/agent_price_point_tiers.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) min_quantity = parsed_json["minQuantity"] max_quantity = parsed_json["maxQuantity"] unit_price = parsed_json["unitPrice"] new( min_quantity: min_quantity, max_quantity: max_quantity, unit_price: unit_price, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
64 65 66 67 68 |
# File 'lib/paid_ruby/types/agent_price_point_tiers.rb', line 64 def self.validate_raw(obj:) obj.min_quantity&.is_a?(Float) != false || raise("Passed value for field obj.min_quantity is not the expected type, validation failed.") obj.max_quantity&.is_a?(Float) != false || raise("Passed value for field obj.max_quantity is not the expected type, validation failed.") obj.unit_price.is_a?(Float) != false || raise("Passed value for field obj.unit_price is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
55 56 57 |
# File 'lib/paid_ruby/types/agent_price_point_tiers.rb', line 55 def to_json @_field_set&.to_json end |