Class: Samsara::Types::IdlingReportEventAddressResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::IdlingReportEventAddressResponseBody
- Defined in:
- lib/samsara_api/types/idling_report_event_address_response_body.rb
Overview
Address where the idling event took place.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#formatted ⇒ String
readonly
The formatted address of the idling location.
-
#latitude ⇒ Float
readonly
The latitude of the idling location.
-
#longitude ⇒ Float
readonly
The longitude of the idling location.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::IdlingReportEventAddressResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(formatted:, latitude:, longitude:, additional_properties: nil) ⇒ Samsara::Types::IdlingReportEventAddressResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(formatted:, latitude:, longitude:, additional_properties: nil) ⇒ Samsara::Types::IdlingReportEventAddressResponseBody
28 29 30 31 32 33 34 |
# File 'lib/samsara_api/types/idling_report_event_address_response_body.rb', line 28 def initialize(formatted:, latitude:, longitude:, additional_properties: nil) @formatted = formatted @latitude = latitude @longitude = longitude @additional_properties = additional_properties @_field_set = { "formatted": formatted, "latitude": latitude, "longitude": longitude } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/samsara_api/types/idling_report_event_address_response_body.rb', line 16 def additional_properties @additional_properties end |
#formatted ⇒ String (readonly)
Returns The formatted address of the idling location.
10 11 12 |
# File 'lib/samsara_api/types/idling_report_event_address_response_body.rb', line 10 def formatted @formatted end |
#latitude ⇒ Float (readonly)
Returns The latitude of the idling location.
12 13 14 |
# File 'lib/samsara_api/types/idling_report_event_address_response_body.rb', line 12 def latitude @latitude end |
#longitude ⇒ Float (readonly)
Returns The longitude of the idling location.
14 15 16 |
# File 'lib/samsara_api/types/idling_report_event_address_response_body.rb', line 14 def longitude @longitude end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::IdlingReportEventAddressResponseBody
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/samsara_api/types/idling_report_event_address_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) formatted = parsed_json["formatted"] latitude = parsed_json["latitude"] longitude = parsed_json["longitude"] new( formatted: formatted, latitude: latitude, longitude: longitude, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
64 65 66 67 68 |
# File 'lib/samsara_api/types/idling_report_event_address_response_body.rb', line 64 def self.validate_raw(obj:) obj.formatted.is_a?(String) != false || raise("Passed value for field obj.formatted 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.") end |
Instance Method Details
#to_json ⇒ String
55 56 57 |
# File 'lib/samsara_api/types/idling_report_event_address_response_body.rb', line 55 def to_json @_field_set&.to_json end |