Class: Samsara::Types::AccessoryResponseObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::AccessoryResponseObjectResponseBody
- Defined in:
- lib/samsara_api/types/accessory_response_object_response_body.rb
Overview
An object containing information about an accessory connected to the VG.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#model ⇒ String
readonly
Product model name of the device.
-
#serial ⇒ String
readonly
The serial number of the accessory device.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::AccessoryResponseObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(model: OMIT, serial: OMIT, additional_properties: nil) ⇒ Samsara::Types::AccessoryResponseObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(model: OMIT, serial: OMIT, additional_properties: nil) ⇒ Samsara::Types::AccessoryResponseObjectResponseBody
25 26 27 28 29 30 31 32 |
# File 'lib/samsara_api/types/accessory_response_object_response_body.rb', line 25 def initialize(model: OMIT, serial: OMIT, additional_properties: nil) @model = model if model != OMIT @serial = serial if serial != OMIT @additional_properties = additional_properties @_field_set = { "model": model, "serial": serial }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/samsara_api/types/accessory_response_object_response_body.rb', line 14 def additional_properties @additional_properties end |
#model ⇒ String (readonly)
Returns Product model name of the device.
10 11 12 |
# File 'lib/samsara_api/types/accessory_response_object_response_body.rb', line 10 def model @model end |
#serial ⇒ String (readonly)
Returns The serial number of the accessory device.
12 13 14 |
# File 'lib/samsara_api/types/accessory_response_object_response_body.rb', line 12 def serial @serial end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::AccessoryResponseObjectResponseBody
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/samsara_api/types/accessory_response_object_response_body.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) model = parsed_json["model"] serial = parsed_json["serial"] new( model: model, serial: serial, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
60 61 62 63 |
# File 'lib/samsara_api/types/accessory_response_object_response_body.rb', line 60 def self.validate_raw(obj:) obj.model&.is_a?(String) != false || raise("Passed value for field obj.model is not the expected type, validation failed.") obj.serial&.is_a?(String) != false || raise("Passed value for field obj.serial is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
51 52 53 |
# File 'lib/samsara_api/types/accessory_response_object_response_body.rb', line 51 def to_json @_field_set&.to_json end |