Class: Samsara::Types::AddressResponseResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::AddressResponseResponseBody
- Defined in:
- lib/samsara_api/types/address_response_response_body.rb
Overview
Closest address that the GPS latitude and longitude match to.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#city ⇒ String
readonly
The name of the city.
-
#country ⇒ String
readonly
The country.
-
#neighborhood ⇒ String
readonly
The name of the neighborhood if one exists.
-
#point_of_interest ⇒ String
readonly
Point that may be of interest to the user.
-
#postal_code ⇒ String
readonly
The zip code.
-
#state ⇒ String
readonly
The name of the state.
-
#street ⇒ String
readonly
The street name.
-
#street_number ⇒ String
readonly
Street number of the address.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(city: OMIT, country: OMIT, neighborhood: OMIT, point_of_interest: OMIT, postal_code: OMIT, state: OMIT, street: OMIT, street_number: OMIT, additional_properties: nil) ⇒ Samsara::Types::AddressResponseResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(city: OMIT, country: OMIT, neighborhood: OMIT, point_of_interest: OMIT, postal_code: OMIT, state: OMIT, street: OMIT, street_number: OMIT, additional_properties: nil) ⇒ Samsara::Types::AddressResponseResponseBody
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 43 def initialize(city: OMIT, country: OMIT, neighborhood: OMIT, point_of_interest: OMIT, postal_code: OMIT, state: OMIT, street: OMIT, street_number: OMIT, additional_properties: nil) @city = city if city != OMIT @country = country if country != OMIT @neighborhood = neighborhood if neighborhood != OMIT @point_of_interest = point_of_interest if point_of_interest != OMIT @postal_code = postal_code if postal_code != OMIT @state = state if state != OMIT @street = street if street != OMIT @street_number = street_number if street_number != OMIT @additional_properties = additional_properties @_field_set = { "city": city, "country": country, "neighborhood": neighborhood, "pointOfInterest": point_of_interest, "postalCode": postal_code, "state": state, "street": street, "streetNumber": street_number }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
26 27 28 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 26 def additional_properties @additional_properties end |
#city ⇒ String (readonly)
10 11 12 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 10 def city @city end |
#country ⇒ String (readonly)
12 13 14 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 12 def country @country end |
#neighborhood ⇒ String (readonly)
14 15 16 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 14 def neighborhood @neighborhood end |
#point_of_interest ⇒ String (readonly)
16 17 18 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 16 def point_of_interest @point_of_interest end |
#postal_code ⇒ String (readonly)
18 19 20 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 18 def postal_code @postal_code end |
#state ⇒ String (readonly)
20 21 22 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 20 def state @state end |
#street ⇒ String (readonly)
22 23 24 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 22 def street @street end |
#street_number ⇒ String (readonly)
24 25 26 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 24 def street_number @street_number end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::AddressResponseResponseBody
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 61 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) city = parsed_json["city"] country = parsed_json["country"] neighborhood = parsed_json["neighborhood"] point_of_interest = parsed_json["pointOfInterest"] postal_code = parsed_json["postalCode"] state = parsed_json["state"] street = parsed_json["street"] street_number = parsed_json["streetNumber"] new( city: city, country: country, neighborhood: neighborhood, point_of_interest: point_of_interest, postal_code: postal_code, state: state, street: street, street_number: street_number, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
96 97 98 99 100 101 102 103 104 105 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 96 def self.validate_raw(obj:) obj.city&.is_a?(String) != false || raise("Passed value for field obj.city is not the expected type, validation failed.") obj.country&.is_a?(String) != false || raise("Passed value for field obj.country is not the expected type, validation failed.") obj.neighborhood&.is_a?(String) != false || raise("Passed value for field obj.neighborhood is not the expected type, validation failed.") obj.point_of_interest&.is_a?(String) != false || raise("Passed value for field obj.point_of_interest is not the expected type, validation failed.") obj.postal_code&.is_a?(String) != false || raise("Passed value for field obj.postal_code is not the expected type, validation failed.") obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.street&.is_a?(String) != false || raise("Passed value for field obj.street is not the expected type, validation failed.") obj.street_number&.is_a?(String) != false || raise("Passed value for field obj.street_number is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
87 88 89 |
# File 'lib/samsara_api/types/address_response_response_body.rb', line 87 def to_json @_field_set&.to_json end |