Class: Samsara::Types::AssetsLocationLinkConfigAddressDetailsObject
- Inherits:
-
Object
- Object
- Samsara::Types::AssetsLocationLinkConfigAddressDetailsObject
- Defined in:
- lib/samsara_api/types/assets_location_link_config_address_details_object.rb
Overview
and/or ETA) will be shown by Live Sharing Link.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#formatted_address ⇒ String
readonly
Formatted address of a location.
-
#latitude ⇒ Float
readonly
Latitude of a location.
-
#longitude ⇒ Float
readonly
Longitude of a location.
-
#name ⇒ String
readonly
Name of a location.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::AssetsLocationLinkConfigAddressDetailsObject
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(formatted_address:, latitude:, longitude:, name:, additional_properties: nil) ⇒ Samsara::Types::AssetsLocationLinkConfigAddressDetailsObject constructor
- #to_json ⇒ String
Constructor Details
#initialize(formatted_address:, latitude:, longitude:, name:, additional_properties: nil) ⇒ Samsara::Types::AssetsLocationLinkConfigAddressDetailsObject
32 33 34 35 36 37 38 39 |
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object.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_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object.rb', line 19 def additional_properties @additional_properties end |
#formatted_address ⇒ String (readonly)
Returns Formatted address of a location.
11 12 13 |
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object.rb', line 11 def formatted_address @formatted_address end |
#latitude ⇒ Float (readonly)
Returns Latitude of a location.
13 14 15 |
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object.rb', line 13 def latitude @latitude end |
#longitude ⇒ Float (readonly)
Returns Longitude of a location.
15 16 17 |
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object.rb', line 15 def longitude @longitude end |
#name ⇒ String (readonly)
Returns Name of a location.
17 18 19 |
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object.rb', line 17 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::AssetsLocationLinkConfigAddressDetailsObject
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.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
73 74 75 76 77 78 |
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object.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_json ⇒ String
64 65 66 |
# File 'lib/samsara_api/types/assets_location_link_config_address_details_object.rb', line 64 def to_json @_field_set&.to_json end |