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,176 @@
|
|
|
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
|
+
# Additional information that is not relevant for other modes of
|
|
8
|
+
# transportation.
|
|
9
|
+
class DirectionsTransitDetails < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for this method
|
|
14
|
+
# @return [DirectionsTransitStop]
|
|
15
|
+
attr_accessor :arrival_stop
|
|
16
|
+
|
|
17
|
+
# An object containing Unix time, a time zone, and its formatted text
|
|
18
|
+
# representation.
|
|
19
|
+
# @return [TimeZoneTextValueObject]
|
|
20
|
+
attr_accessor :arrival_time
|
|
21
|
+
|
|
22
|
+
# An object containing Unix time, a time zone, and its formatted text
|
|
23
|
+
# representation.
|
|
24
|
+
# @return [DirectionsTransitStop]
|
|
25
|
+
attr_accessor :departure_stop
|
|
26
|
+
|
|
27
|
+
# An object containing Unix time, a time zone, and its formatted text
|
|
28
|
+
# representation.
|
|
29
|
+
# @return [TimeZoneTextValueObject]
|
|
30
|
+
attr_accessor :departure_time
|
|
31
|
+
|
|
32
|
+
# Specifies the direction in which to travel on this line, as it is marked
|
|
33
|
+
# on the vehicle or at the departure stop. This will often be the terminus
|
|
34
|
+
# station.
|
|
35
|
+
# @return [String]
|
|
36
|
+
attr_accessor :headsign
|
|
37
|
+
|
|
38
|
+
# Specifies the expected number of seconds between departures from the same
|
|
39
|
+
# stop at this time. For example, with a `headway` value of 600, you would
|
|
40
|
+
# expect a ten minute wait if you should miss your bus.
|
|
41
|
+
# @return [Integer]
|
|
42
|
+
attr_accessor :headway
|
|
43
|
+
|
|
44
|
+
# Specifies the expected number of seconds between departures from the same
|
|
45
|
+
# stop at this time. For example, with a `headway` value of 600, you would
|
|
46
|
+
# expect a ten minute wait if you should miss your bus.
|
|
47
|
+
# @return [DirectionsTransitLine]
|
|
48
|
+
attr_accessor :line
|
|
49
|
+
|
|
50
|
+
# The number of stops from the departure to the arrival stop. This includes
|
|
51
|
+
# the arrival stop, but not the departure stop. For example, if your
|
|
52
|
+
# directions involve leaving from Stop A, passing through stops B and C, and
|
|
53
|
+
# arriving at stop D, `num_stops` will return 3.
|
|
54
|
+
# @return [Integer]
|
|
55
|
+
attr_accessor :num_stops
|
|
56
|
+
|
|
57
|
+
# The text that appears in schedules and sign boards to identify a transit
|
|
58
|
+
# trip to passengers. The text should uniquely identify a trip within a
|
|
59
|
+
# service day. For example, "538" is the `trip_short_name` of the Amtrak
|
|
60
|
+
# train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA.
|
|
61
|
+
# @return [String]
|
|
62
|
+
attr_accessor :trip_short_name
|
|
63
|
+
|
|
64
|
+
# A mapping from model property names to API property names.
|
|
65
|
+
def self.names
|
|
66
|
+
@_hash = {} if @_hash.nil?
|
|
67
|
+
@_hash['arrival_stop'] = 'arrival_stop'
|
|
68
|
+
@_hash['arrival_time'] = 'arrival_time'
|
|
69
|
+
@_hash['departure_stop'] = 'departure_stop'
|
|
70
|
+
@_hash['departure_time'] = 'departure_time'
|
|
71
|
+
@_hash['headsign'] = 'headsign'
|
|
72
|
+
@_hash['headway'] = 'headway'
|
|
73
|
+
@_hash['line'] = 'line'
|
|
74
|
+
@_hash['num_stops'] = 'num_stops'
|
|
75
|
+
@_hash['trip_short_name'] = 'trip_short_name'
|
|
76
|
+
@_hash
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# An array for optional fields
|
|
80
|
+
def self.optionals
|
|
81
|
+
%w[
|
|
82
|
+
arrival_stop
|
|
83
|
+
arrival_time
|
|
84
|
+
departure_stop
|
|
85
|
+
departure_time
|
|
86
|
+
headsign
|
|
87
|
+
headway
|
|
88
|
+
line
|
|
89
|
+
num_stops
|
|
90
|
+
trip_short_name
|
|
91
|
+
]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# An array for nullable fields
|
|
95
|
+
def self.nullables
|
|
96
|
+
[]
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def initialize(arrival_stop: SKIP, arrival_time: SKIP, departure_stop: SKIP,
|
|
100
|
+
departure_time: SKIP, headsign: SKIP, headway: SKIP,
|
|
101
|
+
line: SKIP, num_stops: SKIP, trip_short_name: SKIP,
|
|
102
|
+
additional_properties: nil)
|
|
103
|
+
# Add additional model properties to the instance
|
|
104
|
+
additional_properties = {} if additional_properties.nil?
|
|
105
|
+
|
|
106
|
+
@arrival_stop = arrival_stop unless arrival_stop == SKIP
|
|
107
|
+
@arrival_time = arrival_time unless arrival_time == SKIP
|
|
108
|
+
@departure_stop = departure_stop unless departure_stop == SKIP
|
|
109
|
+
@departure_time = departure_time unless departure_time == SKIP
|
|
110
|
+
@headsign = headsign unless headsign == SKIP
|
|
111
|
+
@headway = headway unless headway == SKIP
|
|
112
|
+
@line = line unless line == SKIP
|
|
113
|
+
@num_stops = num_stops unless num_stops == SKIP
|
|
114
|
+
@trip_short_name = trip_short_name unless trip_short_name == SKIP
|
|
115
|
+
@additional_properties = additional_properties
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Creates an instance of the object from a hash.
|
|
119
|
+
def self.from_hash(hash)
|
|
120
|
+
return nil unless hash
|
|
121
|
+
|
|
122
|
+
# Extract variables from the hash.
|
|
123
|
+
arrival_stop = DirectionsTransitStop.from_hash(hash['arrival_stop']) if hash['arrival_stop']
|
|
124
|
+
arrival_time = TimeZoneTextValueObject.from_hash(hash['arrival_time']) if
|
|
125
|
+
hash['arrival_time']
|
|
126
|
+
departure_stop = DirectionsTransitStop.from_hash(hash['departure_stop']) if
|
|
127
|
+
hash['departure_stop']
|
|
128
|
+
departure_time = TimeZoneTextValueObject.from_hash(hash['departure_time']) if
|
|
129
|
+
hash['departure_time']
|
|
130
|
+
headsign = hash.key?('headsign') ? hash['headsign'] : SKIP
|
|
131
|
+
headway = hash.key?('headway') ? hash['headway'] : SKIP
|
|
132
|
+
line = DirectionsTransitLine.from_hash(hash['line']) if hash['line']
|
|
133
|
+
num_stops = hash.key?('num_stops') ? hash['num_stops'] : SKIP
|
|
134
|
+
trip_short_name =
|
|
135
|
+
hash.key?('trip_short_name') ? hash['trip_short_name'] : SKIP
|
|
136
|
+
|
|
137
|
+
# Create a new hash for additional properties, removing known properties.
|
|
138
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
139
|
+
|
|
140
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
141
|
+
new_hash, proc { |value| value }
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
# Create object from extracted values.
|
|
145
|
+
DirectionsTransitDetails.new(arrival_stop: arrival_stop,
|
|
146
|
+
arrival_time: arrival_time,
|
|
147
|
+
departure_stop: departure_stop,
|
|
148
|
+
departure_time: departure_time,
|
|
149
|
+
headsign: headsign,
|
|
150
|
+
headway: headway,
|
|
151
|
+
line: line,
|
|
152
|
+
num_stops: num_stops,
|
|
153
|
+
trip_short_name: trip_short_name,
|
|
154
|
+
additional_properties: additional_properties)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Provides a human-readable string representation of the object.
|
|
158
|
+
def to_s
|
|
159
|
+
class_name = self.class.name.split('::').last
|
|
160
|
+
"<#{class_name} arrival_stop: #{@arrival_stop}, arrival_time: #{@arrival_time},"\
|
|
161
|
+
" departure_stop: #{@departure_stop}, departure_time: #{@departure_time}, headsign:"\
|
|
162
|
+
" #{@headsign}, headway: #{@headway}, line: #{@line}, num_stops: #{@num_stops},"\
|
|
163
|
+
" trip_short_name: #{@trip_short_name}, additional_properties: #{@additional_properties}>"
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
167
|
+
def inspect
|
|
168
|
+
class_name = self.class.name.split('::').last
|
|
169
|
+
"<#{class_name} arrival_stop: #{@arrival_stop.inspect}, arrival_time:"\
|
|
170
|
+
" #{@arrival_time.inspect}, departure_stop: #{@departure_stop.inspect}, departure_time:"\
|
|
171
|
+
" #{@departure_time.inspect}, headsign: #{@headsign.inspect}, headway: #{@headway.inspect},"\
|
|
172
|
+
" line: #{@line.inspect}, num_stops: #{@num_stops.inspect}, trip_short_name:"\
|
|
173
|
+
" #{@trip_short_name.inspect}, additional_properties: #{@additional_properties}>"
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
# DirectionsTransitLine Model.
|
|
8
|
+
class DirectionsTransitLine < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The transit agency (or agencies) that operates this transit line.
|
|
13
|
+
# @return [Array[DirectionsTransitAgency]]
|
|
14
|
+
attr_accessor :agencies
|
|
15
|
+
|
|
16
|
+
# The color commonly used in signage for this line.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :color
|
|
19
|
+
|
|
20
|
+
# The full name of this transit line, e.g. "8 Avenue Local".
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
# The short name of this transit line. This will normally be a line number,
|
|
25
|
+
# such as "M7" or "355".
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :short_name
|
|
28
|
+
|
|
29
|
+
# The color commonly used in signage for this line.
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :text_color
|
|
32
|
+
|
|
33
|
+
# Contains the URL for this transit line as provided by the transit agency.
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :url
|
|
36
|
+
|
|
37
|
+
# Contains the URL for the icon associated with this line.
|
|
38
|
+
# @return [String]
|
|
39
|
+
attr_accessor :icon
|
|
40
|
+
|
|
41
|
+
# Contains the URL for the icon associated with this line.
|
|
42
|
+
# @return [DirectionsTransitVehicle]
|
|
43
|
+
attr_accessor :vehicle
|
|
44
|
+
|
|
45
|
+
# A mapping from model property names to API property names.
|
|
46
|
+
def self.names
|
|
47
|
+
@_hash = {} if @_hash.nil?
|
|
48
|
+
@_hash['agencies'] = 'agencies'
|
|
49
|
+
@_hash['color'] = 'color'
|
|
50
|
+
@_hash['name'] = 'name'
|
|
51
|
+
@_hash['short_name'] = 'short_name'
|
|
52
|
+
@_hash['text_color'] = 'text_color'
|
|
53
|
+
@_hash['url'] = 'url'
|
|
54
|
+
@_hash['icon'] = 'icon'
|
|
55
|
+
@_hash['vehicle'] = 'vehicle'
|
|
56
|
+
@_hash
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# An array for optional fields
|
|
60
|
+
def self.optionals
|
|
61
|
+
%w[
|
|
62
|
+
color
|
|
63
|
+
short_name
|
|
64
|
+
text_color
|
|
65
|
+
url
|
|
66
|
+
icon
|
|
67
|
+
vehicle
|
|
68
|
+
]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# An array for nullable fields
|
|
72
|
+
def self.nullables
|
|
73
|
+
[]
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def initialize(agencies:, name:, color: SKIP, short_name: SKIP,
|
|
77
|
+
text_color: SKIP, url: SKIP, icon: SKIP, vehicle: SKIP,
|
|
78
|
+
additional_properties: nil)
|
|
79
|
+
# Add additional model properties to the instance
|
|
80
|
+
additional_properties = {} if additional_properties.nil?
|
|
81
|
+
|
|
82
|
+
@agencies = agencies
|
|
83
|
+
@color = color unless color == SKIP
|
|
84
|
+
@name = name
|
|
85
|
+
@short_name = short_name unless short_name == SKIP
|
|
86
|
+
@text_color = text_color unless text_color == SKIP
|
|
87
|
+
@url = url unless url == SKIP
|
|
88
|
+
@icon = icon unless icon == SKIP
|
|
89
|
+
@vehicle = vehicle unless vehicle == SKIP
|
|
90
|
+
@additional_properties = additional_properties
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Creates an instance of the object from a hash.
|
|
94
|
+
def self.from_hash(hash)
|
|
95
|
+
return nil unless hash
|
|
96
|
+
|
|
97
|
+
# Extract variables from the hash.
|
|
98
|
+
# Parameter is an array, so we need to iterate through it
|
|
99
|
+
agencies = nil
|
|
100
|
+
unless hash['agencies'].nil?
|
|
101
|
+
agencies = []
|
|
102
|
+
hash['agencies'].each do |structure|
|
|
103
|
+
agencies << (DirectionsTransitAgency.from_hash(structure) if structure)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
agencies = nil unless hash.key?('agencies')
|
|
108
|
+
name = hash.key?('name') ? hash['name'] : nil
|
|
109
|
+
color = hash.key?('color') ? hash['color'] : SKIP
|
|
110
|
+
short_name = hash.key?('short_name') ? hash['short_name'] : SKIP
|
|
111
|
+
text_color = hash.key?('text_color') ? hash['text_color'] : SKIP
|
|
112
|
+
url = hash.key?('url') ? hash['url'] : SKIP
|
|
113
|
+
icon = hash.key?('icon') ? hash['icon'] : SKIP
|
|
114
|
+
vehicle = DirectionsTransitVehicle.from_hash(hash['vehicle']) if hash['vehicle']
|
|
115
|
+
|
|
116
|
+
# Create a new hash for additional properties, removing known properties.
|
|
117
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
118
|
+
|
|
119
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
120
|
+
new_hash, proc { |value| value }
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
# Create object from extracted values.
|
|
124
|
+
DirectionsTransitLine.new(agencies: agencies,
|
|
125
|
+
name: name,
|
|
126
|
+
color: color,
|
|
127
|
+
short_name: short_name,
|
|
128
|
+
text_color: text_color,
|
|
129
|
+
url: url,
|
|
130
|
+
icon: icon,
|
|
131
|
+
vehicle: vehicle,
|
|
132
|
+
additional_properties: additional_properties)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Provides a human-readable string representation of the object.
|
|
136
|
+
def to_s
|
|
137
|
+
class_name = self.class.name.split('::').last
|
|
138
|
+
"<#{class_name} agencies: #{@agencies}, color: #{@color}, name: #{@name}, short_name:"\
|
|
139
|
+
" #{@short_name}, text_color: #{@text_color}, url: #{@url}, icon: #{@icon}, vehicle:"\
|
|
140
|
+
" #{@vehicle}, additional_properties: #{@additional_properties}>"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
144
|
+
def inspect
|
|
145
|
+
class_name = self.class.name.split('::').last
|
|
146
|
+
"<#{class_name} agencies: #{@agencies.inspect}, color: #{@color.inspect}, name:"\
|
|
147
|
+
" #{@name.inspect}, short_name: #{@short_name.inspect}, text_color: #{@text_color.inspect},"\
|
|
148
|
+
" url: #{@url.inspect}, icon: #{@icon.inspect}, vehicle: #{@vehicle.inspect},"\
|
|
149
|
+
" additional_properties: #{@additional_properties}>"
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
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
|
+
# DirectionsTransitStop Model.
|
|
8
|
+
class DirectionsTransitStop < 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
|
+
# The name of the transit stop.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# A mapping from model property names to API property names.
|
|
22
|
+
def self.names
|
|
23
|
+
@_hash = {} if @_hash.nil?
|
|
24
|
+
@_hash['location'] = 'location'
|
|
25
|
+
@_hash['name'] = 'name'
|
|
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(location:, name:, additional_properties: nil)
|
|
40
|
+
# Add additional model properties to the instance
|
|
41
|
+
additional_properties = {} if additional_properties.nil?
|
|
42
|
+
|
|
43
|
+
@location = location
|
|
44
|
+
@name = name
|
|
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
|
+
location = LatLngLiteral.from_hash(hash['location']) if hash['location']
|
|
54
|
+
name = hash.key?('name') ? hash['name'] : 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
|
+
DirectionsTransitStop.new(location: location,
|
|
65
|
+
name: name,
|
|
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} location: #{@location}, name: #{@name}, 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} location: #{@location.inspect}, name: #{@name.inspect},"\
|
|
80
|
+
" additional_properties: #{@additional_properties}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
# DirectionsTransitVehicle Model.
|
|
8
|
+
class DirectionsTransitVehicle < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Contains the URL for an icon associated with this vehicle type.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :icon
|
|
15
|
+
|
|
16
|
+
# Contains the URL for the icon associated with this vehicle type, based on
|
|
17
|
+
# the local transport signage.
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :local_icon
|
|
20
|
+
|
|
21
|
+
# The name of this vehicle, capitalized.
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :name
|
|
24
|
+
|
|
25
|
+
# The type of vehicle used.
|
|
26
|
+
# * `BUS` - Bus.
|
|
27
|
+
# * `CABLE_CAR` - A vehicle that operates on a cable, usually on the ground.
|
|
28
|
+
# Aerial cable cars may be of the type GONDOLA_LIFT.
|
|
29
|
+
# * `COMMUTER_TRAIN` - Commuter rail.
|
|
30
|
+
# * `FERRY` - Ferry.
|
|
31
|
+
# * `FUNICULAR` - A vehicle that is pulled up a steep incline by a cable. A
|
|
32
|
+
# Funicular typically consists of two cars, with each car acting as a
|
|
33
|
+
# counterweight for the other.
|
|
34
|
+
# * `GONDOLA_LIFT` - An aerial cable car.
|
|
35
|
+
# * `HEAVY_RAIL` - Heavy rail.
|
|
36
|
+
# * `HIGH_SPEED_TRAIN` - High speed train.
|
|
37
|
+
# * `INTERCITY_BUS` - Intercity bus.
|
|
38
|
+
# * `LONG_DISTANCE_TRAIN` - Long distance train.
|
|
39
|
+
# * `METRO_RAIL` - Light rail transit.
|
|
40
|
+
# * `MONORAIL` - Monorail.
|
|
41
|
+
# * `OTHER` - All other vehicles will return this type.
|
|
42
|
+
# * `RAIL` - Rail.
|
|
43
|
+
# * `SHARE_TAXI` - Share taxi is a kind of bus with the ability to drop off
|
|
44
|
+
# and pick up passengers anywhere on its route.
|
|
45
|
+
# * `SUBWAY` - Underground light rail.
|
|
46
|
+
# * `TRAM` - Above ground light rail.
|
|
47
|
+
# * `TROLLEYBUS` - Trolleybus.
|
|
48
|
+
# @return [Type1]
|
|
49
|
+
attr_accessor :type
|
|
50
|
+
|
|
51
|
+
# A mapping from model property names to API property names.
|
|
52
|
+
def self.names
|
|
53
|
+
@_hash = {} if @_hash.nil?
|
|
54
|
+
@_hash['icon'] = 'icon'
|
|
55
|
+
@_hash['local_icon'] = 'local_icon'
|
|
56
|
+
@_hash['name'] = 'name'
|
|
57
|
+
@_hash['type'] = 'type'
|
|
58
|
+
@_hash
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# An array for optional fields
|
|
62
|
+
def self.optionals
|
|
63
|
+
%w[
|
|
64
|
+
icon
|
|
65
|
+
local_icon
|
|
66
|
+
]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# An array for nullable fields
|
|
70
|
+
def self.nullables
|
|
71
|
+
[]
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def initialize(name:, type:, icon: SKIP, local_icon: SKIP,
|
|
75
|
+
additional_properties: nil)
|
|
76
|
+
# Add additional model properties to the instance
|
|
77
|
+
additional_properties = {} if additional_properties.nil?
|
|
78
|
+
|
|
79
|
+
@icon = icon unless icon == SKIP
|
|
80
|
+
@local_icon = local_icon unless local_icon == SKIP
|
|
81
|
+
@name = name
|
|
82
|
+
@type = type
|
|
83
|
+
@additional_properties = additional_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Creates an instance of the object from a hash.
|
|
87
|
+
def self.from_hash(hash)
|
|
88
|
+
return nil unless hash
|
|
89
|
+
|
|
90
|
+
# Extract variables from the hash.
|
|
91
|
+
name = hash.key?('name') ? hash['name'] : nil
|
|
92
|
+
type = hash.key?('type') ? hash['type'] : nil
|
|
93
|
+
icon = hash.key?('icon') ? hash['icon'] : SKIP
|
|
94
|
+
local_icon = hash.key?('local_icon') ? hash['local_icon'] : SKIP
|
|
95
|
+
|
|
96
|
+
# Create a new hash for additional properties, removing known properties.
|
|
97
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
98
|
+
|
|
99
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
100
|
+
new_hash, proc { |value| value }
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
# Create object from extracted values.
|
|
104
|
+
DirectionsTransitVehicle.new(name: name,
|
|
105
|
+
type: type,
|
|
106
|
+
icon: icon,
|
|
107
|
+
local_icon: local_icon,
|
|
108
|
+
additional_properties: additional_properties)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Provides a human-readable string representation of the object.
|
|
112
|
+
def to_s
|
|
113
|
+
class_name = self.class.name.split('::').last
|
|
114
|
+
"<#{class_name} icon: #{@icon}, local_icon: #{@local_icon}, name: #{@name}, type: #{@type},"\
|
|
115
|
+
" additional_properties: #{@additional_properties}>"
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
119
|
+
def inspect
|
|
120
|
+
class_name = self.class.name.split('::').last
|
|
121
|
+
"<#{class_name} icon: #{@icon.inspect}, local_icon: #{@local_icon.inspect}, name:"\
|
|
122
|
+
" #{@name.inspect}, type: #{@type.inspect}, additional_properties:"\
|
|
123
|
+
" #{@additional_properties}>"
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
end
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
# DirectionsViaWaypoint Model.
|
|
8
|
+
class DirectionsViaWaypoint < 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
|
+
# The index of the step containing the waypoint.
|
|
18
|
+
# @return [Integer]
|
|
19
|
+
attr_accessor :step_index
|
|
20
|
+
|
|
21
|
+
# The position of the waypoint along the step's polyline, expressed as a
|
|
22
|
+
# ratio from 0 to 1.
|
|
23
|
+
# @return [Float]
|
|
24
|
+
attr_accessor :step_interpolation
|
|
25
|
+
|
|
26
|
+
# A mapping from model property names to API property names.
|
|
27
|
+
def self.names
|
|
28
|
+
@_hash = {} if @_hash.nil?
|
|
29
|
+
@_hash['location'] = 'location'
|
|
30
|
+
@_hash['step_index'] = 'step_index'
|
|
31
|
+
@_hash['step_interpolation'] = 'step_interpolation'
|
|
32
|
+
@_hash
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# An array for optional fields
|
|
36
|
+
def self.optionals
|
|
37
|
+
%w[
|
|
38
|
+
location
|
|
39
|
+
step_index
|
|
40
|
+
step_interpolation
|
|
41
|
+
]
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# An array for nullable fields
|
|
45
|
+
def self.nullables
|
|
46
|
+
[]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def initialize(location: SKIP, step_index: SKIP, step_interpolation: SKIP,
|
|
50
|
+
additional_properties: nil)
|
|
51
|
+
# Add additional model properties to the instance
|
|
52
|
+
additional_properties = {} if additional_properties.nil?
|
|
53
|
+
|
|
54
|
+
@location = location unless location == SKIP
|
|
55
|
+
@step_index = step_index unless step_index == SKIP
|
|
56
|
+
@step_interpolation = step_interpolation unless step_interpolation == SKIP
|
|
57
|
+
@additional_properties = additional_properties
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Creates an instance of the object from a hash.
|
|
61
|
+
def self.from_hash(hash)
|
|
62
|
+
return nil unless hash
|
|
63
|
+
|
|
64
|
+
# Extract variables from the hash.
|
|
65
|
+
location = LatLngLiteral.from_hash(hash['location']) if hash['location']
|
|
66
|
+
step_index = hash.key?('step_index') ? hash['step_index'] : SKIP
|
|
67
|
+
step_interpolation =
|
|
68
|
+
hash.key?('step_interpolation') ? hash['step_interpolation'] : SKIP
|
|
69
|
+
|
|
70
|
+
# Create a new hash for additional properties, removing known properties.
|
|
71
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
72
|
+
|
|
73
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
74
|
+
new_hash, proc { |value| value }
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# Create object from extracted values.
|
|
78
|
+
DirectionsViaWaypoint.new(location: location,
|
|
79
|
+
step_index: step_index,
|
|
80
|
+
step_interpolation: step_interpolation,
|
|
81
|
+
additional_properties: additional_properties)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Provides a human-readable string representation of the object.
|
|
85
|
+
def to_s
|
|
86
|
+
class_name = self.class.name.split('::').last
|
|
87
|
+
"<#{class_name} location: #{@location}, step_index: #{@step_index}, step_interpolation:"\
|
|
88
|
+
" #{@step_interpolation}, additional_properties: #{@additional_properties}>"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
92
|
+
def inspect
|
|
93
|
+
class_name = self.class.name.split('::').last
|
|
94
|
+
"<#{class_name} location: #{@location.inspect}, step_index: #{@step_index.inspect},"\
|
|
95
|
+
" step_interpolation: #{@step_interpolation.inspect}, additional_properties:"\
|
|
96
|
+
" #{@additional_properties}>"
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|