Class: Samsara::Types::SafetySettingsGetSafetySettingsResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::SafetySettingsGetSafetySettingsResponseBody
- Defined in:
- lib/samsara_api/types/safety_settings_get_safety_settings_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.
-
#data ⇒ Array<Samsara::Types::SafetySettingsObjectResponseBody>
readonly
Safety settings for a single organization.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::SafetySettingsGetSafetySettingsResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(data:, additional_properties: nil) ⇒ Samsara::Types::SafetySettingsGetSafetySettingsResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(data:, additional_properties: nil) ⇒ Samsara::Types::SafetySettingsGetSafetySettingsResponseBody
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#data ⇒ Array<Samsara::Types::SafetySettingsObjectResponseBody> (readonly)
Returns Safety settings for a single organization.
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
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
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_json ⇒ 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 |