Class: Samsara::Types::WorkflowIncidentConditionObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::WorkflowIncidentConditionObjectResponseBody
- Defined in:
- lib/samsara_api/types/workflow_incident_condition_object_response_body.rb
Overview
vary depending on the condition.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#description ⇒ String
readonly
Descriptive name of the condition.
- #details ⇒ Samsara::Types::WorkflowIncidentDetailsObjectResponseBody readonly
-
#trigger_id ⇒ Long
readonly
Unique identifier describing the type of condition being represented.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::WorkflowIncidentConditionObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(description:, details:, trigger_id:, additional_properties: nil) ⇒ Samsara::Types::WorkflowIncidentConditionObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(description:, details:, trigger_id:, additional_properties: nil) ⇒ Samsara::Types::WorkflowIncidentConditionObjectResponseBody
30 31 32 33 34 35 36 |
# File 'lib/samsara_api/types/workflow_incident_condition_object_response_body.rb', line 30 def initialize(description:, details:, trigger_id:, additional_properties: nil) @description = description @details = details @trigger_id = trigger_id @additional_properties = additional_properties @_field_set = { "description": description, "details": details, "triggerId": trigger_id } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/samsara_api/types/workflow_incident_condition_object_response_body.rb', line 18 def additional_properties @additional_properties end |
#description ⇒ String (readonly)
Returns Descriptive name of the condition.
12 13 14 |
# File 'lib/samsara_api/types/workflow_incident_condition_object_response_body.rb', line 12 def description @description end |
#details ⇒ Samsara::Types::WorkflowIncidentDetailsObjectResponseBody (readonly)
14 15 16 |
# File 'lib/samsara_api/types/workflow_incident_condition_object_response_body.rb', line 14 def details @details end |
#trigger_id ⇒ Long (readonly)
Returns Unique identifier describing the type of condition being represented.
16 17 18 |
# File 'lib/samsara_api/types/workflow_incident_condition_object_response_body.rb', line 16 def trigger_id @trigger_id end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::WorkflowIncidentConditionObjectResponseBody
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/samsara_api/types/workflow_incident_condition_object_response_body.rb', line 42 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) description = parsed_json["description"] unless parsed_json["details"].nil? details = parsed_json["details"].to_json details = Samsara::Types::WorkflowIncidentDetailsObjectResponseBody.from_json(json_object: details) else details = nil end trigger_id = parsed_json["triggerId"] new( description: description, details: details, trigger_id: trigger_id, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
73 74 75 76 77 |
# File 'lib/samsara_api/types/workflow_incident_condition_object_response_body.rb', line 73 def self.validate_raw(obj:) obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") Samsara::Types::WorkflowIncidentDetailsObjectResponseBody.validate_raw(obj: obj.details) obj.trigger_id.is_a?(Long) != false || raise("Passed value for field obj.trigger_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
64 65 66 |
# File 'lib/samsara_api/types/workflow_incident_condition_object_response_body.rb', line 64 def to_json @_field_set&.to_json end |