Class: Samsara::Types::DeviceAssetResponseResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::DeviceAssetResponseResponseBody
- Defined in:
- lib/samsara_api/types/device_asset_response_response_body.rb
Overview
Asset that the device is tied to.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#id ⇒ String
readonly
The unique ID of the asset.
-
#name ⇒ Object
readonly
API at any time.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::DeviceAssetResponseResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(id:, name:, additional_properties: nil) ⇒ Samsara::Types::DeviceAssetResponseResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, name:, additional_properties: nil) ⇒ Samsara::Types::DeviceAssetResponseResponseBody
33 34 35 36 37 38 |
# File 'lib/samsara_api/types/device_asset_response_response_body.rb', line 33 def initialize(id:, name:, additional_properties: nil) @id = id @name = name @additional_properties = additional_properties @_field_set = { "id": id, "name": name } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/samsara_api/types/device_asset_response_response_body.rb', line 18 def additional_properties @additional_properties end |
#id ⇒ String (readonly)
Returns The unique ID of the asset.
10 11 12 |
# File 'lib/samsara_api/types/device_asset_response_response_body.rb', line 10 def id @id end |
#name ⇒ Object (readonly)
API at any time.
16 17 18 |
# File 'lib/samsara_api/types/device_asset_response_response_body.rb', line 16 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::DeviceAssetResponseResponseBody
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/samsara_api/types/device_asset_response_response_body.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] name = parsed_json["name"] new( id: id, name: name, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
66 67 68 69 |
# File 'lib/samsara_api/types/device_asset_response_response_body.rb', line 66 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
57 58 59 |
# File 'lib/samsara_api/types/device_asset_response_response_body.rb', line 57 def to_json @_field_set&.to_json end |