Class: Samsara::Types::ReadingTriggerEnumValueObjectRequestBody
- Inherits:
-
Object
- Object
- Samsara::Types::ReadingTriggerEnumValueObjectRequestBody
- Defined in:
- lib/samsara_api/types/reading_trigger_enum_value_object_request_body.rb
Overview
threshold may be set.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#number ⇒ Long
readonly
The numeric representation of the enum value.
-
#symbol ⇒ String
readonly
The symbol representation of the enum value.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::ReadingTriggerEnumValueObjectRequestBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(number: OMIT, symbol: OMIT, additional_properties: nil) ⇒ Samsara::Types::ReadingTriggerEnumValueObjectRequestBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(number: OMIT, symbol: OMIT, additional_properties: nil) ⇒ Samsara::Types::ReadingTriggerEnumValueObjectRequestBody
26 27 28 29 30 31 32 33 |
# File 'lib/samsara_api/types/reading_trigger_enum_value_object_request_body.rb', line 26 def initialize(number: OMIT, symbol: OMIT, additional_properties: nil) @number = number if number != OMIT @symbol = symbol if symbol != OMIT @additional_properties = additional_properties @_field_set = { "number": number, "symbol": symbol }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/samsara_api/types/reading_trigger_enum_value_object_request_body.rb', line 15 def additional_properties @additional_properties end |
#number ⇒ Long (readonly)
Returns The numeric representation of the enum value.
11 12 13 |
# File 'lib/samsara_api/types/reading_trigger_enum_value_object_request_body.rb', line 11 def number @number end |
#symbol ⇒ String (readonly)
Returns The symbol representation of the enum value.
13 14 15 |
# File 'lib/samsara_api/types/reading_trigger_enum_value_object_request_body.rb', line 13 def symbol @symbol end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::ReadingTriggerEnumValueObjectRequestBody
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/samsara_api/types/reading_trigger_enum_value_object_request_body.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) number = parsed_json["number"] symbol = parsed_json["symbol"] new( number: number, symbol: symbol, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
63 64 65 66 |
# File 'lib/samsara_api/types/reading_trigger_enum_value_object_request_body.rb', line 63 def self.validate_raw(obj:) obj.number&.is_a?(Long) != false || raise("Passed value for field obj.number is not the expected type, validation failed.") obj.symbol&.is_a?(String) != false || raise("Passed value for field obj.symbol is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
54 55 56 |
# File 'lib/samsara_api/types/reading_trigger_enum_value_object_request_body.rb', line 54 def to_json @_field_set&.to_json end |