Class: Samsara::Types::SafetySettingsGetSafetySettingsResponseBody

Inherits:
Object
  • Object
show all
Defined in:
lib/samsara_api/types/safety_settings_get_safety_settings_response_body.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, additional_properties: nil) ⇒ Samsara::Types::SafetySettingsGetSafetySettingsResponseBody

Parameters:



22
23
24
25
26
# File 'lib/samsara_api/types/safety_settings_get_safety_settings_response_body.rb', line 22

def initialize(data:, additional_properties: nil)
  @data = data
  @additional_properties = additional_properties
  @_field_set = { "data": data }
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



12
13
14
# File 'lib/samsara_api/types/safety_settings_get_safety_settings_response_body.rb', line 12

def additional_properties
  @additional_properties
end

#dataArray<Samsara::Types::SafetySettingsObjectResponseBody> (readonly)

Returns Safety settings for a single organization.

Returns:



10
11
12
# File 'lib/samsara_api/types/safety_settings_get_safety_settings_response_body.rb', line 10

def data
  @data
end

Class Method Details

.from_json(json_object:) ⇒ Samsara::Types::SafetySettingsGetSafetySettingsResponseBody

Parameters:

  • json_object (String)

Returns:



32
33
34
35
36
37
38
39
40
# File 'lib/samsara_api/types/safety_settings_get_safety_settings_response_body.rb', line 32

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  data = parsed_json["data"]&.map do | item |
  item = item.to_json
  Samsara::Types::SafetySettingsObjectResponseBody.from_json(json_object: item)
end
  new(data: data, additional_properties: struct)
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


54
55
56
# File 'lib/samsara_api/types/safety_settings_get_safety_settings_response_body.rb', line 54

def self.validate_raw(obj:)
  obj.data.is_a?(Array) != false || raise("Passed value for field obj.data is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


45
46
47
# File 'lib/samsara_api/types/safety_settings_get_safety_settings_response_body.rb', line 45

def to_json
  @_field_set&.to_json
end