Class: Samsara::Types::VehicleSensorConfigurationResponseBody

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

Overview

The sensors configured on a vehicle

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(areas: OMIT, doors: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleSensorConfigurationResponseBody

Parameters:



27
28
29
30
31
32
33
34
# File 'lib/samsara_api/types/vehicle_sensor_configuration_response_body.rb', line 27

def initialize(areas: OMIT, doors: OMIT, additional_properties: nil)
  @areas = areas if areas != OMIT
  @doors = doors if doors != OMIT
  @additional_properties = additional_properties
  @_field_set = { "areas": areas, "doors": doors }.reject do | _k, v |
  v == OMIT
end
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



16
17
18
# File 'lib/samsara_api/types/vehicle_sensor_configuration_response_body.rb', line 16

def additional_properties
  @additional_properties
end

#areasArray<Samsara::Types::VehicleSensorConfigurationAreaResponseBody> (readonly)

Returns Configured sensor areas on the vehicle with its associated sensors.

Returns:



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

def areas
  @areas
end

#doorsArray<Samsara::Types::VehicleSensorConfigurationDoorResponseBody> (readonly)

Returns Configured door monitors on the vehicle.

Returns:



14
15
16
# File 'lib/samsara_api/types/vehicle_sensor_configuration_response_body.rb', line 14

def doors
  @doors
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/samsara_api/types/vehicle_sensor_configuration_response_body.rb', line 40

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


69
70
71
72
# File 'lib/samsara_api/types/vehicle_sensor_configuration_response_body.rb', line 69

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


60
61
62
# File 'lib/samsara_api/types/vehicle_sensor_configuration_response_body.rb', line 60

def to_json
  @_field_set&.to_json
end