google-apis-places_v1 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google/apis/places_v1/classes.rb +1169 -0
- data/lib/google/apis/places_v1/gem_version.rb +28 -0
- data/lib/google/apis/places_v1/representations.rb +418 -0
- data/lib/google/apis/places_v1/service.rb +121 -0
- data/lib/google/apis/places_v1.rb +42 -0
- data/lib/google-apis-places_v1.rb +15 -0
- metadata +82 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Apis
|
17
|
+
module PlacesV1
|
18
|
+
# Version of the google-apis-places_v1 gem
|
19
|
+
GEM_VERSION = "0.1.0"
|
20
|
+
|
21
|
+
# Version of the code generator used to generate this client
|
22
|
+
GENERATOR_VERSION = "0.12.0"
|
23
|
+
|
24
|
+
# Revision of the discovery document this client was generated from
|
25
|
+
REVISION = "20230718"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,418 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module PlacesV1
|
24
|
+
|
25
|
+
class GoogleGeoTypeViewport
|
26
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
|
+
|
28
|
+
include Google::Apis::Core::JsonObjectSupport
|
29
|
+
end
|
30
|
+
|
31
|
+
class GoogleMapsPlacesV1AuthorAttribution
|
32
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
33
|
+
|
34
|
+
include Google::Apis::Core::JsonObjectSupport
|
35
|
+
end
|
36
|
+
|
37
|
+
class GoogleMapsPlacesV1Circle
|
38
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
39
|
+
|
40
|
+
include Google::Apis::Core::JsonObjectSupport
|
41
|
+
end
|
42
|
+
|
43
|
+
class GoogleMapsPlacesV1Int32Range
|
44
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
45
|
+
|
46
|
+
include Google::Apis::Core::JsonObjectSupport
|
47
|
+
end
|
48
|
+
|
49
|
+
class GoogleMapsPlacesV1Place
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
55
|
+
class GoogleMapsPlacesV1PlaceAddressComponent
|
56
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
57
|
+
|
58
|
+
include Google::Apis::Core::JsonObjectSupport
|
59
|
+
end
|
60
|
+
|
61
|
+
class GoogleMapsPlacesV1PlaceAttribution
|
62
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
|
+
|
64
|
+
include Google::Apis::Core::JsonObjectSupport
|
65
|
+
end
|
66
|
+
|
67
|
+
class GoogleMapsPlacesV1PlaceOpeningHours
|
68
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
69
|
+
|
70
|
+
include Google::Apis::Core::JsonObjectSupport
|
71
|
+
end
|
72
|
+
|
73
|
+
class GoogleMapsPlacesV1PlaceOpeningHoursPeriod
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
79
|
+
class GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint
|
80
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
81
|
+
|
82
|
+
include Google::Apis::Core::JsonObjectSupport
|
83
|
+
end
|
84
|
+
|
85
|
+
class GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay
|
86
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
87
|
+
|
88
|
+
include Google::Apis::Core::JsonObjectSupport
|
89
|
+
end
|
90
|
+
|
91
|
+
class GoogleMapsPlacesV1PlacePlusCode
|
92
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
93
|
+
|
94
|
+
include Google::Apis::Core::JsonObjectSupport
|
95
|
+
end
|
96
|
+
|
97
|
+
class GoogleMapsPlacesV1PlaceReview
|
98
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
99
|
+
|
100
|
+
include Google::Apis::Core::JsonObjectSupport
|
101
|
+
end
|
102
|
+
|
103
|
+
class GoogleMapsPlacesV1SearchTextRequest
|
104
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
105
|
+
|
106
|
+
include Google::Apis::Core::JsonObjectSupport
|
107
|
+
end
|
108
|
+
|
109
|
+
class GoogleMapsPlacesV1SearchTextRequestLocation
|
110
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
111
|
+
|
112
|
+
include Google::Apis::Core::JsonObjectSupport
|
113
|
+
end
|
114
|
+
|
115
|
+
class GoogleMapsPlacesV1SearchTextRequestLocationBias
|
116
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
117
|
+
|
118
|
+
include Google::Apis::Core::JsonObjectSupport
|
119
|
+
end
|
120
|
+
|
121
|
+
class GoogleMapsPlacesV1SearchTextRequestLocationRestriction
|
122
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
123
|
+
|
124
|
+
include Google::Apis::Core::JsonObjectSupport
|
125
|
+
end
|
126
|
+
|
127
|
+
class GoogleMapsPlacesV1SearchTextResponse
|
128
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
129
|
+
|
130
|
+
include Google::Apis::Core::JsonObjectSupport
|
131
|
+
end
|
132
|
+
|
133
|
+
class GoogleTypeDate
|
134
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
135
|
+
|
136
|
+
include Google::Apis::Core::JsonObjectSupport
|
137
|
+
end
|
138
|
+
|
139
|
+
class GoogleTypeLatLng
|
140
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
141
|
+
|
142
|
+
include Google::Apis::Core::JsonObjectSupport
|
143
|
+
end
|
144
|
+
|
145
|
+
class GoogleTypeLocalizedText
|
146
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
147
|
+
|
148
|
+
include Google::Apis::Core::JsonObjectSupport
|
149
|
+
end
|
150
|
+
|
151
|
+
class GoogleGeoTypeViewport
|
152
|
+
# @private
|
153
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
154
|
+
property :high, as: 'high', class: Google::Apis::PlacesV1::GoogleTypeLatLng, decorator: Google::Apis::PlacesV1::GoogleTypeLatLng::Representation
|
155
|
+
|
156
|
+
property :low, as: 'low', class: Google::Apis::PlacesV1::GoogleTypeLatLng, decorator: Google::Apis::PlacesV1::GoogleTypeLatLng::Representation
|
157
|
+
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
class GoogleMapsPlacesV1AuthorAttribution
|
162
|
+
# @private
|
163
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
164
|
+
property :display_name, as: 'displayName'
|
165
|
+
property :photo_uri, as: 'photoUri'
|
166
|
+
property :uri, as: 'uri'
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
class GoogleMapsPlacesV1Circle
|
171
|
+
# @private
|
172
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
173
|
+
property :center, as: 'center', class: Google::Apis::PlacesV1::GoogleTypeLatLng, decorator: Google::Apis::PlacesV1::GoogleTypeLatLng::Representation
|
174
|
+
|
175
|
+
property :radius, as: 'radius'
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
class GoogleMapsPlacesV1Int32Range
|
180
|
+
# @private
|
181
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
182
|
+
property :max, as: 'max'
|
183
|
+
property :min, as: 'min'
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
class GoogleMapsPlacesV1Place
|
188
|
+
# @private
|
189
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
190
|
+
collection :address_components, as: 'addressComponents', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceAddressComponent, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceAddressComponent::Representation
|
191
|
+
|
192
|
+
property :adr_format_address, as: 'adrFormatAddress'
|
193
|
+
collection :attributions, as: 'attributions', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceAttribution, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceAttribution::Representation
|
194
|
+
|
195
|
+
property :business_status, as: 'businessStatus'
|
196
|
+
property :curbside_pickup, as: 'curbsidePickup'
|
197
|
+
property :current_opening_hours, as: 'currentOpeningHours', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours::Representation
|
198
|
+
|
199
|
+
collection :current_secondary_opening_hours, as: 'currentSecondaryOpeningHours', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours::Representation
|
200
|
+
|
201
|
+
property :delivery, as: 'delivery'
|
202
|
+
property :dine_in, as: 'dineIn'
|
203
|
+
property :display_name, as: 'displayName', class: Google::Apis::PlacesV1::GoogleTypeLocalizedText, decorator: Google::Apis::PlacesV1::GoogleTypeLocalizedText::Representation
|
204
|
+
|
205
|
+
property :editorial_summary, as: 'editorialSummary', class: Google::Apis::PlacesV1::GoogleTypeLocalizedText, decorator: Google::Apis::PlacesV1::GoogleTypeLocalizedText::Representation
|
206
|
+
|
207
|
+
property :formatted_address, as: 'formattedAddress'
|
208
|
+
property :google_maps_uri, as: 'googleMapsUri'
|
209
|
+
property :icon_background_color, as: 'iconBackgroundColor'
|
210
|
+
property :icon_mask_base_uri, as: 'iconMaskBaseUri'
|
211
|
+
property :id, as: 'id'
|
212
|
+
property :international_phone_number, as: 'internationalPhoneNumber'
|
213
|
+
property :location, as: 'location', class: Google::Apis::PlacesV1::GoogleTypeLatLng, decorator: Google::Apis::PlacesV1::GoogleTypeLatLng::Representation
|
214
|
+
|
215
|
+
property :name, as: 'name'
|
216
|
+
property :national_phone_number, as: 'nationalPhoneNumber'
|
217
|
+
property :opening_hours, as: 'openingHours', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours::Representation
|
218
|
+
|
219
|
+
property :plus_code, as: 'plusCode', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlacePlusCode, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlacePlusCode::Representation
|
220
|
+
|
221
|
+
property :price_level, as: 'priceLevel'
|
222
|
+
property :rating, as: 'rating'
|
223
|
+
property :reservable, as: 'reservable'
|
224
|
+
collection :reviews, as: 'reviews', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceReview, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceReview::Representation
|
225
|
+
|
226
|
+
collection :secondary_opening_hours, as: 'secondaryOpeningHours', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours::Representation
|
227
|
+
|
228
|
+
property :serves_beer, as: 'servesBeer'
|
229
|
+
property :serves_breakfast, as: 'servesBreakfast'
|
230
|
+
property :serves_brunch, as: 'servesBrunch'
|
231
|
+
property :serves_dinner, as: 'servesDinner'
|
232
|
+
property :serves_lunch, as: 'servesLunch'
|
233
|
+
property :serves_vegetarian_food, as: 'servesVegetarianFood'
|
234
|
+
property :serves_wine, as: 'servesWine'
|
235
|
+
property :takeout, as: 'takeout'
|
236
|
+
collection :types, as: 'types'
|
237
|
+
property :user_rating_count, as: 'userRatingCount'
|
238
|
+
property :utc_offset_minutes, as: 'utcOffsetMinutes'
|
239
|
+
property :viewport, as: 'viewport', class: Google::Apis::PlacesV1::GoogleGeoTypeViewport, decorator: Google::Apis::PlacesV1::GoogleGeoTypeViewport::Representation
|
240
|
+
|
241
|
+
property :website_uri, as: 'websiteUri'
|
242
|
+
property :wheelchair_accessible_entrance, as: 'wheelchairAccessibleEntrance'
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
class GoogleMapsPlacesV1PlaceAddressComponent
|
247
|
+
# @private
|
248
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
249
|
+
property :language_code, as: 'languageCode'
|
250
|
+
property :long_text, as: 'longText'
|
251
|
+
property :short_text, as: 'shortText'
|
252
|
+
collection :types, as: 'types'
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
class GoogleMapsPlacesV1PlaceAttribution
|
257
|
+
# @private
|
258
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
259
|
+
property :provider, as: 'provider'
|
260
|
+
property :provider_uri, as: 'providerUri'
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
class GoogleMapsPlacesV1PlaceOpeningHours
|
265
|
+
# @private
|
266
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
267
|
+
property :open_now, as: 'openNow'
|
268
|
+
collection :periods, as: 'periods', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursPeriod, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursPeriod::Representation
|
269
|
+
|
270
|
+
property :secondary_hours_type, as: 'secondaryHoursType'
|
271
|
+
collection :special_days, as: 'specialDays', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay::Representation
|
272
|
+
|
273
|
+
collection :weekday_descriptions, as: 'weekdayDescriptions'
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
class GoogleMapsPlacesV1PlaceOpeningHoursPeriod
|
278
|
+
# @private
|
279
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
280
|
+
property :close, as: 'close', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint::Representation
|
281
|
+
|
282
|
+
property :open, as: 'open', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint::Representation
|
283
|
+
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
class GoogleMapsPlacesV1PlaceOpeningHoursPeriodPoint
|
288
|
+
# @private
|
289
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
290
|
+
property :date, as: 'date', class: Google::Apis::PlacesV1::GoogleTypeDate, decorator: Google::Apis::PlacesV1::GoogleTypeDate::Representation
|
291
|
+
|
292
|
+
property :date_deprecated, as: 'dateDeprecated'
|
293
|
+
property :day, as: 'day'
|
294
|
+
property :hour, as: 'hour'
|
295
|
+
property :minute, as: 'minute'
|
296
|
+
property :truncated, as: 'truncated'
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
class GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay
|
301
|
+
# @private
|
302
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
303
|
+
property :date, as: 'date', class: Google::Apis::PlacesV1::GoogleTypeDate, decorator: Google::Apis::PlacesV1::GoogleTypeDate::Representation
|
304
|
+
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
class GoogleMapsPlacesV1PlacePlusCode
|
309
|
+
# @private
|
310
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
311
|
+
property :compound_code, as: 'compoundCode'
|
312
|
+
property :global_code, as: 'globalCode'
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
class GoogleMapsPlacesV1PlaceReview
|
317
|
+
# @private
|
318
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
319
|
+
property :author_attribution, as: 'authorAttribution', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1AuthorAttribution, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1AuthorAttribution::Representation
|
320
|
+
|
321
|
+
property :original_language_code, as: 'originalLanguageCode'
|
322
|
+
property :original_text, as: 'originalText', class: Google::Apis::PlacesV1::GoogleTypeLocalizedText, decorator: Google::Apis::PlacesV1::GoogleTypeLocalizedText::Representation
|
323
|
+
|
324
|
+
property :publish_time, as: 'publishTime'
|
325
|
+
property :rating, as: 'rating'
|
326
|
+
property :relative_publish_time_description, as: 'relativePublishTimeDescription'
|
327
|
+
property :text, as: 'text', class: Google::Apis::PlacesV1::GoogleTypeLocalizedText, decorator: Google::Apis::PlacesV1::GoogleTypeLocalizedText::Representation
|
328
|
+
|
329
|
+
property :translated, as: 'translated'
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
class GoogleMapsPlacesV1SearchTextRequest
|
334
|
+
# @private
|
335
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
336
|
+
property :included_type, as: 'includedType'
|
337
|
+
property :language_code, as: 'languageCode'
|
338
|
+
property :location, as: 'location', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequestLocation, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequestLocation::Representation
|
339
|
+
|
340
|
+
property :location_bias, as: 'locationBias', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequestLocationBias, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequestLocationBias::Representation
|
341
|
+
|
342
|
+
property :location_restriction, as: 'locationRestriction', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequestLocationRestriction, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequestLocationRestriction::Representation
|
343
|
+
|
344
|
+
property :max_result_count, as: 'maxResultCount'
|
345
|
+
property :min_rating, as: 'minRating'
|
346
|
+
property :open_now, as: 'openNow'
|
347
|
+
collection :price_levels, as: 'priceLevels'
|
348
|
+
property :price_range, as: 'priceRange', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1Int32Range, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1Int32Range::Representation
|
349
|
+
|
350
|
+
property :rank_preference, as: 'rankPreference'
|
351
|
+
property :region_code, as: 'regionCode'
|
352
|
+
property :strict_type_filtering, as: 'strictTypeFiltering'
|
353
|
+
property :text_query, as: 'textQuery'
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
class GoogleMapsPlacesV1SearchTextRequestLocation
|
358
|
+
# @private
|
359
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
360
|
+
property :rectangle, as: 'rectangle', class: Google::Apis::PlacesV1::GoogleGeoTypeViewport, decorator: Google::Apis::PlacesV1::GoogleGeoTypeViewport::Representation
|
361
|
+
|
362
|
+
property :strict_restriction, as: 'strictRestriction'
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
class GoogleMapsPlacesV1SearchTextRequestLocationBias
|
367
|
+
# @private
|
368
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
369
|
+
property :circle, as: 'circle', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1Circle, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1Circle::Representation
|
370
|
+
|
371
|
+
property :rectangle, as: 'rectangle', class: Google::Apis::PlacesV1::GoogleGeoTypeViewport, decorator: Google::Apis::PlacesV1::GoogleGeoTypeViewport::Representation
|
372
|
+
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
class GoogleMapsPlacesV1SearchTextRequestLocationRestriction
|
377
|
+
# @private
|
378
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
379
|
+
property :rectangle, as: 'rectangle', class: Google::Apis::PlacesV1::GoogleGeoTypeViewport, decorator: Google::Apis::PlacesV1::GoogleGeoTypeViewport::Representation
|
380
|
+
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
class GoogleMapsPlacesV1SearchTextResponse
|
385
|
+
# @private
|
386
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
387
|
+
collection :places, as: 'places', class: Google::Apis::PlacesV1::GoogleMapsPlacesV1Place, decorator: Google::Apis::PlacesV1::GoogleMapsPlacesV1Place::Representation
|
388
|
+
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
392
|
+
class GoogleTypeDate
|
393
|
+
# @private
|
394
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
395
|
+
property :day, as: 'day'
|
396
|
+
property :month, as: 'month'
|
397
|
+
property :year, as: 'year'
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
401
|
+
class GoogleTypeLatLng
|
402
|
+
# @private
|
403
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
404
|
+
property :latitude, as: 'latitude'
|
405
|
+
property :longitude, as: 'longitude'
|
406
|
+
end
|
407
|
+
end
|
408
|
+
|
409
|
+
class GoogleTypeLocalizedText
|
410
|
+
# @private
|
411
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
412
|
+
property :language_code, as: 'languageCode'
|
413
|
+
property :text, as: 'text'
|
414
|
+
end
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/core/base_service'
|
16
|
+
require 'google/apis/core/json_representation'
|
17
|
+
require 'google/apis/core/hashable'
|
18
|
+
require 'google/apis/errors'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
module PlacesV1
|
23
|
+
# Places API (New)
|
24
|
+
#
|
25
|
+
#
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# require 'google/apis/places_v1'
|
29
|
+
#
|
30
|
+
# Places = Google::Apis::PlacesV1 # Alias the module
|
31
|
+
# service = Places::PlacesAPINewService.new
|
32
|
+
#
|
33
|
+
# @see https://mapsplatform.google.com/maps-products/#places-section
|
34
|
+
class PlacesAPINewService < Google::Apis::Core::BaseService
|
35
|
+
# @return [String]
|
36
|
+
# API key. Your API key identifies your project and provides you with API access,
|
37
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
38
|
+
attr_accessor :key
|
39
|
+
|
40
|
+
# @return [String]
|
41
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
42
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
43
|
+
attr_accessor :quota_user
|
44
|
+
|
45
|
+
def initialize
|
46
|
+
super('https://places.googleapis.com/', '',
|
47
|
+
client_name: 'google-apis-places_v1',
|
48
|
+
client_version: Google::Apis::PlacesV1::GEM_VERSION)
|
49
|
+
@batch_path = 'batch'
|
50
|
+
end
|
51
|
+
|
52
|
+
# Text query based place search.
|
53
|
+
# @param [Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequest] google_maps_places_v1_search_text_request_object
|
54
|
+
# @param [String] fields
|
55
|
+
# Selector specifying which fields to include in a partial response.
|
56
|
+
# @param [String] quota_user
|
57
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
58
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
59
|
+
# @param [Google::Apis::RequestOptions] options
|
60
|
+
# Request-specific options
|
61
|
+
#
|
62
|
+
# @yield [result, err] Result & error if block supplied
|
63
|
+
# @yieldparam result [Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse] parsed result object
|
64
|
+
# @yieldparam err [StandardError] error object if request failed
|
65
|
+
#
|
66
|
+
# @return [Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse]
|
67
|
+
#
|
68
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
69
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
70
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
71
|
+
def search_texts(google_maps_places_v1_search_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
72
|
+
command = make_simple_command(:post, 'v1/Text:search', options)
|
73
|
+
command.request_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequest::Representation
|
74
|
+
command.request_object = google_maps_places_v1_search_text_request_object
|
75
|
+
command.response_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse::Representation
|
76
|
+
command.response_class = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse
|
77
|
+
command.query['fields'] = fields unless fields.nil?
|
78
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
79
|
+
execute_or_queue_command(command, &block)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Text query based place search.
|
83
|
+
# @param [Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequest] google_maps_places_v1_search_text_request_object
|
84
|
+
# @param [String] fields
|
85
|
+
# Selector specifying which fields to include in a partial response.
|
86
|
+
# @param [String] quota_user
|
87
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
88
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
89
|
+
# @param [Google::Apis::RequestOptions] options
|
90
|
+
# Request-specific options
|
91
|
+
#
|
92
|
+
# @yield [result, err] Result & error if block supplied
|
93
|
+
# @yieldparam result [Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse] parsed result object
|
94
|
+
# @yieldparam err [StandardError] error object if request failed
|
95
|
+
#
|
96
|
+
# @return [Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse]
|
97
|
+
#
|
98
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
99
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
100
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
101
|
+
def search_place_text(google_maps_places_v1_search_text_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
102
|
+
command = make_simple_command(:post, 'v1/places:searchText', options)
|
103
|
+
command.request_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextRequest::Representation
|
104
|
+
command.request_object = google_maps_places_v1_search_text_request_object
|
105
|
+
command.response_representation = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse::Representation
|
106
|
+
command.response_class = Google::Apis::PlacesV1::GoogleMapsPlacesV1SearchTextResponse
|
107
|
+
command.query['fields'] = fields unless fields.nil?
|
108
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
109
|
+
execute_or_queue_command(command, &block)
|
110
|
+
end
|
111
|
+
|
112
|
+
protected
|
113
|
+
|
114
|
+
def apply_command_defaults(command)
|
115
|
+
command.query['key'] = key unless key.nil?
|
116
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'google/apis/places_v1/service.rb'
|
16
|
+
require 'google/apis/places_v1/classes.rb'
|
17
|
+
require 'google/apis/places_v1/representations.rb'
|
18
|
+
require 'google/apis/places_v1/gem_version.rb'
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Apis
|
22
|
+
# Places API (New)
|
23
|
+
#
|
24
|
+
#
|
25
|
+
#
|
26
|
+
# @see https://mapsplatform.google.com/maps-products/#places-section
|
27
|
+
module PlacesV1
|
28
|
+
# Version of the Places API (New) this client connects to.
|
29
|
+
# This is NOT the gem version.
|
30
|
+
VERSION = 'V1'
|
31
|
+
|
32
|
+
# See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
33
|
+
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
34
|
+
|
35
|
+
# Private Service: https://www.googleapis.com/auth/maps-platform.places
|
36
|
+
AUTH_MAPS_PLATFORM_PLACES = 'https://www.googleapis.com/auth/maps-platform.places'
|
37
|
+
|
38
|
+
# Private Service: https://www.googleapis.com/auth/maps-platform.places.textsearch
|
39
|
+
AUTH_MAPS_PLATFORM_PLACES_TEXTSEARCH = 'https://www.googleapis.com/auth/maps-platform.places.textsearch'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Copyright 2020 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require "google/apis/places_v1"
|