Class: Samsara::Types::ContinuousReadingAlertThresholdResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::ContinuousReadingAlertThresholdResponseBody
- Defined in:
- lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb
Overview
The threshold value of the alert for continuous readings.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#operation ⇒ Object
readonly
GREATER,INSIDE_RANGE,LESS,OUTSIDE_RANGE. -
#threshold ⇒ Long
readonly
The lower threshold of criticality.
-
#unit ⇒ Object
readonly
usgallongaseousfuel,volt,watthour. -
#upper_threshold ⇒ Long
readonly
The upper threshold of criticality.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::ContinuousReadingAlertThresholdResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(operation:, threshold:, unit: OMIT, upper_threshold: OMIT, additional_properties: nil) ⇒ Samsara::Types::ContinuousReadingAlertThresholdResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(operation:, threshold:, unit: OMIT, upper_threshold: OMIT, additional_properties: nil) ⇒ Samsara::Types::ContinuousReadingAlertThresholdResponseBody
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 55 def initialize(operation:, threshold:, unit: OMIT, upper_threshold: OMIT, additional_properties: nil) @operation = operation @threshold = threshold @unit = unit if unit != OMIT @upper_threshold = upper_threshold if upper_threshold != OMIT @additional_properties = additional_properties @_field_set = { "operation": operation, "threshold": threshold, "unit": unit, "upperThreshold": upper_threshold }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
31 32 33 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 31 def additional_properties @additional_properties end |
#operation ⇒ Object (readonly)
GREATER, INSIDE_RANGE, LESS, OUTSIDE_RANGE
13 14 15 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 13 def operation @operation end |
#threshold ⇒ Long (readonly)
Returns The lower threshold of criticality.
15 16 17 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 15 def threshold @threshold end |
#unit ⇒ Object (readonly)
usgallongaseousfuel, volt, watthour
27 28 29 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 27 def unit @unit end |
#upper_threshold ⇒ Long (readonly)
Returns The upper threshold of criticality. Required for RANGE operations.
29 30 31 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 29 def upper_threshold @upper_threshold end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::ContinuousReadingAlertThresholdResponseBody
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 70 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) operation = parsed_json["operation"] threshold = parsed_json["threshold"] unit = parsed_json["unit"] upper_threshold = parsed_json["upperThreshold"] new( operation: operation, threshold: threshold, unit: unit, upper_threshold: upper_threshold, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
98 99 100 101 102 103 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 98 def self.validate_raw(obj:) obj.operation.is_a?(Samsara::Types::ContinuousReadingAlertThresholdResponseBodyOperation) != false || raise("Passed value for field obj.operation is not the expected type, validation failed.") obj.threshold.is_a?(Long) != false || raise("Passed value for field obj.threshold is not the expected type, validation failed.") obj.unit&.is_a?(Samsara::Types::ContinuousReadingAlertThresholdResponseBodyUnit) != false || raise("Passed value for field obj.unit is not the expected type, validation failed.") obj.upper_threshold&.is_a?(Long) != false || raise("Passed value for field obj.upper_threshold is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
89 90 91 |
# File 'lib/samsara_api/types/continuous_reading_alert_threshold_response_body.rb', line 89 def to_json @_field_set&.to_json end |