Class: Samsara::Types::VehicleSensorConfigurationResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::VehicleSensorConfigurationResponseBody
- 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
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#areas ⇒ Array<Samsara::Types::VehicleSensorConfigurationAreaResponseBody>
readonly
Configured sensor areas on the vehicle with its associated sensors.
-
#doors ⇒ Array<Samsara::Types::VehicleSensorConfigurationDoorResponseBody>
readonly
Configured door monitors on the vehicle.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::VehicleSensorConfigurationResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(areas: OMIT, doors: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleSensorConfigurationResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(areas: OMIT, doors: OMIT, additional_properties: nil) ⇒ Samsara::Types::VehicleSensorConfigurationResponseBody
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#areas ⇒ Array<Samsara::Types::VehicleSensorConfigurationAreaResponseBody> (readonly)
Returns Configured sensor areas on the vehicle with its associated sensors.
12 13 14 |
# File 'lib/samsara_api/types/vehicle_sensor_configuration_response_body.rb', line 12 def areas @areas end |
#doors ⇒ Array<Samsara::Types::VehicleSensorConfigurationDoorResponseBody> (readonly)
Returns Configured door monitors on the vehicle.
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
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
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_json ⇒ 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 |