Class: Samsara::Types::ReverseGeo
- Inherits:
-
Object
- Object
- Samsara::Types::ReverseGeo
- Defined in:
- lib/samsara_api/types/reverse_geo.rb
Overview
Reverse geocoded information.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#formatted_location ⇒ String
readonly
Formatted address of the reverse geocoding data.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(formatted_location: OMIT, additional_properties: nil) ⇒ Samsara::Types::ReverseGeo constructor
- #to_json ⇒ String
Constructor Details
#initialize(formatted_location: OMIT, additional_properties: nil) ⇒ Samsara::Types::ReverseGeo
22 23 24 25 26 27 28 |
# File 'lib/samsara_api/types/reverse_geo.rb', line 22 def initialize(formatted_location: OMIT, additional_properties: nil) @formatted_location = formatted_location if formatted_location != OMIT @additional_properties = additional_properties @_field_set = { "formattedLocation": formatted_location }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
12 13 14 |
# File 'lib/samsara_api/types/reverse_geo.rb', line 12 def additional_properties @additional_properties end |
#formatted_location ⇒ String (readonly)
Returns Formatted address of the reverse geocoding data.
10 11 12 |
# File 'lib/samsara_api/types/reverse_geo.rb', line 10 def formatted_location @formatted_location end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::ReverseGeo
33 34 35 36 37 38 |
# File 'lib/samsara_api/types/reverse_geo.rb', line 33 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) formatted_location = parsed_json["formattedLocation"] new(formatted_location: formatted_location, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
51 52 53 |
# File 'lib/samsara_api/types/reverse_geo.rb', line 51 def self.validate_raw(obj:) obj.formatted_location&.is_a?(String) != false || raise("Passed value for field obj.formatted_location is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
42 43 44 |
# File 'lib/samsara_api/types/reverse_geo.rb', line 42 def to_json @_field_set&.to_json end |