Class: Samsara::Types::GetWorkflowIncidentResponseObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::GetWorkflowIncidentResponseObjectResponseBody
- Defined in:
- lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#conditions ⇒ Array<Samsara::Types::WorkflowIncidentConditionObjectResponseBody>
readonly
An array of conditions associated with the incident.
-
#configuration_id ⇒ String
readonly
Unique ID of the alert configuration.
-
#happened_at_time ⇒ String
readonly
Time and date that the alert incident occurred in RFC 3339 format.
-
#incident_url ⇒ String
readonly
Url of alert incident in the cloud dashboard.
-
#is_resolved ⇒ Boolean
readonly
Indicates whether the incident is resolved or not.
-
#resolved_at_time ⇒ String
readonly
Time and date that the alert incident was resolved in RFC 3339 format.
-
#updated_at_time ⇒ String
readonly
Time and date that the alert incident updated in RFC 3339 format.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::GetWorkflowIncidentResponseObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(conditions:, configuration_id:, happened_at_time:, incident_url:, is_resolved:, resolved_at_time: OMIT, updated_at_time:, additional_properties: nil) ⇒ Samsara::Types::GetWorkflowIncidentResponseObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(conditions:, configuration_id:, happened_at_time:, incident_url:, is_resolved:, resolved_at_time: OMIT, updated_at_time:, additional_properties: nil) ⇒ Samsara::Types::GetWorkflowIncidentResponseObjectResponseBody
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 40 def initialize(conditions:, configuration_id:, happened_at_time:, incident_url:, is_resolved:, resolved_at_time: OMIT, updated_at_time:, additional_properties: nil) @conditions = conditions @configuration_id = configuration_id @happened_at_time = happened_at_time @incident_url = incident_url @is_resolved = is_resolved @resolved_at_time = resolved_at_time if resolved_at_time != OMIT @updated_at_time = updated_at_time @additional_properties = additional_properties @_field_set = { "conditions": conditions, "configurationId": configuration_id, "happenedAtTime": happened_at_time, "incidentUrl": incident_url, "isResolved": is_resolved, "resolvedAtTime": resolved_at_time, "updatedAtTime": updated_at_time }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 24 def additional_properties @additional_properties end |
#conditions ⇒ Array<Samsara::Types::WorkflowIncidentConditionObjectResponseBody> (readonly)
Returns An array of conditions associated with the incident.
10 11 12 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 10 def conditions @conditions end |
#configuration_id ⇒ String (readonly)
Returns Unique ID of the alert configuration.
12 13 14 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 12 def configuration_id @configuration_id end |
#happened_at_time ⇒ String (readonly)
Returns Time and date that the alert incident occurred in RFC 3339 format.
14 15 16 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 14 def happened_at_time @happened_at_time end |
#incident_url ⇒ String (readonly)
Returns Url of alert incident in the cloud dashboard.
16 17 18 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 16 def incident_url @incident_url end |
#is_resolved ⇒ Boolean (readonly)
Returns Indicates whether the incident is resolved or not.
18 19 20 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 18 def is_resolved @is_resolved end |
#resolved_at_time ⇒ String (readonly)
Returns Time and date that the alert incident was resolved in RFC 3339 format.
20 21 22 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 20 def resolved_at_time @resolved_at_time end |
#updated_at_time ⇒ String (readonly)
Returns Time and date that the alert incident updated in RFC 3339 format.
22 23 24 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 22 def updated_at_time @updated_at_time end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::GetWorkflowIncidentResponseObjectResponseBody
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 58 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) conditions = parsed_json["conditions"]&.map do | item | item = item.to_json Samsara::Types::WorkflowIncidentConditionObjectResponseBody.from_json(json_object: item) end configuration_id = parsed_json["configurationId"] happened_at_time = parsed_json["happenedAtTime"] incident_url = parsed_json["incidentUrl"] is_resolved = parsed_json["isResolved"] resolved_at_time = parsed_json["resolvedAtTime"] updated_at_time = parsed_json["updatedAtTime"] new( conditions: conditions, configuration_id: configuration_id, happened_at_time: happened_at_time, incident_url: incident_url, is_resolved: is_resolved, resolved_at_time: resolved_at_time, updated_at_time: updated_at_time, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
95 96 97 98 99 100 101 102 103 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 95 def self.validate_raw(obj:) obj.conditions.is_a?(Array) != false || raise("Passed value for field obj.conditions is not the expected type, validation failed.") obj.configuration_id.is_a?(String) != false || raise("Passed value for field obj.configuration_id is not the expected type, validation failed.") obj.happened_at_time.is_a?(String) != false || raise("Passed value for field obj.happened_at_time is not the expected type, validation failed.") obj.incident_url.is_a?(String) != false || raise("Passed value for field obj.incident_url is not the expected type, validation failed.") obj.is_resolved.is_a?(Boolean) != false || raise("Passed value for field obj.is_resolved is not the expected type, validation failed.") obj.resolved_at_time&.is_a?(String) != false || raise("Passed value for field obj.resolved_at_time is not the expected type, validation failed.") obj.updated_at_time.is_a?(String) != false || raise("Passed value for field obj.updated_at_time is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
86 87 88 |
# File 'lib/samsara_api/types/get_workflow_incident_response_object_response_body.rb', line 86 def to_json @_field_set&.to_json end |