Class: Samsara::Types::AssetsLocationLinkConfigAddressDetailsObjectResponseBody

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

Overview

and/or ETA) will be shown by Live Sharing Link.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(formatted_address:, latitude:, longitude:, name:, additional_properties: nil) ⇒ Samsara::Types::AssetsLocationLinkConfigAddressDetailsObjectResponseBody

Parameters:

  • formatted_address (String)

    Formatted address of a location

  • latitude (Float)

    Latitude of a location

  • longitude (Float)

    Longitude of a location

  • name (String)

    Name of a location

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



32
33
34
35
36
37
38
39
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object_response_body.rb', line 32

def initialize(formatted_address:, latitude:, longitude:, name:, additional_properties: nil)
  @formatted_address = formatted_address
  @latitude = latitude
  @longitude = longitude
  @name = name
  @additional_properties = additional_properties
  @_field_set = { "formattedAddress": formatted_address, "latitude": latitude, "longitude": longitude, "name": name }
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



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

def additional_properties
  @additional_properties
end

#formatted_addressString (readonly)

Returns Formatted address of a location.

Returns:

  • (String)

    Formatted address of a location



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

def formatted_address
  @formatted_address
end

#latitudeFloat (readonly)

Returns Latitude of a location.

Returns:

  • (Float)

    Latitude of a location



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

def latitude
  @latitude
end

#longitudeFloat (readonly)

Returns Longitude of a location.

Returns:

  • (Float)

    Longitude of a location



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

def longitude
  @longitude
end

#nameString (readonly)

Returns Name of a location.

Returns:

  • (String)

    Name of a location



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

def name
  @name
end

Class Method Details

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



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object_response_body.rb', line 45

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  formatted_address = parsed_json["formattedAddress"]
  latitude = parsed_json["latitude"]
  longitude = parsed_json["longitude"]
  name = parsed_json["name"]
  new(
    formatted_address: formatted_address,
    latitude: latitude,
    longitude: longitude,
    name: name,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


73
74
75
76
77
78
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object_response_body.rb', line 73

def self.validate_raw(obj:)
  obj.formatted_address.is_a?(String) != false || raise("Passed value for field obj.formatted_address is not the expected type, validation failed.")
  obj.latitude.is_a?(Float) != false || raise("Passed value for field obj.latitude is not the expected type, validation failed.")
  obj.longitude.is_a?(Float) != false || raise("Passed value for field obj.longitude 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_jsonString

Returns:

  • (String)


64
65
66
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object_response_body.rb', line 64

def to_json
  @_field_set&.to_json
end