Class: Samsara::Types::WorkflowIncidentConditionObjectResponseBody

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description:, details:, trigger_id:, additional_properties: nil) ⇒ Samsara::Types::WorkflowIncidentConditionObjectResponseBody

Parameters:

  • description (String)

    Descriptive name of the condition.

  • details (Samsara::Types::WorkflowIncidentDetailsObjectResponseBody)
  • trigger_id (Long)

    Unique identifier describing the type of condition being represented.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#descriptionString (readonly)

Returns Descriptive name of the condition.

Returns:

  • (String)

    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

#detailsSamsara::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_idLong (readonly)

Returns Unique identifier describing the type of condition being represented.

Returns:

  • (Long)

    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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (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