Class: Samsara::Types::AssetsLocationLinkConfigObjectResponseBody

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

Overview

Configuration details specific to the ‘By Asset’ Live Sharing Link.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asset_id:, location: OMIT, additional_properties: nil) ⇒ Samsara::Types::AssetsLocationLinkConfigObjectResponseBody

Parameters:



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

def initialize(asset_id:, location: OMIT, additional_properties: nil)
  @asset_id = asset_id
  @location = location if location != OMIT
  @additional_properties = additional_properties
  @_field_set = { "assetId": asset_id, "location": location }.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



15
16
17
# File 'lib/samsara_api/types/assets_location_link_config_object_response_body.rb', line 15

def additional_properties
  @additional_properties
end

#asset_idString (readonly)

Returns Unique assets ID that Live Sharing Link will show.

Returns:

  • (String)

    Unique assets ID that Live Sharing Link will show.



11
12
13
# File 'lib/samsara_api/types/assets_location_link_config_object_response_body.rb', line 11

def asset_id
  @asset_id
end

#locationSamsara::Types::AssetsLocationLinkConfigAddressDetailsObjectResponseBody (readonly)



13
14
15
# File 'lib/samsara_api/types/assets_location_link_config_object_response_body.rb', line 13

def location
  @location
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



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

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  asset_id = parsed_json["assetId"]
  unless parsed_json["location"].nil?
    location = parsed_json["location"].to_json
    location = Samsara::Types::AssetsLocationLinkConfigAddressDetailsObjectResponseBody.from_json(json_object: location)
  else
    location = nil
  end
  new(
    asset_id: asset_id,
    location: location,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


68
69
70
71
# File 'lib/samsara_api/types/assets_location_link_config_object_response_body.rb', line 68

def self.validate_raw(obj:)
  obj.asset_id.is_a?(String) != false || raise("Passed value for field obj.asset_id is not the expected type, validation failed.")
  obj.location.nil? || Samsara::Types::AssetsLocationLinkConfigAddressDetailsObjectResponseBody.validate_raw(obj: obj.location)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


59
60
61
# File 'lib/samsara_api/types/assets_location_link_config_object_response_body.rb', line 59

def to_json
  @_field_set&.to_json
end