Class: Samsara::Types::TrailerGoaGatewayTinyResponseResponseBody

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

Overview

have a gateway installed.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model:, serial:, additional_properties: nil) ⇒ Samsara::Types::TrailerGoaGatewayTinyResponseResponseBody



37
38
39
40
41
42
# File 'lib/samsara_api/types/trailer_goa_gateway_tiny_response_response_body.rb', line 37

def initialize(model:, serial:, additional_properties: nil)
  @model = model
  @serial = serial
  @additional_properties = additional_properties
  @_field_set = { "model": model, "serial": serial }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)



21
22
23
# File 'lib/samsara_api/types/trailer_goa_gateway_tiny_response_response_body.rb', line 21

def additional_properties
  @additional_properties
end

#modelObject (readonly)

‘VG54EU`, `VG54FN`, `VG54NA`, `VG54NAE`, `VG54NAH`, `VG55EU`, `VG55FN`, `VG55NA`



17
18
19
# File 'lib/samsara_api/types/trailer_goa_gateway_tiny_response_response_body.rb', line 17

def model
  @model
end

#serialString (readonly)



19
20
21
# File 'lib/samsara_api/types/trailer_goa_gateway_tiny_response_response_body.rb', line 19

def serial
  @serial
end

Class Method Details

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



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/samsara_api/types/trailer_goa_gateway_tiny_response_response_body.rb', line 48

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



72
73
74
75
# File 'lib/samsara_api/types/trailer_goa_gateway_tiny_response_response_body.rb', line 72

def self.validate_raw(obj:)
  obj.model.is_a?(Samsara::Types::TrailerGoaGatewayTinyResponseResponseBodyModel) != 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_jsonString



63
64
65
# File 'lib/samsara_api/types/trailer_goa_gateway_tiny_response_response_body.rb', line 63

def to_json
  @_field_set&.to_json
end