Class: Samsara::Types::EnumReadingAlertThresholdResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::EnumReadingAlertThresholdResponseBody
- Defined in:
- lib/samsara_api/types/enum_reading_alert_threshold_response_body.rb
Overview
The threshold value of the alert for enum readings.
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::EnumReadingAlertThresholdResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(number: OMIT, symbol: OMIT, additional_properties: nil) ⇒ Samsara::Types::EnumReadingAlertThresholdResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(number: OMIT, symbol: OMIT, additional_properties: nil) ⇒ Samsara::Types::EnumReadingAlertThresholdResponseBody
25 26 27 28 29 30 31 32 |
# File 'lib/samsara_api/types/enum_reading_alert_threshold_response_body.rb', line 25 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.
14 15 16 |
# File 'lib/samsara_api/types/enum_reading_alert_threshold_response_body.rb', line 14 def additional_properties @additional_properties end |
#number ⇒ Long (readonly)
Returns The numeric representation of the enum value.
10 11 12 |
# File 'lib/samsara_api/types/enum_reading_alert_threshold_response_body.rb', line 10 def number @number end |
#symbol ⇒ String (readonly)
Returns The symbol representation of the enum value.
12 13 14 |
# File 'lib/samsara_api/types/enum_reading_alert_threshold_response_body.rb', line 12 def symbol @symbol end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::EnumReadingAlertThresholdResponseBody
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/samsara_api/types/enum_reading_alert_threshold_response_body.rb', line 38 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
61 62 63 64 |
# File 'lib/samsara_api/types/enum_reading_alert_threshold_response_body.rb', line 61 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
52 53 54 |
# File 'lib/samsara_api/types/enum_reading_alert_threshold_response_body.rb', line 52 def to_json @_field_set&.to_json end |