@googlemaps/places 1.0.0 → 1.1.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.
@@ -19,6 +19,7 @@ package google.maps.places.v1;
19
19
  import "google/api/annotations.proto";
20
20
  import "google/api/client.proto";
21
21
  import "google/api/field_behavior.proto";
22
+ import "google/api/resource.proto";
22
23
  import "google/geo/type/viewport.proto";
23
24
  import "google/maps/places/v1/geometry.proto";
24
25
  import "google/maps/places/v1/place.proto";
@@ -33,30 +34,175 @@ option objc_class_prefix = "GMPSV1";
33
34
  option php_namespace = "Google\\Maps\\Places\\V1";
34
35
 
35
36
  // Service definition for the Places API.
37
+ // Note: every request actually requires a field mask set outside of the request
38
+ // proto (all/'*' is not assumed). That can be set via either a side channel
39
+ // (SystemParameterContext) over RPC, or a header (X-Goog-FieldMask) over HTTP.
40
+ // See: https://cloud.google.com/apis/docs/system-parameters
36
41
  service Places {
37
42
  option (google.api.default_host) = "places.googleapis.com";
38
43
 
44
+ // Search for places near locations.
45
+ rpc SearchNearby(SearchNearbyRequest) returns (SearchNearbyResponse) {
46
+ option (google.api.http) = {
47
+ post: "/v1/places:searchNearby"
48
+ body: "*"
49
+ };
50
+ }
51
+
39
52
  // Text query based place search.
40
53
  rpc SearchText(SearchTextRequest) returns (SearchTextResponse) {
41
54
  option (google.api.http) = {
42
- post: "/v1/Text:search"
55
+ post: "/v1/places:searchText"
43
56
  body: "*"
44
57
  };
45
58
  }
59
+
60
+ // Get a photo media with a photo reference string.
61
+ rpc GetPhotoMedia(GetPhotoMediaRequest) returns (PhotoMedia) {
62
+ option (google.api.http) = {
63
+ get: "/v1/{name=places/*/photos/*/media}"
64
+ };
65
+ option (google.api.method_signature) = "name";
66
+ }
67
+
68
+ // Get a Place with a place id (in a name) string.
69
+ rpc GetPlace(GetPlaceRequest) returns (Place) {
70
+ option (google.api.http) = {
71
+ get: "/v1/{name=places/*}"
72
+ };
73
+ option (google.api.method_signature) = "name";
74
+ }
46
75
  }
47
76
 
48
- // int 32 range. Both min and max are optional. If only min is set, then the
49
- // range only has a lower bound. If only max is set, then range only has an
50
- // upper bound. At least one of min and max must be set. Values are inclusive.
51
- message Int32Range {
52
- // Lower bound. If unset, behavior is documented on the range field.
53
- optional int32 min = 1;
77
+ // Request proto for Search Nearby.
78
+ message SearchNearbyRequest {
79
+ // The region to search.
80
+ message LocationRestriction {
81
+ oneof type {
82
+ // A circle defined by center point and radius.
83
+ Circle circle = 2;
84
+ }
85
+ }
86
+
87
+ // How results will be ranked in the response.
88
+ enum RankPreference {
89
+ // RankPreference value not set. Will use rank by POPULARITY by default.
90
+ RANK_PREFERENCE_UNSPECIFIED = 0;
91
+
92
+ // Ranks results by distance.
93
+ DISTANCE = 1;
94
+
95
+ // Ranks results by popularity.
96
+ POPULARITY = 2;
97
+ }
98
+
99
+ // Place details will be displayed with the preferred language if available.
100
+ // If the language code is unspecified or unrecognized, place details of any
101
+ // language may be returned, with a preference for English if such details
102
+ // exist.
103
+ //
104
+ // Current list of supported languages:
105
+ // https://developers.google.com/maps/faq#languagesupport.
106
+ string language_code = 1;
107
+
108
+ // The Unicode country/region code (CLDR) of the location where the
109
+ // request is coming from. This parameter is used to display the place
110
+ // details, like region-specific place name, if available. The parameter can
111
+ // affect results based on applicable law.
112
+ //
113
+ // For more information, see
114
+ // http://www.unicode.org/reports/tr35/#unicode_region_subtag.
115
+ //
116
+ //
117
+ // Note that 3-digit region codes are not currently supported.
118
+ string region_code = 2;
119
+
120
+ // Included Place type (eg, "restaurant" or "gas_station") from
121
+ // https://developers.google.com/places/supported_types.
122
+ //
123
+ // If there are any conflicting types, i.e. a type appears in both
124
+ // included_types and excluded_types, an INVALID_ARGUMENT error is
125
+ // returned.
126
+ //
127
+ // If a Place type is specified with multiple type restrictions, only places
128
+ // that satisfy all of the restrictions are returned. For example, if we
129
+ // have {included_types = ["restaurant"], excluded_primary_types =
130
+ // ["restaurant"]}, the returned places are POIs that provide "restaurant"
131
+ // related services but do not operate primarily as "restaurants".
132
+ repeated string included_types = 3;
133
+
134
+ // Excluded Place type (eg, "restaurant" or "gas_station") from
135
+ // https://developers.google.com/places/supported_types.
136
+ //
137
+ // If the client provides both included_types (e.g. restaurant) and
138
+ // excluded_types (e.g. cafe), then the response should include places that
139
+ // are restaurant but not cafe. The response includes places that match at
140
+ // least one of the included_types and none of the excluded_types.
141
+ //
142
+ // If there are any conflicting types, i.e. a type appears in both
143
+ // included_types and excluded_types, an INVALID_ARGUMENT error is returned.
144
+ //
145
+ // If a Place type is specified with multiple type restrictions, only places
146
+ // that satisfy all of the restrictions are returned. For example, if we
147
+ // have {included_types = ["restaurant"], excluded_primary_types =
148
+ // ["restaurant"]}, the returned places are POIs that provide "restaurant"
149
+ // related services but do not operate primarily as "restaurants".
150
+ repeated string excluded_types = 4;
151
+
152
+ // Included primary Place type (e.g. "restaurant" or "gas_station") from
153
+ // https://developers.google.com/places/supported_types.
154
+ //
155
+ // If there are any conflicting primary types, i.e. a type appears in both
156
+ // included_primary_types and excluded_primary_types, an INVALID_ARGUMENT
157
+ // error is returned.
158
+ //
159
+ // If a Place type is specified with multiple type restrictions, only places
160
+ // that satisfy all of the restrictions are returned. For example, if we
161
+ // have {included_types = ["restaurant"], excluded_primary_types =
162
+ // ["restaurant"]}, the returned places are POIs that provide "restaurant"
163
+ // related services but do not operate primarily as "restaurants".
164
+ repeated string included_primary_types = 5;
165
+
166
+ // Excluded primary Place type (e.g. "restaurant" or "gas_station") from
167
+ // https://developers.google.com/places/supported_types.
168
+ //
169
+ // If there are any conflicting primary types, i.e. a type appears in both
170
+ // included_primary_types and excluded_primary_types, an INVALID_ARGUMENT
171
+ // error is returned.
172
+ //
173
+ // If a Place type is specified with multiple type restrictions, only places
174
+ // that satisfy all of the restrictions are returned. For example, if we
175
+ // have {included_types = ["restaurant"], excluded_primary_types =
176
+ // ["restaurant"]}, the returned places are POIs that provide "restaurant"
177
+ // related services but do not operate primarily as "restaurants".
178
+ repeated string excluded_primary_types = 6;
179
+
180
+ // Maximum number of results to return. It must be between 1 and 20,
181
+ // inclusively. If the number is unset, it falls back to the upper limit. If
182
+ // the number is set to negative or exceeds the upper limit, an
183
+ // INVALID_ARGUMENT error is returned.
184
+ int32 max_result_count = 7;
185
+
186
+ // Required. The region to search.
187
+ LocationRestriction location_restriction = 8
188
+ [(google.api.field_behavior) = REQUIRED];
54
189
 
55
- // Upper bound. If unset, behavior is documented on the range field.
56
- optional int32 max = 2;
190
+ // How results will be ranked in the response.
191
+ RankPreference rank_preference = 9;
57
192
  }
58
193
 
59
- // Request data structure for SearchText.
194
+ // Response proto for Search Nearby.
195
+ //
196
+ //
197
+ message SearchNearbyResponse {
198
+ // A list of interesting places that meets user's requirements like places
199
+ // types, number of places and specific location restriction.
200
+ repeated Place places = 1;
201
+ }
202
+
203
+ // Request proto for SearchText.
204
+ //
205
+ //
60
206
  message SearchTextRequest {
61
207
  // How results will be ranked in the response.
62
208
  enum RankPreference {
@@ -71,21 +217,6 @@ message SearchTextRequest {
71
217
  RELEVANCE = 2;
72
218
  }
73
219
 
74
- // The region to search.
75
- //
76
- // Deprecated. Use LocationRestriction or LocationBias instead.
77
- message Location {
78
- oneof type {
79
- // A rectangle box defined by northeast and southwest corner.
80
- google.geo.type.Viewport rectangle = 1;
81
- }
82
-
83
- // Make location field a strict restriction and filter out POIs outside of
84
- // the given location. If location type field is unset this field will have
85
- // no effect.
86
- bool strict_restriction = 2;
87
- }
88
-
89
220
  // The region to search. This location serves as a bias which means results
90
221
  // around given location might be returned.
91
222
  message LocationBias {
@@ -120,8 +251,9 @@ message SearchTextRequest {
120
251
  string language_code = 2;
121
252
 
122
253
  // The Unicode country/region code (CLDR) of the location where the
123
- // request is coming from. It is used to display the place details, like
124
- // region-specific place name, if available.
254
+ // request is coming from. This parameter is used to display the place
255
+ // details, like region-specific place name, if available. The parameter can
256
+ // affect results based on applicable law.
125
257
  //
126
258
  // For more information, see
127
259
  // http://www.unicode.org/reports/tr35/#unicode_region_subtag.
@@ -133,14 +265,6 @@ message SearchTextRequest {
133
265
  // How results will be ranked in the response.
134
266
  RankPreference rank_preference = 4;
135
267
 
136
- // The region to search. Setting location would usually yields
137
- // better results. Recommended to set. This location serves as a bias unless
138
- // strict_restriction is set to true, which turns the location to a strict
139
- // restriction.
140
- //
141
- // Deprecated. Use LocationRestriction or LocationBias instead.
142
- Location location = 5 [deprecated = true];
143
-
144
268
  // The requested place type. Full list of types supported:
145
269
  // https://developers.google.com/places/supported_types. Only support one
146
270
  // included type.
@@ -150,16 +274,9 @@ message SearchTextRequest {
150
274
  // open_now marks if a business is currently open.
151
275
  bool open_now = 7;
152
276
 
153
- // [Deprecated!]Used to restrict the search to places that are within a
154
- // certain price range. This is on a scale of 0 to 4. Set a minimum of 0 or
155
- // set a maximum of 4 has no effect on the search results. Min price is
156
- // default to 0 and max price is default to 4. Default value will be used if
157
- // either min or max is unset.
158
- Int32Range price_range = 8 [deprecated = true];
159
-
160
277
  // Filter out results whose average user rating is strictly less than this
161
278
  // limit. A valid value must be an float between 0 and 5 (inclusively) at a
162
- // 0.5 cadence i.e. `[0, 0.5, 1.0, ... , 5.0]` inclusively. This is to keep
279
+ // 0.5 cadence i.e. [0, 0.5, 1.0, ... , 5.0] inclusively. This is to keep
163
280
  // parity with LocalRefinement_UserRating. The input rating will round up to
164
281
  // the nearest 0.5(ceiling). For instance, a rating of 0.6 will eliminate all
165
282
  // results with a less than 1.0 rating.
@@ -197,3 +314,93 @@ message SearchTextResponse {
197
314
  // A list of places that meet the user's text search criteria.
198
315
  repeated Place places = 1;
199
316
  }
317
+
318
+ // Request for fetching a photo of a place using a photo resource name.
319
+ message GetPhotoMediaRequest {
320
+ // Required. The resource name of a photo. It is returned in Place's
321
+ // photos.name field. Format:
322
+ // places/<place_id>/photos/<photo_reference>/media.
323
+ string name = 1 [
324
+ (google.api.field_behavior) = REQUIRED,
325
+ (google.api.resource_reference) = {
326
+ type: "places.googleapis.com/PhotoMedia"
327
+ }
328
+ ];
329
+
330
+ // Optional. Specifies the maximum desired width, in pixels, of the image. If
331
+ // the image is smaller than the values specified, the original image will be
332
+ // returned. If the image is larger in either dimension, it will be scaled to
333
+ // match the smaller of the two dimensions, restricted to its original aspect
334
+ // ratio. Both the max_height_px and max_width_px properties accept an integer
335
+ // between 1 and 4800, inclusively. If the value is not within the allowed
336
+ // range, an INVALID_ARGUMENT error will be returned.
337
+ //
338
+ // At least one of max_height_px or max_width_px needs to be specified. If
339
+ // neither max_height_px nor max_width_px is specified, an INVALID_ARGUMENT
340
+ // error will be returned.
341
+ int32 max_width_px = 2 [(google.api.field_behavior) = OPTIONAL];
342
+
343
+ // Optional. Specifies the maximum desired height, in pixels, of the image. If
344
+ // the image is smaller than the values specified, the original image will be
345
+ // returned. If the image is larger in either dimension, it will be scaled to
346
+ // match the smaller of the two dimensions, restricted to its original aspect
347
+ // ratio. Both the max_height_px and max_width_px properties accept an integer
348
+ // between 1 and 4800, inclusively. If the value is not within the allowed
349
+ // range, an INVALID_ARGUMENT error will be returned.
350
+ //
351
+ // At least one of max_height_px or max_width_px needs to be specified. If
352
+ // neither max_height_px nor max_width_px is specified, an INVALID_ARGUMENT
353
+ // error will be returned.
354
+ int32 max_height_px = 3 [(google.api.field_behavior) = OPTIONAL];
355
+
356
+ // Optional. If set, skip the default HTTP redirect behavior and render a text
357
+ // format (for example, in JSON format for HTTP use case) response. If not
358
+ // set, an HTTP redirect will be issued to redirect the call to the image
359
+ // midea. This option is ignored for non-HTTP requests.
360
+ bool skip_http_redirect = 4 [(google.api.field_behavior) = OPTIONAL];
361
+ }
362
+
363
+ // A photo media from Places API.
364
+ message PhotoMedia {
365
+ option (google.api.resource) = {
366
+ type: "places.googleapis.com/PhotoMedia"
367
+ pattern: "places/{place_id}/photos/{photo_reference}/media"
368
+ plural: "photoMedias"
369
+ singular: "photoMedia"
370
+ };
371
+
372
+ // The resource name of a photo. It is returned in Place's photos.name field.
373
+ // Format: places/<place_id>/photos/<photo_reference>/media.
374
+ string name = 1;
375
+
376
+ // A short-lived uri that can be used to render the photo.
377
+ string photo_uri = 2;
378
+ }
379
+
380
+ // Request for fetching a Place with a place id (in a name) string.
381
+ message GetPlaceRequest {
382
+ // Required. A place_id returned in a Place (with "places/" prefix), or
383
+ // equivalently the name in the same Place. Format: places/<place_id>.
384
+ string name = 1 [
385
+ (google.api.field_behavior) = REQUIRED,
386
+ (google.api.resource_reference) = { type: "places.googleapis.com/Place" }
387
+ ];
388
+
389
+ // Optional. Place details will be displayed with the preferred language if
390
+ // available.
391
+ //
392
+ // Current list of supported languages:
393
+ // https://developers.google.com/maps/faq#languagesupport.
394
+ string language_code = 2 [(google.api.field_behavior) = OPTIONAL];
395
+
396
+ // Optional. The Unicode country/region code (CLDR) of the location where the
397
+ // request is coming from. This parameter is used to display the place
398
+ // details, like region-specific place name, if available. The parameter can
399
+ // affect results based on applicable law.
400
+ // For more information, see
401
+ // http://www.unicode.org/reports/tr35/#unicode_region_subtag.
402
+ //
403
+ //
404
+ // Note that 3-digit region codes are not currently supported.
405
+ string region_code = 3 [(google.api.field_behavior) = OPTIONAL];
406
+ }
@@ -0,0 +1,72 @@
1
+ // Copyright 2023 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
+ syntax = "proto3";
16
+
17
+ package google.maps.places.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/maps/places/v1/attribution.proto";
22
+ import "google/protobuf/timestamp.proto";
23
+ import "google/type/localized_text.proto";
24
+
25
+ option cc_enable_arenas = true;
26
+ option csharp_namespace = "Google.Maps.Places.V1";
27
+ option go_package = "cloud.google.com/go/maps/places/apiv1/placespb;placespb";
28
+ option java_multiple_files = true;
29
+ option java_outer_classname = "ReviewProto";
30
+ option java_package = "com.google.maps.places.v1";
31
+ option objc_class_prefix = "GMPSV1";
32
+ option php_namespace = "Google\\Maps\\Places\\V1";
33
+
34
+ // Information about a review of a place.
35
+ message Review {
36
+ option (google.api.resource) = {
37
+ type: "places.googleapis.com/Review"
38
+ pattern: "places/{place}/reviews/{review}"
39
+ plural: "reviews"
40
+ singular: "review"
41
+ };
42
+
43
+ // Output only. A reference representing this place review which may be used
44
+ // to look up this place review again (a.k.a. the API "resource" name:
45
+ // places/{place_id}/reviews/{review}).
46
+ string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
47
+
48
+ // Output only. A string of formatted recent time, expressing the review time
49
+ // relative to the current time in a form appropriate for the language and
50
+ // country.
51
+ string relative_publish_time_description = 2
52
+ [(google.api.field_behavior) = OUTPUT_ONLY];
53
+
54
+ // Output only. The localized text of the review.
55
+ google.type.LocalizedText text = 9
56
+ [(google.api.field_behavior) = OUTPUT_ONLY];
57
+
58
+ // Output only. The review text in its original language.
59
+ google.type.LocalizedText original_text = 12
60
+ [(google.api.field_behavior) = OUTPUT_ONLY];
61
+
62
+ // Output only. A number between 1.0 and 5.0, a.k.a. the number of stars.
63
+ double rating = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
64
+
65
+ // Output only. This review's author.
66
+ AuthorAttribution author_attribution = 13
67
+ [(google.api.field_behavior) = OUTPUT_ONLY];
68
+
69
+ // Output only. Timestamp for the review.
70
+ google.protobuf.Timestamp publish_time = 14
71
+ [(google.api.field_behavior) = OUTPUT_ONLY];
72
+ }