@googlemaps/places 1.1.0 → 1.3.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.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -0
- package/build/protos/google/maps/places/v1/attribution.proto +8 -10
- package/build/protos/google/maps/places/v1/photo.proto +10 -11
- package/build/protos/google/maps/places/v1/place.proto +251 -253
- package/build/protos/google/maps/places/v1/places_service.proto +387 -41
- package/build/protos/google/maps/places/v1/review.proto +17 -24
- package/build/protos/protos.d.ts +8556 -7785
- package/build/protos/protos.js +26958 -25437
- package/build/protos/protos.json +3045 -3209
- package/build/src/index.js +1 -1
- package/build/src/v1/index.js +1 -1
- package/build/src/v1/places_client.d.ts +192 -37
- package/build/src/v1/places_client.js +59 -14
- package/build/src/v1/places_client.js.map +1 -1
- package/build/src/v1/places_client_config.json +4 -0
- package/package.json +5 -5
|
@@ -21,8 +21,10 @@ import "google/api/client.proto";
|
|
|
21
21
|
import "google/api/field_behavior.proto";
|
|
22
22
|
import "google/api/resource.proto";
|
|
23
23
|
import "google/geo/type/viewport.proto";
|
|
24
|
+
import "google/maps/places/v1/ev_charging.proto";
|
|
24
25
|
import "google/maps/places/v1/geometry.proto";
|
|
25
26
|
import "google/maps/places/v1/place.proto";
|
|
27
|
+
import "google/type/latlng.proto";
|
|
26
28
|
|
|
27
29
|
option cc_enable_arenas = true;
|
|
28
30
|
option csharp_namespace = "Google.Maps.Places.V1";
|
|
@@ -34,10 +36,11 @@ option objc_class_prefix = "GMPSV1";
|
|
|
34
36
|
option php_namespace = "Google\\Maps\\Places\\V1";
|
|
35
37
|
|
|
36
38
|
// Service definition for the Places API.
|
|
37
|
-
// Note: every request actually requires a field mask set outside of
|
|
38
|
-
// proto (all/'*' is not assumed). That can be set via either a
|
|
39
|
-
// (SystemParameterContext) over RPC, or a header
|
|
40
|
-
// See:
|
|
39
|
+
// Note: every request actually requires a field mask set outside of
|
|
40
|
+
// the request proto (all/'*', is not assumed). That can be set via either a
|
|
41
|
+
// side channel (SystemParameterContext) over RPC, or a header
|
|
42
|
+
// (X-Goog-FieldMask) over HTTP. See:
|
|
43
|
+
// https://cloud.google.com/apis/docs/system-parameters
|
|
41
44
|
service Places {
|
|
42
45
|
option (google.api.default_host) = "places.googleapis.com";
|
|
43
46
|
|
|
@@ -65,16 +68,28 @@ service Places {
|
|
|
65
68
|
option (google.api.method_signature) = "name";
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
// Get
|
|
71
|
+
// Get the details of a place based on its resource name, which is a string
|
|
72
|
+
// in the `places/{place_id}` format.
|
|
69
73
|
rpc GetPlace(GetPlaceRequest) returns (Place) {
|
|
70
74
|
option (google.api.http) = {
|
|
71
75
|
get: "/v1/{name=places/*}"
|
|
72
76
|
};
|
|
73
77
|
option (google.api.method_signature) = "name";
|
|
74
78
|
}
|
|
79
|
+
|
|
80
|
+
// Returns predictions for the given input.
|
|
81
|
+
rpc AutocompletePlaces(AutocompletePlacesRequest)
|
|
82
|
+
returns (AutocompletePlacesResponse) {
|
|
83
|
+
option (google.api.http) = {
|
|
84
|
+
post: "/v1/places:autocomplete"
|
|
85
|
+
body: "*"
|
|
86
|
+
};
|
|
87
|
+
}
|
|
75
88
|
}
|
|
76
89
|
|
|
77
90
|
// Request proto for Search Nearby.
|
|
91
|
+
//
|
|
92
|
+
//
|
|
78
93
|
message SearchNearbyRequest {
|
|
79
94
|
// The region to search.
|
|
80
95
|
message LocationRestriction {
|
|
@@ -111,14 +126,18 @@ message SearchNearbyRequest {
|
|
|
111
126
|
// affect results based on applicable law.
|
|
112
127
|
//
|
|
113
128
|
// For more information, see
|
|
114
|
-
//
|
|
129
|
+
// https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html.
|
|
115
130
|
//
|
|
116
131
|
//
|
|
117
132
|
// Note that 3-digit region codes are not currently supported.
|
|
118
133
|
string region_code = 2;
|
|
119
134
|
|
|
120
135
|
// Included Place type (eg, "restaurant" or "gas_station") from
|
|
121
|
-
// https://developers.google.com/places/
|
|
136
|
+
// https://developers.google.com/maps/documentation/places/web-service/place-types.
|
|
137
|
+
//
|
|
138
|
+
// Up to 50 types from [Table
|
|
139
|
+
// A](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)
|
|
140
|
+
// may be specified.
|
|
122
141
|
//
|
|
123
142
|
// If there are any conflicting types, i.e. a type appears in both
|
|
124
143
|
// included_types and excluded_types, an INVALID_ARGUMENT error is
|
|
@@ -127,12 +146,16 @@ message SearchNearbyRequest {
|
|
|
127
146
|
// If a Place type is specified with multiple type restrictions, only places
|
|
128
147
|
// that satisfy all of the restrictions are returned. For example, if we
|
|
129
148
|
// have {included_types = ["restaurant"], excluded_primary_types =
|
|
130
|
-
// ["restaurant"]}, the returned places
|
|
149
|
+
// ["restaurant"]}, the returned places provide "restaurant"
|
|
131
150
|
// related services but do not operate primarily as "restaurants".
|
|
132
151
|
repeated string included_types = 3;
|
|
133
152
|
|
|
134
153
|
// Excluded Place type (eg, "restaurant" or "gas_station") from
|
|
135
|
-
// https://developers.google.com/places/
|
|
154
|
+
// https://developers.google.com/maps/documentation/places/web-service/place-types.
|
|
155
|
+
//
|
|
156
|
+
// Up to 50 types from [Table
|
|
157
|
+
// A](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)
|
|
158
|
+
// may be specified.
|
|
136
159
|
//
|
|
137
160
|
// If the client provides both included_types (e.g. restaurant) and
|
|
138
161
|
// excluded_types (e.g. cafe), then the response should include places that
|
|
@@ -145,12 +168,18 @@ message SearchNearbyRequest {
|
|
|
145
168
|
// If a Place type is specified with multiple type restrictions, only places
|
|
146
169
|
// that satisfy all of the restrictions are returned. For example, if we
|
|
147
170
|
// have {included_types = ["restaurant"], excluded_primary_types =
|
|
148
|
-
// ["restaurant"]}, the returned places
|
|
171
|
+
// ["restaurant"]}, the returned places provide "restaurant"
|
|
149
172
|
// related services but do not operate primarily as "restaurants".
|
|
150
173
|
repeated string excluded_types = 4;
|
|
151
174
|
|
|
152
175
|
// Included primary Place type (e.g. "restaurant" or "gas_station") from
|
|
153
|
-
// https://developers.google.com/places/
|
|
176
|
+
// https://developers.google.com/maps/documentation/places/web-service/place-types.
|
|
177
|
+
// A place can only have a single primary type from the supported types table
|
|
178
|
+
// associated with it.
|
|
179
|
+
//
|
|
180
|
+
// Up to 50 types from [Table
|
|
181
|
+
// A](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)
|
|
182
|
+
// may be specified.
|
|
154
183
|
//
|
|
155
184
|
// If there are any conflicting primary types, i.e. a type appears in both
|
|
156
185
|
// included_primary_types and excluded_primary_types, an INVALID_ARGUMENT
|
|
@@ -159,12 +188,16 @@ message SearchNearbyRequest {
|
|
|
159
188
|
// If a Place type is specified with multiple type restrictions, only places
|
|
160
189
|
// that satisfy all of the restrictions are returned. For example, if we
|
|
161
190
|
// have {included_types = ["restaurant"], excluded_primary_types =
|
|
162
|
-
// ["restaurant"]}, the returned places
|
|
191
|
+
// ["restaurant"]}, the returned places provide "restaurant"
|
|
163
192
|
// related services but do not operate primarily as "restaurants".
|
|
164
193
|
repeated string included_primary_types = 5;
|
|
165
194
|
|
|
166
195
|
// Excluded primary Place type (e.g. "restaurant" or "gas_station") from
|
|
167
|
-
// https://developers.google.com/places/
|
|
196
|
+
// https://developers.google.com/maps/documentation/places/web-service/place-types.
|
|
197
|
+
//
|
|
198
|
+
// Up to 50 types from [Table
|
|
199
|
+
// A](https://developers.google.com/maps/documentation/places/web-service/place-types#table-a)
|
|
200
|
+
// may be specified.
|
|
168
201
|
//
|
|
169
202
|
// If there are any conflicting primary types, i.e. a type appears in both
|
|
170
203
|
// included_primary_types and excluded_primary_types, an INVALID_ARGUMENT
|
|
@@ -173,11 +206,11 @@ message SearchNearbyRequest {
|
|
|
173
206
|
// If a Place type is specified with multiple type restrictions, only places
|
|
174
207
|
// that satisfy all of the restrictions are returned. For example, if we
|
|
175
208
|
// have {included_types = ["restaurant"], excluded_primary_types =
|
|
176
|
-
// ["restaurant"]}, the returned places
|
|
209
|
+
// ["restaurant"]}, the returned places provide "restaurant"
|
|
177
210
|
// related services but do not operate primarily as "restaurants".
|
|
178
211
|
repeated string excluded_primary_types = 6;
|
|
179
212
|
|
|
180
|
-
// Maximum number of results to return. It must be between 1 and 20,
|
|
213
|
+
// Maximum number of results to return. It must be between 1 and 20 (default),
|
|
181
214
|
// inclusively. If the number is unset, it falls back to the upper limit. If
|
|
182
215
|
// the number is set to negative or exceeds the upper limit, an
|
|
183
216
|
// INVALID_ARGUMENT error is returned.
|
|
@@ -193,9 +226,8 @@ message SearchNearbyRequest {
|
|
|
193
226
|
|
|
194
227
|
// Response proto for Search Nearby.
|
|
195
228
|
//
|
|
196
|
-
//
|
|
197
229
|
message SearchNearbyResponse {
|
|
198
|
-
// A list of
|
|
230
|
+
// A list of places that meets user's requirements like places
|
|
199
231
|
// types, number of places and specific location restriction.
|
|
200
232
|
repeated Place places = 1;
|
|
201
233
|
}
|
|
@@ -213,7 +245,7 @@ message SearchTextRequest {
|
|
|
213
245
|
DISTANCE = 1;
|
|
214
246
|
|
|
215
247
|
// Ranks results by relevance. Sort order determined by normal ranking
|
|
216
|
-
// stack.
|
|
248
|
+
// stack.
|
|
217
249
|
RELEVANCE = 2;
|
|
218
250
|
}
|
|
219
251
|
|
|
@@ -222,6 +254,11 @@ message SearchTextRequest {
|
|
|
222
254
|
message LocationBias {
|
|
223
255
|
oneof type {
|
|
224
256
|
// A rectangle box defined by northeast and southwest corner.
|
|
257
|
+
// `rectangle.high()` must be the northeast point of the rectangle
|
|
258
|
+
// viewport. `rectangle.low()` must be the southwest point of the
|
|
259
|
+
// rectangle viewport. `rectangle.low().latitude()` cannot be greater than
|
|
260
|
+
// `rectangle.high().latitude()`. This will result in an empty latitude
|
|
261
|
+
// range. A rectangle viewport cannot be wider than 180 degrees.
|
|
225
262
|
google.geo.type.Viewport rectangle = 1;
|
|
226
263
|
|
|
227
264
|
// A circle defined by center point and radius.
|
|
@@ -234,10 +271,28 @@ message SearchTextRequest {
|
|
|
234
271
|
message LocationRestriction {
|
|
235
272
|
oneof type {
|
|
236
273
|
// A rectangle box defined by northeast and southwest corner.
|
|
274
|
+
// `rectangle.high()` must be the northeast point of the rectangle
|
|
275
|
+
// viewport. `rectangle.low()` must be the southwest point of the
|
|
276
|
+
// rectangle viewport. `rectangle.low().latitude()` cannot be greater than
|
|
277
|
+
// `rectangle.high().latitude()`. This will result in an empty latitude
|
|
278
|
+
// range. A rectangle viewport cannot be wider than 180 degrees.
|
|
237
279
|
google.geo.type.Viewport rectangle = 1;
|
|
238
280
|
}
|
|
239
281
|
}
|
|
240
282
|
|
|
283
|
+
// Searchable EV options of a place search request.
|
|
284
|
+
message EVOptions {
|
|
285
|
+
// Optional. Filtering places by minimum charging rate. Any places with
|
|
286
|
+
// charging a rate less than the minimum charging rate are filtered out.
|
|
287
|
+
double minimum_charging_rate_kw = 1
|
|
288
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
289
|
+
|
|
290
|
+
// Optional. The list of preferred EV connector types. A place that does not
|
|
291
|
+
// support any of the listed connector types are filter out.
|
|
292
|
+
repeated EVConnectorType connector_types = 2
|
|
293
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
294
|
+
}
|
|
295
|
+
|
|
241
296
|
// Required. The text query for textual search.
|
|
242
297
|
string text_query = 1 [(google.api.field_behavior) = REQUIRED];
|
|
243
298
|
|
|
@@ -256,7 +311,7 @@ message SearchTextRequest {
|
|
|
256
311
|
// affect results based on applicable law.
|
|
257
312
|
//
|
|
258
313
|
// For more information, see
|
|
259
|
-
//
|
|
314
|
+
// https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html.
|
|
260
315
|
//
|
|
261
316
|
//
|
|
262
317
|
// Note that 3-digit region codes are not currently supported.
|
|
@@ -266,26 +321,25 @@ message SearchTextRequest {
|
|
|
266
321
|
RankPreference rank_preference = 4;
|
|
267
322
|
|
|
268
323
|
// The requested place type. Full list of types supported:
|
|
269
|
-
// https://developers.google.com/places/
|
|
270
|
-
// included type.
|
|
324
|
+
// https://developers.google.com/maps/documentation/places/web-service/place-types.
|
|
325
|
+
// Only support one included type.
|
|
271
326
|
string included_type = 6;
|
|
272
327
|
|
|
273
|
-
// Used to restrict the search to places that are open
|
|
274
|
-
//
|
|
328
|
+
// Used to restrict the search to places that are currently open. The default
|
|
329
|
+
// is false.
|
|
275
330
|
bool open_now = 7;
|
|
276
331
|
|
|
277
332
|
// Filter out results whose average user rating is strictly less than this
|
|
278
|
-
// limit. A valid value must be
|
|
279
|
-
// 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively.
|
|
280
|
-
//
|
|
281
|
-
//
|
|
282
|
-
// results with a less than 1.0 rating.
|
|
333
|
+
// limit. A valid value must be a float between 0 and 5 (inclusively) at a
|
|
334
|
+
// 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. The input rating
|
|
335
|
+
// will round up to the nearest 0.5(ceiling). For instance, a rating of 0.6
|
|
336
|
+
// will eliminate all results with a less than 1.0 rating.
|
|
283
337
|
double min_rating = 9;
|
|
284
338
|
|
|
285
339
|
// Maximum number of results to return. It must be between 1 and 20,
|
|
286
|
-
// inclusively. If the number is unset, it falls back to
|
|
287
|
-
// the number is set to negative or exceeds the upper
|
|
288
|
-
// INVALID_ARGUMENT error is returned.
|
|
340
|
+
// inclusively. The default is 20. If the number is unset, it falls back to
|
|
341
|
+
// the upper limit. If the number is set to negative or exceeds the upper
|
|
342
|
+
// limit, an INVALID_ARGUMENT error is returned.
|
|
289
343
|
int32 max_result_count = 10;
|
|
290
344
|
|
|
291
345
|
// Used to restrict the search to places that are marked as certain price
|
|
@@ -306,6 +360,9 @@ message SearchTextRequest {
|
|
|
306
360
|
// results outside given location will not be returned. Cannot be set along
|
|
307
361
|
// with location_bias.
|
|
308
362
|
LocationRestriction location_restriction = 14;
|
|
363
|
+
|
|
364
|
+
// Optional. Set the searchable EV options of a place search request.
|
|
365
|
+
EVOptions ev_options = 15 [(google.api.field_behavior) = OPTIONAL];
|
|
309
366
|
}
|
|
310
367
|
|
|
311
368
|
// Response proto for SearchText.
|
|
@@ -317,9 +374,13 @@ message SearchTextResponse {
|
|
|
317
374
|
|
|
318
375
|
// Request for fetching a photo of a place using a photo resource name.
|
|
319
376
|
message GetPhotoMediaRequest {
|
|
320
|
-
// Required. The resource name of a photo
|
|
321
|
-
// photos
|
|
322
|
-
//
|
|
377
|
+
// Required. The resource name of a photo media in the format:
|
|
378
|
+
// `places/{place_id}/photos/{photo_reference}/media`.
|
|
379
|
+
//
|
|
380
|
+
// The resource name of a photo as returned in a Place object's `photos.name`
|
|
381
|
+
// field comes with the format
|
|
382
|
+
// `places/{place_id}/photos/{photo_reference}`. You need to append `/media`
|
|
383
|
+
// at the end of the photo resource to get the photo media resource name.
|
|
323
384
|
string name = 1 [
|
|
324
385
|
(google.api.field_behavior) = REQUIRED,
|
|
325
386
|
(google.api.resource_reference) = {
|
|
@@ -356,7 +417,7 @@ message GetPhotoMediaRequest {
|
|
|
356
417
|
// Optional. If set, skip the default HTTP redirect behavior and render a text
|
|
357
418
|
// format (for example, in JSON format for HTTP use case) response. If not
|
|
358
419
|
// set, an HTTP redirect will be issued to redirect the call to the image
|
|
359
|
-
//
|
|
420
|
+
// media. This option is ignored for non-HTTP requests.
|
|
360
421
|
bool skip_http_redirect = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
361
422
|
}
|
|
362
423
|
|
|
@@ -369,18 +430,18 @@ message PhotoMedia {
|
|
|
369
430
|
singular: "photoMedia"
|
|
370
431
|
};
|
|
371
432
|
|
|
372
|
-
// The resource name of a photo
|
|
373
|
-
//
|
|
433
|
+
// The resource name of a photo media in the format:
|
|
434
|
+
// `places/{place_id}/photos/{photo_reference}/media`.
|
|
374
435
|
string name = 1;
|
|
375
436
|
|
|
376
437
|
// A short-lived uri that can be used to render the photo.
|
|
377
438
|
string photo_uri = 2;
|
|
378
439
|
}
|
|
379
440
|
|
|
380
|
-
// Request for fetching a Place
|
|
441
|
+
// Request for fetching a Place based on its resource name, which is a string in
|
|
442
|
+
// the `places/{place_id}` format.
|
|
381
443
|
message GetPlaceRequest {
|
|
382
|
-
// Required.
|
|
383
|
-
// equivalently the name in the same Place. Format: places/<place_id>.
|
|
444
|
+
// Required. The resource name of a place, in the `places/{place_id}` format.
|
|
384
445
|
string name = 1 [
|
|
385
446
|
(google.api.field_behavior) = REQUIRED,
|
|
386
447
|
(google.api.resource_reference) = { type: "places.googleapis.com/Place" }
|
|
@@ -398,9 +459,294 @@ message GetPlaceRequest {
|
|
|
398
459
|
// details, like region-specific place name, if available. The parameter can
|
|
399
460
|
// affect results based on applicable law.
|
|
400
461
|
// For more information, see
|
|
401
|
-
//
|
|
462
|
+
// https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html.
|
|
402
463
|
//
|
|
403
464
|
//
|
|
404
465
|
// Note that 3-digit region codes are not currently supported.
|
|
405
466
|
string region_code = 3 [(google.api.field_behavior) = OPTIONAL];
|
|
467
|
+
|
|
468
|
+
// Optional. An arbitrary string which identifies an autocomplete session for
|
|
469
|
+
// billing purposes. Must be at most 36 characters in length. Otherwise an
|
|
470
|
+
// INVALID_ARGUMENT error is returned.
|
|
471
|
+
//
|
|
472
|
+
// The session begins when the user starts typing a query, and concludes when
|
|
473
|
+
// they select a place and a call to Place Details or Address Validation is
|
|
474
|
+
// made. Each session can have multiple queries, followed by one Place
|
|
475
|
+
// selection. The credentials used for each request within a session must
|
|
476
|
+
// belong to the same Google Cloud Console project. Once a session has
|
|
477
|
+
// concluded, the token is no longer valid; your app must generate a fresh
|
|
478
|
+
// token for each session. If the `session_token` parameter is omitted, or if
|
|
479
|
+
// you reuse a session token, the session is charged as if no session token
|
|
480
|
+
// was provided (each request is billed separately).
|
|
481
|
+
//
|
|
482
|
+
// We recommend the following guidelines:
|
|
483
|
+
// * Use session tokens for all Place Autocomplete calls.
|
|
484
|
+
// * Generate a fresh token for each session. Using a version 4 UUID is
|
|
485
|
+
// recommended.
|
|
486
|
+
// * Ensure that the credentials used for all Place Autocomplete, Place
|
|
487
|
+
// Details, and Address Validation requests within a session belong to the
|
|
488
|
+
// same Cloud Console project.
|
|
489
|
+
// * Be sure to pass a unique session token for each new session. Using the
|
|
490
|
+
// same token for more than one session will result in each request being
|
|
491
|
+
// billed individually.
|
|
492
|
+
string session_token = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// Request proto for AutocompletePlaces.
|
|
496
|
+
message AutocompletePlacesRequest {
|
|
497
|
+
// The region to search. The results may be biased around the specified
|
|
498
|
+
// region.
|
|
499
|
+
message LocationBias {
|
|
500
|
+
oneof type {
|
|
501
|
+
// A viewport defined by a northeast and a southwest corner.
|
|
502
|
+
google.geo.type.Viewport rectangle = 1;
|
|
503
|
+
|
|
504
|
+
// A circle defined by a center point and radius.
|
|
505
|
+
Circle circle = 2;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// The region to search. The results will be restricted to the specified
|
|
510
|
+
// region.
|
|
511
|
+
message LocationRestriction {
|
|
512
|
+
oneof type {
|
|
513
|
+
// A viewport defined by a northeast and a southwest corner.
|
|
514
|
+
google.geo.type.Viewport rectangle = 1;
|
|
515
|
+
|
|
516
|
+
// A circle defined by a center point and radius.
|
|
517
|
+
Circle circle = 2;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// Required. The text string on which to search.
|
|
522
|
+
string input = 1 [(google.api.field_behavior) = REQUIRED];
|
|
523
|
+
|
|
524
|
+
// Optional. Bias results to a specified location.
|
|
525
|
+
//
|
|
526
|
+
// At most one of `location_bias` or `location_restriction` should be set. If
|
|
527
|
+
// neither are set, the results will be biased by IP address, meaning the IP
|
|
528
|
+
// address will be mapped to an imprecise location and used as a biasing
|
|
529
|
+
// signal.
|
|
530
|
+
LocationBias location_bias = 2 [(google.api.field_behavior) = OPTIONAL];
|
|
531
|
+
|
|
532
|
+
// Optional. Restrict results to a specified location.
|
|
533
|
+
//
|
|
534
|
+
// At most one of `location_bias` or `location_restriction` should be set. If
|
|
535
|
+
// neither are set, the results will be biased by IP address, meaning the IP
|
|
536
|
+
// address will be mapped to an imprecise location and used as a biasing
|
|
537
|
+
// signal.
|
|
538
|
+
LocationRestriction location_restriction = 3
|
|
539
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
540
|
+
|
|
541
|
+
// Optional. Included primary Place type (e.g. "restaurant" or "gas_station")
|
|
542
|
+
// from
|
|
543
|
+
// https://developers.google.com/maps/documentation/places/web-service/place-types.
|
|
544
|
+
// A Place is only returned if its primary type is included in this list. Up
|
|
545
|
+
// to 5 values can be specified. If no types are specified, all Place types
|
|
546
|
+
// are returned.
|
|
547
|
+
repeated string included_primary_types = 4
|
|
548
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
549
|
+
|
|
550
|
+
// Optional. Only include results in the specified regions, specified as up to
|
|
551
|
+
// 15 CLDR two-character region codes. An empty set will not restrict the
|
|
552
|
+
// results. If both `location_restriction` and `included_region_codes` are
|
|
553
|
+
// set, the results will be located in the area of intersection.
|
|
554
|
+
repeated string included_region_codes = 5
|
|
555
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
556
|
+
|
|
557
|
+
// Optional. The language in which to return results. Defaults to en-US. The
|
|
558
|
+
// results may be in mixed languages if the language used in `input` is
|
|
559
|
+
// different from `language_code` or if the returned Place does not have a
|
|
560
|
+
// translation from the local language to `language_code`.
|
|
561
|
+
string language_code = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
562
|
+
|
|
563
|
+
// Optional. The region code, specified as a CLDR two-character region code.
|
|
564
|
+
// This affects address formatting, result ranking, and may influence what
|
|
565
|
+
// results are returned. This does not restrict results to the specified
|
|
566
|
+
// region. To restrict results to a region, use `region_code_restriction`.
|
|
567
|
+
string region_code = 7 [(google.api.field_behavior) = OPTIONAL];
|
|
568
|
+
|
|
569
|
+
// Optional. The origin point from which to calculate geodesic distance to the
|
|
570
|
+
// destination (returned as `distance_meters`). If this value is omitted,
|
|
571
|
+
// geodesic distance will not be returned.
|
|
572
|
+
google.type.LatLng origin = 8 [(google.api.field_behavior) = OPTIONAL];
|
|
573
|
+
|
|
574
|
+
// Optional. A zero-based Unicode character offset of `input` indicating the
|
|
575
|
+
// cursor position in `input`. The cursor position may influence what
|
|
576
|
+
// predictions are returned.
|
|
577
|
+
//
|
|
578
|
+
// If empty, defaults to the length of `input`.
|
|
579
|
+
int32 input_offset = 9 [(google.api.field_behavior) = OPTIONAL];
|
|
580
|
+
|
|
581
|
+
// Optional. If true, the response will include both Place and query
|
|
582
|
+
// predictions. Otherwise the response will only return Place predictions.
|
|
583
|
+
bool include_query_predictions = 10 [(google.api.field_behavior) = OPTIONAL];
|
|
584
|
+
|
|
585
|
+
// Optional. An arbitrary string which identifies an autocomplete session for
|
|
586
|
+
// billing purposes. Must be at most 36 characters in length. Otherwise an
|
|
587
|
+
// INVALID_ARGUMENT error is returned.
|
|
588
|
+
//
|
|
589
|
+
// The session begins when the user starts typing a query, and concludes when
|
|
590
|
+
// they select a place and a call to Place Details or Address Validation is
|
|
591
|
+
// made. Each session can have multiple queries, followed by one Place
|
|
592
|
+
// selection. The credentials used for each request within a session must
|
|
593
|
+
// belong to the same Google Cloud Console project. Once a session has
|
|
594
|
+
// concluded, the token is no longer valid; your app must generate a fresh
|
|
595
|
+
// token for each session. If the `session_token` parameter is omitted, or if
|
|
596
|
+
// you reuse a session token, the session is charged as if no session token
|
|
597
|
+
// was provided (each request is billed separately).
|
|
598
|
+
//
|
|
599
|
+
// We recommend the following guidelines:
|
|
600
|
+
// * Use session tokens for all Place Autocomplete calls.
|
|
601
|
+
// * Generate a fresh token for each session. Using a version 4 UUID is
|
|
602
|
+
// recommended.
|
|
603
|
+
// * Ensure that the credentials used for all Place Autocomplete, Place
|
|
604
|
+
// Details, and Address Validation requests within a session belong to the
|
|
605
|
+
// same Cloud Console project.
|
|
606
|
+
// * Be sure to pass a unique session token for each new session. Using the
|
|
607
|
+
// same token for more than one session will result in each request being
|
|
608
|
+
// billed individually.
|
|
609
|
+
string session_token = 11 [(google.api.field_behavior) = OPTIONAL];
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// Response proto for AutocompletePlaces.
|
|
613
|
+
message AutocompletePlacesResponse {
|
|
614
|
+
// An Autocomplete suggestion result.
|
|
615
|
+
message Suggestion {
|
|
616
|
+
// Identifies a substring within a given text.
|
|
617
|
+
message StringRange {
|
|
618
|
+
// Zero-based offset of the first Unicode character of the string
|
|
619
|
+
// (inclusive).
|
|
620
|
+
int32 start_offset = 1;
|
|
621
|
+
|
|
622
|
+
// Zero-based offset of the last Unicode character (exclusive).
|
|
623
|
+
int32 end_offset = 2;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// Text representing a Place or query prediction. The text may be used as is
|
|
627
|
+
// or formatted.
|
|
628
|
+
message FormattableText {
|
|
629
|
+
// Text that may be used as is or formatted with `matches`.
|
|
630
|
+
string text = 1;
|
|
631
|
+
|
|
632
|
+
// A list of string ranges identifying where the input request matched in
|
|
633
|
+
// `text`. The ranges can be used to format specific parts of `text`. The
|
|
634
|
+
// substrings may not be exact matches of `input` if the matching was
|
|
635
|
+
// determined by criteria other than string matching (e.g. spell
|
|
636
|
+
// corrections or transliterations).
|
|
637
|
+
//
|
|
638
|
+
// These values are Unicode character offsets of `text`. The ranges are
|
|
639
|
+
// guaranteed to be ordered in increasing offset values.
|
|
640
|
+
repeated StringRange matches = 2;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// Contains a breakdown of a Place or query prediction into main text
|
|
644
|
+
// and secondary text.
|
|
645
|
+
//
|
|
646
|
+
// For Place predictions, the main text contains the specific name of the
|
|
647
|
+
// Place. For query predictions, the main text contains the query.
|
|
648
|
+
//
|
|
649
|
+
// The secondary text contains additional disambiguating features (such as a
|
|
650
|
+
// city or region) to further identify the Place or refine the query.
|
|
651
|
+
message StructuredFormat {
|
|
652
|
+
// Represents the name of the Place or query.
|
|
653
|
+
FormattableText main_text = 1;
|
|
654
|
+
|
|
655
|
+
// Represents additional disambiguating features (such as a city or
|
|
656
|
+
// region) to further identify the Place or refine the query.
|
|
657
|
+
FormattableText secondary_text = 2;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// Prediction results for a Place Autocomplete prediction.
|
|
661
|
+
message PlacePrediction {
|
|
662
|
+
// The resource name of the suggested Place. This name can be used in
|
|
663
|
+
// other APIs that accept Place names.
|
|
664
|
+
string place = 1 [(google.api.resource_reference) = {
|
|
665
|
+
type: "places.googleapis.com/Place"
|
|
666
|
+
}];
|
|
667
|
+
|
|
668
|
+
// The unique identifier of the suggested Place. This identifier can be
|
|
669
|
+
// used in other APIs that accept Place IDs.
|
|
670
|
+
string place_id = 2;
|
|
671
|
+
|
|
672
|
+
// Contains the human-readable name for the returned result. For
|
|
673
|
+
// establishment results, this is usually the business name and address.
|
|
674
|
+
//
|
|
675
|
+
// `text` is recommended for developers who wish to show a single UI
|
|
676
|
+
// element. Developers who wish to show two separate, but related, UI
|
|
677
|
+
// elements may want to use `structured_format` instead. They are two
|
|
678
|
+
// different ways to represent a Place prediction. Users should not try to
|
|
679
|
+
// parse `structured_format` into `text` or vice versa.
|
|
680
|
+
//
|
|
681
|
+
// This text may be different from the `display_name` returned by
|
|
682
|
+
// GetPlace.
|
|
683
|
+
//
|
|
684
|
+
// May be in mixed languages if the request `input` and `language_code`
|
|
685
|
+
// are in different languages or if the Place does not have a translation
|
|
686
|
+
// from the local language to `language_code`.
|
|
687
|
+
FormattableText text = 3;
|
|
688
|
+
|
|
689
|
+
// A breakdown of the Place prediction into main text containing the name
|
|
690
|
+
// of the Place and secondary text containing additional disambiguating
|
|
691
|
+
// features (such as a city or region).
|
|
692
|
+
//
|
|
693
|
+
// `structured_format` is recommended for developers who wish to show two
|
|
694
|
+
// separate, but related, UI elements. Developers who wish to show a
|
|
695
|
+
// single UI element may want to use `text` instead. They are two
|
|
696
|
+
// different ways to represent a Place prediction. Users should not try to
|
|
697
|
+
// parse `structured_format` into `text` or vice versa.
|
|
698
|
+
StructuredFormat structured_format = 4;
|
|
699
|
+
|
|
700
|
+
// List of types that apply to this Place from Table A or Table B in
|
|
701
|
+
// https://developers.google.com/maps/documentation/places/web-service/place-types.
|
|
702
|
+
//
|
|
703
|
+
// A type is a categorization of a Place. Places with shared types will
|
|
704
|
+
// share similar characteristics.
|
|
705
|
+
repeated string types = 5;
|
|
706
|
+
|
|
707
|
+
// The length of the geodesic in meters from `origin` if `origin` is
|
|
708
|
+
// specified. Certain predictions such as routes may not populate this
|
|
709
|
+
// field.
|
|
710
|
+
int32 distance_meters = 6;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// Prediction results for a Query Autocomplete prediction.
|
|
714
|
+
message QueryPrediction {
|
|
715
|
+
// The predicted text. This text does not represent a Place, but rather a
|
|
716
|
+
// text query that could be used in a search endpoint (e.g. TextSearch).
|
|
717
|
+
//
|
|
718
|
+
// `text` is recommended for developers who wish to show a single UI
|
|
719
|
+
// element. Developers who wish to show two separate, but related, UI
|
|
720
|
+
// elements may want to use `structured_format` instead. They are two
|
|
721
|
+
// different ways to represent a query prediction. Users should not try to
|
|
722
|
+
// parse `structured_format` into `text` or vice versa.
|
|
723
|
+
//
|
|
724
|
+
// May be in mixed languages if the request `input` and `language_code`
|
|
725
|
+
// are in different languages or if part of the query does not have a
|
|
726
|
+
// translation from the local language to `language_code`.
|
|
727
|
+
FormattableText text = 1;
|
|
728
|
+
|
|
729
|
+
// A breakdown of the query prediction into main text containing the query
|
|
730
|
+
// and secondary text containing additional disambiguating features (such
|
|
731
|
+
// as a city or region).
|
|
732
|
+
//
|
|
733
|
+
// `structured_format` is recommended for developers who wish to show two
|
|
734
|
+
// separate, but related, UI elements. Developers who wish to show a
|
|
735
|
+
// single UI element may want to use `text` instead. They are two
|
|
736
|
+
// different ways to represent a query prediction. Users should not try to
|
|
737
|
+
// parse `structured_format` into `text` or vice versa.
|
|
738
|
+
StructuredFormat structured_format = 2;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
oneof kind {
|
|
742
|
+
// A prediction for a Place.
|
|
743
|
+
PlacePrediction place_prediction = 1;
|
|
744
|
+
|
|
745
|
+
// A prediction for a query.
|
|
746
|
+
QueryPrediction query_prediction = 2;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// Contains a list of suggestions, ordered in descending order of relevance.
|
|
751
|
+
repeated Suggestion suggestions = 1;
|
|
406
752
|
}
|