google-maps-api-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +169 -0
- data/bin/console +15 -0
- data/lib/google_maps_platform/api_helper.rb +10 -0
- data/lib/google_maps_platform/client.rb +123 -0
- data/lib/google_maps_platform/configuration.rb +181 -0
- data/lib/google_maps_platform/controllers/base_controller.rb +67 -0
- data/lib/google_maps_platform/controllers/directions_api_controller.rb +341 -0
- data/lib/google_maps_platform/controllers/distance_matrix_api_controller.rb +224 -0
- data/lib/google_maps_platform/controllers/elevation_api_controller.rb +71 -0
- data/lib/google_maps_platform/controllers/geocoding_api_controller.rb +214 -0
- data/lib/google_maps_platform/controllers/geolocation_api_controller.rb +46 -0
- data/lib/google_maps_platform/controllers/places_api_controller.rb +866 -0
- data/lib/google_maps_platform/controllers/roads_api_controller.rb +81 -0
- data/lib/google_maps_platform/controllers/street_view_api_controller.rb +198 -0
- data/lib/google_maps_platform/controllers/time_zone_api_controller.rb +65 -0
- data/lib/google_maps_platform/exceptions/api_exception.rb +21 -0
- data/lib/google_maps_platform/exceptions/error_response_exception.rb +48 -0
- data/lib/google_maps_platform/exceptions/nearest_roads_error_response_exception.rb +46 -0
- data/lib/google_maps_platform/http/api_response.rb +19 -0
- data/lib/google_maps_platform/http/auth/custom_query_authentication.rb +52 -0
- data/lib/google_maps_platform/http/http_call_back.rb +10 -0
- data/lib/google_maps_platform/http/http_method_enum.rb +10 -0
- data/lib/google_maps_platform/http/http_request.rb +10 -0
- data/lib/google_maps_platform/http/http_response.rb +10 -0
- data/lib/google_maps_platform/http/proxy_settings.rb +22 -0
- data/lib/google_maps_platform/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/google_maps_platform/logging/sdk_logger.rb +17 -0
- data/lib/google_maps_platform/models/address_component.rb +97 -0
- data/lib/google_maps_platform/models/base_model.rb +110 -0
- data/lib/google_maps_platform/models/bounds.rb +85 -0
- data/lib/google_maps_platform/models/business_status.rb +41 -0
- data/lib/google_maps_platform/models/cell_tower.rb +146 -0
- data/lib/google_maps_platform/models/directions_geocoded_waypoint.rb +181 -0
- data/lib/google_maps_platform/models/directions_leg.rb +224 -0
- data/lib/google_maps_platform/models/directions_polyline.rb +93 -0
- data/lib/google_maps_platform/models/directions_response.rb +185 -0
- data/lib/google_maps_platform/models/directions_route.rb +188 -0
- data/lib/google_maps_platform/models/directions_status.rb +94 -0
- data/lib/google_maps_platform/models/directions_step.rb +216 -0
- data/lib/google_maps_platform/models/directions_traffic_speed_entry.rb +84 -0
- data/lib/google_maps_platform/models/directions_transit_agency.rb +95 -0
- data/lib/google_maps_platform/models/directions_transit_details.rb +176 -0
- data/lib/google_maps_platform/models/directions_transit_line.rb +152 -0
- data/lib/google_maps_platform/models/directions_transit_stop.rb +83 -0
- data/lib/google_maps_platform/models/directions_transit_vehicle.rb +126 -0
- data/lib/google_maps_platform/models/directions_via_waypoint.rb +99 -0
- data/lib/google_maps_platform/models/distance_matrix_element.rb +132 -0
- data/lib/google_maps_platform/models/distance_matrix_element_status.rb +48 -0
- data/lib/google_maps_platform/models/distance_matrix_response.rb +149 -0
- data/lib/google_maps_platform/models/distance_matrix_row.rb +89 -0
- data/lib/google_maps_platform/models/distance_matrix_status.rb +74 -0
- data/lib/google_maps_platform/models/elevation_response.rb +132 -0
- data/lib/google_maps_platform/models/elevation_result.rb +99 -0
- data/lib/google_maps_platform/models/elevation_status.rb +65 -0
- data/lib/google_maps_platform/models/error_detail.rb +135 -0
- data/lib/google_maps_platform/models/error_object.rb +130 -0
- data/lib/google_maps_platform/models/fare.rb +92 -0
- data/lib/google_maps_platform/models/field_violation.rb +82 -0
- data/lib/google_maps_platform/models/geocoder_status.rb +37 -0
- data/lib/google_maps_platform/models/geocoding_geometry.rb +117 -0
- data/lib/google_maps_platform/models/geocoding_response.rb +140 -0
- data/lib/google_maps_platform/models/geocoding_result.rb +174 -0
- data/lib/google_maps_platform/models/geocoding_status.rb +71 -0
- data/lib/google_maps_platform/models/geolocation_request.rb +166 -0
- data/lib/google_maps_platform/models/geolocation_response.rb +91 -0
- data/lib/google_maps_platform/models/geometry.rb +84 -0
- data/lib/google_maps_platform/models/inputtype.rb +36 -0
- data/lib/google_maps_platform/models/language.rb +240 -0
- data/lib/google_maps_platform/models/lat_lng_literal.rb +83 -0
- data/lib/google_maps_platform/models/latitude_longitude_literal.rb +83 -0
- data/lib/google_maps_platform/models/location_type.rb +54 -0
- data/lib/google_maps_platform/models/location_type1.rb +44 -0
- data/lib/google_maps_platform/models/maneuver.rb +110 -0
- data/lib/google_maps_platform/models/maps_api_elevation_json_response.rb +132 -0
- data/lib/google_maps_platform/models/maxprice.rb +48 -0
- data/lib/google_maps_platform/models/minprice.rb +48 -0
- data/lib/google_maps_platform/models/mode.rb +44 -0
- data/lib/google_maps_platform/models/nearest_roads_error.rb +90 -0
- data/lib/google_maps_platform/models/nearest_roads_response.rb +86 -0
- data/lib/google_maps_platform/models/place.rb +647 -0
- data/lib/google_maps_platform/models/place_autocomplete_matched_substring.rb +82 -0
- data/lib/google_maps_platform/models/place_autocomplete_prediction.rb +181 -0
- data/lib/google_maps_platform/models/place_autocomplete_structured_format.rb +136 -0
- data/lib/google_maps_platform/models/place_autocomplete_term.rb +83 -0
- data/lib/google_maps_platform/models/place_editorial_summary.rb +87 -0
- data/lib/google_maps_platform/models/place_opening_hours.rb +138 -0
- data/lib/google_maps_platform/models/place_opening_hours_period.rb +84 -0
- data/lib/google_maps_platform/models/place_opening_hours_period_detail.rb +108 -0
- data/lib/google_maps_platform/models/place_photo.rb +109 -0
- data/lib/google_maps_platform/models/place_review.rb +186 -0
- data/lib/google_maps_platform/models/place_special_day.rb +93 -0
- data/lib/google_maps_platform/models/places_autocomplete_response.rb +141 -0
- data/lib/google_maps_platform/models/places_autocomplete_status.rb +66 -0
- data/lib/google_maps_platform/models/places_details_response.rb +131 -0
- data/lib/google_maps_platform/models/places_details_status.rb +71 -0
- data/lib/google_maps_platform/models/places_find_place_from_text_response.rb +145 -0
- data/lib/google_maps_platform/models/places_nearby_search_response.rb +171 -0
- data/lib/google_maps_platform/models/places_query_autocomplete_response.rb +141 -0
- data/lib/google_maps_platform/models/places_search_status.rb +66 -0
- data/lib/google_maps_platform/models/places_text_search_response.rb +171 -0
- data/lib/google_maps_platform/models/plus_code.rb +92 -0
- data/lib/google_maps_platform/models/rankby.rb +36 -0
- data/lib/google_maps_platform/models/region.rb +1052 -0
- data/lib/google_maps_platform/models/result.rb +96 -0
- data/lib/google_maps_platform/models/result_type.rb +112 -0
- data/lib/google_maps_platform/models/snap_to_roads_response.rb +96 -0
- data/lib/google_maps_platform/models/snapped_point.rb +103 -0
- data/lib/google_maps_platform/models/source.rb +36 -0
- data/lib/google_maps_platform/models/street_view_response.rb +135 -0
- data/lib/google_maps_platform/models/street_view_status.rb +71 -0
- data/lib/google_maps_platform/models/text_value_object.rb +82 -0
- data/lib/google_maps_platform/models/time_zone_response.rb +154 -0
- data/lib/google_maps_platform/models/time_zone_status.rb +68 -0
- data/lib/google_maps_platform/models/time_zone_text_value_object.rb +94 -0
- data/lib/google_maps_platform/models/traffic_model.rb +40 -0
- data/lib/google_maps_platform/models/transit_routing_preference.rb +36 -0
- data/lib/google_maps_platform/models/travel_mode.rb +48 -0
- data/lib/google_maps_platform/models/type.rb +140 -0
- data/lib/google_maps_platform/models/type1.rb +112 -0
- data/lib/google_maps_platform/models/units.rb +36 -0
- data/lib/google_maps_platform/models/wi_fi_access_point.rb +119 -0
- data/lib/google_maps_platform/utilities/date_time_helper.rb +11 -0
- data/lib/google_maps_platform/utilities/file_wrapper.rb +28 -0
- data/lib/google_maps_platform.rb +154 -0
- metadata +210 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# google_maps_platform
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC
|
|
4
|
+
# v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module GoogleMapsPlatform
|
|
7
|
+
# A successful geolocation request will return a JSON-formatted response
|
|
8
|
+
# defining a location and radius.
|
|
9
|
+
class GeolocationResponse < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# An object describing a specific location with Latitude and Longitude in
|
|
14
|
+
# decimal degrees.
|
|
15
|
+
# @return [LatLngLiteral]
|
|
16
|
+
attr_accessor :location
|
|
17
|
+
|
|
18
|
+
# The accuracy of the estimated location, in meters. This represents the
|
|
19
|
+
# radius of a circle around the given `location`. If your Geolocation
|
|
20
|
+
# response shows a very high value in the `accuracy` field, the service may
|
|
21
|
+
# be geolocating based on the request IP, instead of WiFi points or cell
|
|
22
|
+
# towers. This can happen if no cell towers or access points are valid or
|
|
23
|
+
# recognized. To confirm that this is the issue, set `considerIp` to `false`
|
|
24
|
+
# in your request. If the response is a `404`, you've confirmed that your
|
|
25
|
+
# `wifiAccessPoints` and `cellTowers` objects could not be geolocated.
|
|
26
|
+
# @return [Float]
|
|
27
|
+
attr_accessor :accuracy
|
|
28
|
+
|
|
29
|
+
# A mapping from model property names to API property names.
|
|
30
|
+
def self.names
|
|
31
|
+
@_hash = {} if @_hash.nil?
|
|
32
|
+
@_hash['location'] = 'location'
|
|
33
|
+
@_hash['accuracy'] = 'accuracy'
|
|
34
|
+
@_hash
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# An array for optional fields
|
|
38
|
+
def self.optionals
|
|
39
|
+
[]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
[]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def initialize(location:, accuracy:, additional_properties: nil)
|
|
48
|
+
# Add additional model properties to the instance
|
|
49
|
+
additional_properties = {} if additional_properties.nil?
|
|
50
|
+
|
|
51
|
+
@location = location
|
|
52
|
+
@accuracy = accuracy
|
|
53
|
+
@additional_properties = additional_properties
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Creates an instance of the object from a hash.
|
|
57
|
+
def self.from_hash(hash)
|
|
58
|
+
return nil unless hash
|
|
59
|
+
|
|
60
|
+
# Extract variables from the hash.
|
|
61
|
+
location = LatLngLiteral.from_hash(hash['location']) if hash['location']
|
|
62
|
+
accuracy = hash.key?('accuracy') ? hash['accuracy'] : nil
|
|
63
|
+
|
|
64
|
+
# Create a new hash for additional properties, removing known properties.
|
|
65
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
66
|
+
|
|
67
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
68
|
+
new_hash, proc { |value| value }
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Create object from extracted values.
|
|
72
|
+
GeolocationResponse.new(location: location,
|
|
73
|
+
accuracy: accuracy,
|
|
74
|
+
additional_properties: additional_properties)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Provides a human-readable string representation of the object.
|
|
78
|
+
def to_s
|
|
79
|
+
class_name = self.class.name.split('::').last
|
|
80
|
+
"<#{class_name} location: #{@location}, accuracy: #{@accuracy}, additional_properties:"\
|
|
81
|
+
" #{@additional_properties}>"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
85
|
+
def inspect
|
|
86
|
+
class_name = self.class.name.split('::').last
|
|
87
|
+
"<#{class_name} location: #{@location.inspect}, accuracy: #{@accuracy.inspect},"\
|
|
88
|
+
" additional_properties: #{@additional_properties}>"
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# google_maps_platform
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC
|
|
4
|
+
# v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module GoogleMapsPlatform
|
|
7
|
+
# An object describing the location.
|
|
8
|
+
class Geometry < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# An object describing a specific location with Latitude and Longitude in
|
|
13
|
+
# decimal degrees.
|
|
14
|
+
# @return [LatLngLiteral]
|
|
15
|
+
attr_accessor :location
|
|
16
|
+
|
|
17
|
+
# A rectangle in geographical coordinates from points at the southwest and
|
|
18
|
+
# northeast corners.
|
|
19
|
+
# @return [Bounds]
|
|
20
|
+
attr_accessor :viewport
|
|
21
|
+
|
|
22
|
+
# A mapping from model property names to API property names.
|
|
23
|
+
def self.names
|
|
24
|
+
@_hash = {} if @_hash.nil?
|
|
25
|
+
@_hash['location'] = 'location'
|
|
26
|
+
@_hash['viewport'] = 'viewport'
|
|
27
|
+
@_hash
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# An array for optional fields
|
|
31
|
+
def self.optionals
|
|
32
|
+
[]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# An array for nullable fields
|
|
36
|
+
def self.nullables
|
|
37
|
+
[]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def initialize(location:, viewport:, additional_properties: nil)
|
|
41
|
+
# Add additional model properties to the instance
|
|
42
|
+
additional_properties = {} if additional_properties.nil?
|
|
43
|
+
|
|
44
|
+
@location = location
|
|
45
|
+
@viewport = viewport
|
|
46
|
+
@additional_properties = additional_properties
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Creates an instance of the object from a hash.
|
|
50
|
+
def self.from_hash(hash)
|
|
51
|
+
return nil unless hash
|
|
52
|
+
|
|
53
|
+
# Extract variables from the hash.
|
|
54
|
+
location = LatLngLiteral.from_hash(hash['location']) if hash['location']
|
|
55
|
+
viewport = Bounds.from_hash(hash['viewport']) if hash['viewport']
|
|
56
|
+
|
|
57
|
+
# Create a new hash for additional properties, removing known properties.
|
|
58
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
59
|
+
|
|
60
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
61
|
+
new_hash, proc { |value| value }
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Create object from extracted values.
|
|
65
|
+
Geometry.new(location: location,
|
|
66
|
+
viewport: viewport,
|
|
67
|
+
additional_properties: additional_properties)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Provides a human-readable string representation of the object.
|
|
71
|
+
def to_s
|
|
72
|
+
class_name = self.class.name.split('::').last
|
|
73
|
+
"<#{class_name} location: #{@location}, viewport: #{@viewport}, additional_properties:"\
|
|
74
|
+
" #{@additional_properties}>"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
78
|
+
def inspect
|
|
79
|
+
class_name = self.class.name.split('::').last
|
|
80
|
+
"<#{class_name} location: #{@location.inspect}, viewport: #{@viewport.inspect},"\
|
|
81
|
+
" additional_properties: #{@additional_properties}>"
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# google_maps_platform
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC
|
|
4
|
+
# v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module GoogleMapsPlatform
|
|
7
|
+
# inputtype.
|
|
8
|
+
class Inputtype
|
|
9
|
+
INPUTTYPE = [
|
|
10
|
+
# TODO: Write general description for TEXTQUERY
|
|
11
|
+
TEXTQUERY = 'textquery'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for PHONENUMBER
|
|
14
|
+
PHONENUMBER = 'phonenumber'.freeze
|
|
15
|
+
].freeze
|
|
16
|
+
|
|
17
|
+
def self.validate(value)
|
|
18
|
+
return false if value.nil?
|
|
19
|
+
|
|
20
|
+
INPUTTYPE.include?(value)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = TEXTQUERY)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'textquery' then TEXTQUERY
|
|
30
|
+
when 'phonenumber' then PHONENUMBER
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# google_maps_platform
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC
|
|
4
|
+
# v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module GoogleMapsPlatform
|
|
7
|
+
# language.
|
|
8
|
+
class Language
|
|
9
|
+
LANGUAGE = [
|
|
10
|
+
# TODO: Write general description for AR
|
|
11
|
+
AR = 'ar'.freeze,
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for BG
|
|
14
|
+
BG = 'bg'.freeze,
|
|
15
|
+
|
|
16
|
+
# TODO: Write general description for BN
|
|
17
|
+
BN = 'bn'.freeze,
|
|
18
|
+
|
|
19
|
+
# TODO: Write general description for CA
|
|
20
|
+
CA = 'ca'.freeze,
|
|
21
|
+
|
|
22
|
+
# TODO: Write general description for CS
|
|
23
|
+
CS = 'cs'.freeze,
|
|
24
|
+
|
|
25
|
+
# TODO: Write general description for DA
|
|
26
|
+
DA = 'da'.freeze,
|
|
27
|
+
|
|
28
|
+
# TODO: Write general description for DE
|
|
29
|
+
DE = 'de'.freeze,
|
|
30
|
+
|
|
31
|
+
# TODO: Write general description for EL
|
|
32
|
+
EL = 'el'.freeze,
|
|
33
|
+
|
|
34
|
+
# TODO: Write general description for EN
|
|
35
|
+
EN = 'en'.freeze,
|
|
36
|
+
|
|
37
|
+
# TODO: Write general description for ENAU
|
|
38
|
+
ENAU = 'en-AU'.freeze,
|
|
39
|
+
|
|
40
|
+
# TODO: Write general description for ENGB
|
|
41
|
+
ENGB = 'en-GB'.freeze,
|
|
42
|
+
|
|
43
|
+
# TODO: Write general description for ES
|
|
44
|
+
ES = 'es'.freeze,
|
|
45
|
+
|
|
46
|
+
# TODO: Write general description for EU
|
|
47
|
+
EU = 'eu'.freeze,
|
|
48
|
+
|
|
49
|
+
# TODO: Write general description for FA
|
|
50
|
+
FA = 'fa'.freeze,
|
|
51
|
+
|
|
52
|
+
# TODO: Write general description for FI
|
|
53
|
+
FI = 'fi'.freeze,
|
|
54
|
+
|
|
55
|
+
# TODO: Write general description for FIL
|
|
56
|
+
FIL = 'fil'.freeze,
|
|
57
|
+
|
|
58
|
+
# TODO: Write general description for FR
|
|
59
|
+
FR = 'fr'.freeze,
|
|
60
|
+
|
|
61
|
+
# TODO: Write general description for GL
|
|
62
|
+
GL = 'gl'.freeze,
|
|
63
|
+
|
|
64
|
+
# TODO: Write general description for GU
|
|
65
|
+
GU = 'gu'.freeze,
|
|
66
|
+
|
|
67
|
+
# TODO: Write general description for HI
|
|
68
|
+
HI = 'hi'.freeze,
|
|
69
|
+
|
|
70
|
+
# TODO: Write general description for HR
|
|
71
|
+
HR = 'hr'.freeze,
|
|
72
|
+
|
|
73
|
+
# TODO: Write general description for HU
|
|
74
|
+
HU = 'hu'.freeze,
|
|
75
|
+
|
|
76
|
+
# TODO: Write general description for ID
|
|
77
|
+
ID = 'id'.freeze,
|
|
78
|
+
|
|
79
|
+
# TODO: Write general description for IT
|
|
80
|
+
IT = 'it'.freeze,
|
|
81
|
+
|
|
82
|
+
# TODO: Write general description for IW
|
|
83
|
+
IW = 'iw'.freeze,
|
|
84
|
+
|
|
85
|
+
# TODO: Write general description for JA
|
|
86
|
+
JA = 'ja'.freeze,
|
|
87
|
+
|
|
88
|
+
# TODO: Write general description for KN
|
|
89
|
+
KN = 'kn'.freeze,
|
|
90
|
+
|
|
91
|
+
# TODO: Write general description for KO
|
|
92
|
+
KO = 'ko'.freeze,
|
|
93
|
+
|
|
94
|
+
# TODO: Write general description for LT
|
|
95
|
+
LT = 'lt'.freeze,
|
|
96
|
+
|
|
97
|
+
# TODO: Write general description for LV
|
|
98
|
+
LV = 'lv'.freeze,
|
|
99
|
+
|
|
100
|
+
# TODO: Write general description for ML
|
|
101
|
+
ML = 'ml'.freeze,
|
|
102
|
+
|
|
103
|
+
# TODO: Write general description for MR
|
|
104
|
+
MR = 'mr'.freeze,
|
|
105
|
+
|
|
106
|
+
# TODO: Write general description for NL
|
|
107
|
+
NL = 'nl'.freeze,
|
|
108
|
+
|
|
109
|
+
# TODO: Write general description for NO
|
|
110
|
+
NO = 'no'.freeze,
|
|
111
|
+
|
|
112
|
+
# TODO: Write general description for PL
|
|
113
|
+
PL = 'pl'.freeze,
|
|
114
|
+
|
|
115
|
+
# TODO: Write general description for PT
|
|
116
|
+
PT = 'pt'.freeze,
|
|
117
|
+
|
|
118
|
+
# TODO: Write general description for PTBR
|
|
119
|
+
PTBR = 'pt-BR'.freeze,
|
|
120
|
+
|
|
121
|
+
# TODO: Write general description for PTPT
|
|
122
|
+
PTPT = 'pt-PT'.freeze,
|
|
123
|
+
|
|
124
|
+
# TODO: Write general description for RO
|
|
125
|
+
RO = 'ro'.freeze,
|
|
126
|
+
|
|
127
|
+
# TODO: Write general description for RU
|
|
128
|
+
RU = 'ru'.freeze,
|
|
129
|
+
|
|
130
|
+
# TODO: Write general description for SK
|
|
131
|
+
SK = 'sk'.freeze,
|
|
132
|
+
|
|
133
|
+
# TODO: Write general description for SL
|
|
134
|
+
SL = 'sl'.freeze,
|
|
135
|
+
|
|
136
|
+
# TODO: Write general description for SR
|
|
137
|
+
SR = 'sr'.freeze,
|
|
138
|
+
|
|
139
|
+
# TODO: Write general description for SV
|
|
140
|
+
SV = 'sv'.freeze,
|
|
141
|
+
|
|
142
|
+
# TODO: Write general description for TA
|
|
143
|
+
TA = 'ta'.freeze,
|
|
144
|
+
|
|
145
|
+
# TODO: Write general description for TE
|
|
146
|
+
TE = 'te'.freeze,
|
|
147
|
+
|
|
148
|
+
# TODO: Write general description for TH
|
|
149
|
+
TH = 'th'.freeze,
|
|
150
|
+
|
|
151
|
+
# TODO: Write general description for TL
|
|
152
|
+
TL = 'tl'.freeze,
|
|
153
|
+
|
|
154
|
+
# TODO: Write general description for TR
|
|
155
|
+
TR = 'tr'.freeze,
|
|
156
|
+
|
|
157
|
+
# TODO: Write general description for UK
|
|
158
|
+
UK = 'uk'.freeze,
|
|
159
|
+
|
|
160
|
+
# TODO: Write general description for VI
|
|
161
|
+
VI = 'vi'.freeze,
|
|
162
|
+
|
|
163
|
+
# TODO: Write general description for ZHCN
|
|
164
|
+
ZHCN = 'zh-CN'.freeze,
|
|
165
|
+
|
|
166
|
+
# TODO: Write general description for ZHTW
|
|
167
|
+
ZHTW = 'zh-TW'.freeze
|
|
168
|
+
].freeze
|
|
169
|
+
|
|
170
|
+
def self.validate(value)
|
|
171
|
+
return false if value.nil?
|
|
172
|
+
|
|
173
|
+
LANGUAGE.include?(value)
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def self.from_value(value, default_value = AR)
|
|
177
|
+
return default_value if value.nil?
|
|
178
|
+
|
|
179
|
+
str = value.to_s.strip
|
|
180
|
+
|
|
181
|
+
case str.downcase
|
|
182
|
+
when 'ar' then AR
|
|
183
|
+
when 'bg' then BG
|
|
184
|
+
when 'bn' then BN
|
|
185
|
+
when 'ca' then CA
|
|
186
|
+
when 'cs' then CS
|
|
187
|
+
when 'da' then DA
|
|
188
|
+
when 'de' then DE
|
|
189
|
+
when 'el' then EL
|
|
190
|
+
when 'en' then EN
|
|
191
|
+
when 'enau' then ENAU
|
|
192
|
+
when 'engb' then ENGB
|
|
193
|
+
when 'es' then ES
|
|
194
|
+
when 'eu' then EU
|
|
195
|
+
when 'fa' then FA
|
|
196
|
+
when 'fi' then FI
|
|
197
|
+
when 'fil' then FIL
|
|
198
|
+
when 'fr' then FR
|
|
199
|
+
when 'gl' then GL
|
|
200
|
+
when 'gu' then GU
|
|
201
|
+
when 'hi' then HI
|
|
202
|
+
when 'hr' then HR
|
|
203
|
+
when 'hu' then HU
|
|
204
|
+
when 'id' then ID
|
|
205
|
+
when 'it' then IT
|
|
206
|
+
when 'iw' then IW
|
|
207
|
+
when 'ja' then JA
|
|
208
|
+
when 'kn' then KN
|
|
209
|
+
when 'ko' then KO
|
|
210
|
+
when 'lt' then LT
|
|
211
|
+
when 'lv' then LV
|
|
212
|
+
when 'ml' then ML
|
|
213
|
+
when 'mr' then MR
|
|
214
|
+
when 'nl' then NL
|
|
215
|
+
when 'no' then NO
|
|
216
|
+
when 'pl' then PL
|
|
217
|
+
when 'pt' then PT
|
|
218
|
+
when 'ptbr' then PTBR
|
|
219
|
+
when 'ptpt' then PTPT
|
|
220
|
+
when 'ro' then RO
|
|
221
|
+
when 'ru' then RU
|
|
222
|
+
when 'sk' then SK
|
|
223
|
+
when 'sl' then SL
|
|
224
|
+
when 'sr' then SR
|
|
225
|
+
when 'sv' then SV
|
|
226
|
+
when 'ta' then TA
|
|
227
|
+
when 'te' then TE
|
|
228
|
+
when 'th' then TH
|
|
229
|
+
when 'tl' then TL
|
|
230
|
+
when 'tr' then TR
|
|
231
|
+
when 'uk' then UK
|
|
232
|
+
when 'vi' then VI
|
|
233
|
+
when 'zhcn' then ZHCN
|
|
234
|
+
when 'zhtw' then ZHTW
|
|
235
|
+
else
|
|
236
|
+
default_value
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# google_maps_platform
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC
|
|
4
|
+
# v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module GoogleMapsPlatform
|
|
7
|
+
# An object describing a specific location with Latitude and Longitude in
|
|
8
|
+
# decimal degrees.
|
|
9
|
+
class LatLngLiteral < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Latitude in decimal degrees
|
|
14
|
+
# @return [Float]
|
|
15
|
+
attr_accessor :lat
|
|
16
|
+
|
|
17
|
+
# Longitude in decimal degrees
|
|
18
|
+
# @return [Float]
|
|
19
|
+
attr_accessor :lng
|
|
20
|
+
|
|
21
|
+
# A mapping from model property names to API property names.
|
|
22
|
+
def self.names
|
|
23
|
+
@_hash = {} if @_hash.nil?
|
|
24
|
+
@_hash['lat'] = 'lat'
|
|
25
|
+
@_hash['lng'] = 'lng'
|
|
26
|
+
@_hash
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# An array for optional fields
|
|
30
|
+
def self.optionals
|
|
31
|
+
[]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# An array for nullable fields
|
|
35
|
+
def self.nullables
|
|
36
|
+
[]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def initialize(lat:, lng:, additional_properties: nil)
|
|
40
|
+
# Add additional model properties to the instance
|
|
41
|
+
additional_properties = {} if additional_properties.nil?
|
|
42
|
+
|
|
43
|
+
@lat = lat
|
|
44
|
+
@lng = lng
|
|
45
|
+
@additional_properties = additional_properties
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Creates an instance of the object from a hash.
|
|
49
|
+
def self.from_hash(hash)
|
|
50
|
+
return nil unless hash
|
|
51
|
+
|
|
52
|
+
# Extract variables from the hash.
|
|
53
|
+
lat = hash.key?('lat') ? hash['lat'] : nil
|
|
54
|
+
lng = hash.key?('lng') ? hash['lng'] : nil
|
|
55
|
+
|
|
56
|
+
# Create a new hash for additional properties, removing known properties.
|
|
57
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
58
|
+
|
|
59
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
60
|
+
new_hash, proc { |value| value }
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# Create object from extracted values.
|
|
64
|
+
LatLngLiteral.new(lat: lat,
|
|
65
|
+
lng: lng,
|
|
66
|
+
additional_properties: additional_properties)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a human-readable string representation of the object.
|
|
70
|
+
def to_s
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} lat: #{@lat}, lng: #{@lng}, additional_properties:"\
|
|
73
|
+
" #{@additional_properties}>"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
77
|
+
def inspect
|
|
78
|
+
class_name = self.class.name.split('::').last
|
|
79
|
+
"<#{class_name} lat: #{@lat.inspect}, lng: #{@lng.inspect}, additional_properties:"\
|
|
80
|
+
" #{@additional_properties}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# google_maps_platform
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC
|
|
4
|
+
# v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module GoogleMapsPlatform
|
|
7
|
+
# An object describing a specific location with Latitude and Longitude in
|
|
8
|
+
# decimal degrees.
|
|
9
|
+
class LatitudeLongitudeLiteral < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# Latitude in decimal degrees
|
|
14
|
+
# @return [Float]
|
|
15
|
+
attr_accessor :latitude
|
|
16
|
+
|
|
17
|
+
# Longitude in decimal degrees
|
|
18
|
+
# @return [Float]
|
|
19
|
+
attr_accessor :longitude
|
|
20
|
+
|
|
21
|
+
# A mapping from model property names to API property names.
|
|
22
|
+
def self.names
|
|
23
|
+
@_hash = {} if @_hash.nil?
|
|
24
|
+
@_hash['latitude'] = 'latitude'
|
|
25
|
+
@_hash['longitude'] = 'longitude'
|
|
26
|
+
@_hash
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# An array for optional fields
|
|
30
|
+
def self.optionals
|
|
31
|
+
[]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# An array for nullable fields
|
|
35
|
+
def self.nullables
|
|
36
|
+
[]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def initialize(latitude:, longitude:, additional_properties: nil)
|
|
40
|
+
# Add additional model properties to the instance
|
|
41
|
+
additional_properties = {} if additional_properties.nil?
|
|
42
|
+
|
|
43
|
+
@latitude = latitude
|
|
44
|
+
@longitude = longitude
|
|
45
|
+
@additional_properties = additional_properties
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Creates an instance of the object from a hash.
|
|
49
|
+
def self.from_hash(hash)
|
|
50
|
+
return nil unless hash
|
|
51
|
+
|
|
52
|
+
# Extract variables from the hash.
|
|
53
|
+
latitude = hash.key?('latitude') ? hash['latitude'] : nil
|
|
54
|
+
longitude = hash.key?('longitude') ? hash['longitude'] : nil
|
|
55
|
+
|
|
56
|
+
# Create a new hash for additional properties, removing known properties.
|
|
57
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
58
|
+
|
|
59
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
60
|
+
new_hash, proc { |value| value }
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
# Create object from extracted values.
|
|
64
|
+
LatitudeLongitudeLiteral.new(latitude: latitude,
|
|
65
|
+
longitude: longitude,
|
|
66
|
+
additional_properties: additional_properties)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Provides a human-readable string representation of the object.
|
|
70
|
+
def to_s
|
|
71
|
+
class_name = self.class.name.split('::').last
|
|
72
|
+
"<#{class_name} latitude: #{@latitude}, longitude: #{@longitude}, additional_properties:"\
|
|
73
|
+
" #{@additional_properties}>"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
77
|
+
def inspect
|
|
78
|
+
class_name = self.class.name.split('::').last
|
|
79
|
+
"<#{class_name} latitude: #{@latitude.inspect}, longitude: #{@longitude.inspect},"\
|
|
80
|
+
" additional_properties: #{@additional_properties}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# google_maps_platform
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC
|
|
4
|
+
# v3.0 ( https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module GoogleMapsPlatform
|
|
7
|
+
# Stores additional data about the specified location. The following values
|
|
8
|
+
# are currently supported: - "ROOFTOP" indicates that the returned result is a
|
|
9
|
+
# precise geocode for which we have location information accurate down to
|
|
10
|
+
# street address precision. - "RANGE_INTERPOLATED" indicates that the returned
|
|
11
|
+
# result reflects an approximation (usually on a road) interpolated between
|
|
12
|
+
# two precise points (such as intersections). Interpolated results are
|
|
13
|
+
# generally returned when rooftop geocodes are unavailable for a street
|
|
14
|
+
# address. - "GEOMETRIC_CENTER" indicates that the returned result is the
|
|
15
|
+
# geometric center of a result such as a polyline (for example, a street) or
|
|
16
|
+
# polygon (region). - "APPROXIMATE" indicates that the returned result is
|
|
17
|
+
# approximate.
|
|
18
|
+
class LocationType
|
|
19
|
+
LOCATION_TYPE = [
|
|
20
|
+
# TODO: Write general description for ROOFTOP
|
|
21
|
+
ROOFTOP = 'ROOFTOP'.freeze,
|
|
22
|
+
|
|
23
|
+
# TODO: Write general description for RANGE_INTERPOLATED
|
|
24
|
+
RANGE_INTERPOLATED = 'RANGE_INTERPOLATED'.freeze,
|
|
25
|
+
|
|
26
|
+
# TODO: Write general description for GEOMETRIC_CENTER
|
|
27
|
+
GEOMETRIC_CENTER = 'GEOMETRIC_CENTER'.freeze,
|
|
28
|
+
|
|
29
|
+
# TODO: Write general description for APPROXIMATE
|
|
30
|
+
APPROXIMATE = 'APPROXIMATE'.freeze
|
|
31
|
+
].freeze
|
|
32
|
+
|
|
33
|
+
def self.validate(value)
|
|
34
|
+
return false if value.nil?
|
|
35
|
+
|
|
36
|
+
LOCATION_TYPE.include?(value)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def self.from_value(value, default_value = ROOFTOP)
|
|
40
|
+
return default_value if value.nil?
|
|
41
|
+
|
|
42
|
+
str = value.to_s.strip
|
|
43
|
+
|
|
44
|
+
case str.downcase
|
|
45
|
+
when 'rooftop' then ROOFTOP
|
|
46
|
+
when 'range_interpolated' then RANGE_INTERPOLATED
|
|
47
|
+
when 'geometric_center' then GEOMETRIC_CENTER
|
|
48
|
+
when 'approximate' then APPROXIMATE
|
|
49
|
+
else
|
|
50
|
+
default_value
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|