xref: /aosp_15_r20/external/googleapis/google/maps/places/v1/place.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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
15syntax = "proto3";
16
17package google.maps.places.v1;
18
19import "google/api/resource.proto";
20import "google/geo/type/viewport.proto";
21import "google/maps/places/v1/ev_charging.proto";
22import "google/maps/places/v1/fuel_options.proto";
23import "google/maps/places/v1/photo.proto";
24import "google/maps/places/v1/review.proto";
25import "google/type/date.proto";
26import "google/type/latlng.proto";
27import "google/type/localized_text.proto";
28
29option cc_enable_arenas = true;
30option csharp_namespace = "Google.Maps.Places.V1";
31option go_package = "cloud.google.com/go/maps/places/apiv1/placespb;placespb";
32option java_multiple_files = true;
33option java_outer_classname = "PlaceProto";
34option java_package = "com.google.maps.places.v1";
35option objc_class_prefix = "GMPSV1";
36option php_namespace = "Google\\Maps\\Places\\V1";
37
38// All the information representing a Place.
39message Place {
40  option (google.api.resource) = {
41    type: "places.googleapis.com/Place"
42    pattern: "places/{place_id}"
43    plural: "places"
44    singular: "place"
45  };
46
47  // The structured components that form the formatted address, if this
48  // information is available.
49  message AddressComponent {
50    // The full text description or name of the address component. For example,
51    // an address component for the country Australia may have a long_name of
52    // "Australia".
53    string long_text = 1;
54
55    // An abbreviated textual name for the address component, if available. For
56    // example, an address component for the country of Australia may have a
57    // short_name of "AU".
58    string short_text = 2;
59
60    // An array indicating the type(s) of the address component.
61    repeated string types = 3;
62
63    // The language used to format this components, in CLDR notation.
64    string language_code = 4;
65  }
66
67  // Plus code (http://plus.codes) is a location reference with two formats:
68  // global code defining a 14mx14m (1/8000th of a degree) or smaller rectangle,
69  // and compound code, replacing the prefix with a reference location.
70  message PlusCode {
71    // Place's global (full) code, such as "9FWM33GV+HQ", representing an
72    // 1/8000 by 1/8000 degree area (~14 by 14 meters).
73    string global_code = 1;
74
75    // Place's compound code, such as "33GV+HQ, Ramberg, Norway", containing
76    // the suffix of the global code and replacing the prefix with a formatted
77    // name of a reference entity.
78    string compound_code = 2;
79  }
80
81  // Information about business hour of the place.
82  message OpeningHours {
83    // A period the place remains in open_now status.
84    message Period {
85      // Status changing points.
86      message Point {
87        // A day of the week, as an integer in the range 0-6.  0 is Sunday, 1 is
88        // Monday, etc.
89        optional int32 day = 1;
90
91        // The hour in 2 digits. Ranges from 00 to 23.
92        optional int32 hour = 2;
93
94        // The minute in 2 digits. Ranges from 00 to 59.
95        optional int32 minute = 3;
96
97        // Date in the local timezone for the place.
98        google.type.Date date = 6;
99
100        // Whether or not this endpoint was truncated. Truncation occurs when
101        // the real hours are outside the times we are willing to return hours
102        // between, so we truncate the hours back to these boundaries. This
103        // ensures that at most 24 * 7 hours from midnight of the day of the
104        // request are returned.
105        bool truncated = 5;
106      }
107
108      // The time that the place starts to be open.
109      Point open = 1;
110
111      // The time that the place starts to be closed.
112      Point close = 2;
113    }
114
115    // A type used to identify the type of secondary hours.
116    enum SecondaryHoursType {
117      // Default value when secondary hour type is not specified.
118      SECONDARY_HOURS_TYPE_UNSPECIFIED = 0;
119
120      // The drive-through hour for banks, restaurants, or pharmacies.
121      DRIVE_THROUGH = 1;
122
123      // The happy hour.
124      HAPPY_HOUR = 2;
125
126      // The delivery hour.
127      DELIVERY = 3;
128
129      // The takeout hour.
130      TAKEOUT = 4;
131
132      // The kitchen hour.
133      KITCHEN = 5;
134
135      // The breakfast hour.
136      BREAKFAST = 6;
137
138      // The lunch hour.
139      LUNCH = 7;
140
141      // The dinner hour.
142      DINNER = 8;
143
144      // The brunch hour.
145      BRUNCH = 9;
146
147      // The pickup hour.
148      PICKUP = 10;
149
150      // The access hours for storage places.
151      ACCESS = 11;
152
153      // The special hours for seniors.
154      SENIOR_HOURS = 12;
155
156      // The online service hours.
157      ONLINE_SERVICE_HOURS = 13;
158    }
159
160    // Structured information for special days that fall within the period that
161    // the returned opening hours cover. Special days are days that could impact
162    // the business hours of a place, e.g. Christmas day.
163    message SpecialDay {
164      // The date of this special day.
165      google.type.Date date = 1;
166    }
167
168    // Is this place open right now?  Always present unless we lack time-of-day
169    // or timezone data for these opening hours.
170    optional bool open_now = 1;
171
172    // The periods that this place is open during the week. The periods are in
173    // chronological order, starting with Sunday in the place-local timezone. An
174    // empty (but not absent) value indicates a place that is never open, e.g.
175    // because it is closed temporarily for renovations.
176    repeated Period periods = 2;
177
178    // Localized strings describing the opening hours of this place, one string
179    // for each day of the week.  Will be empty if the hours are unknown or
180    // could not be converted to localized text. Example: "Sun: 18:00–06:00"
181    repeated string weekday_descriptions = 3;
182
183    // A type string used to identify the type of secondary hours.
184    SecondaryHoursType secondary_hours_type = 4;
185
186    // Structured information for special days that fall within the period that
187    // the returned opening hours cover. Special days are days that could impact
188    // the business hours of a place, e.g. Christmas day. Set for
189    // current_opening_hours and current_secondary_opening_hours if there are
190    // exceptional hours.
191    repeated SpecialDay special_days = 5;
192  }
193
194  // Business status for the place.
195  enum BusinessStatus {
196    // Default value. This value is unused.
197    BUSINESS_STATUS_UNSPECIFIED = 0;
198
199    // The establishment is operational, not necessarily open now.
200    OPERATIONAL = 1;
201
202    // The establishment is temporarily closed.
203    CLOSED_TEMPORARILY = 2;
204
205    // The establishment is permanently closed.
206    CLOSED_PERMANENTLY = 3;
207  }
208
209  // Information about data providers of this place.
210  message Attribution {
211    // Name of the Place's data provider.
212    string provider = 1;
213
214    // URI to the Place's data provider.
215    string provider_uri = 2;
216  }
217
218  // Payment options the place accepts.
219  message PaymentOptions {
220    // Place accepts credit cards as payment.
221    optional bool accepts_credit_cards = 1;
222
223    // Place accepts debit cards as payment.
224    optional bool accepts_debit_cards = 2;
225
226    // Place accepts cash only as payment. Places with this attribute may still
227    // accept other payment methods.
228    optional bool accepts_cash_only = 3;
229
230    // Place accepts NFC payments.
231    optional bool accepts_nfc = 4;
232  }
233
234  // Information about parking options for the place. A parking lot could
235  // support more than one option at the same time.
236  message ParkingOptions {
237    // Place offers free parking lots.
238    optional bool free_parking_lot = 1;
239
240    // Place offers paid parking lots.
241    optional bool paid_parking_lot = 2;
242
243    // Place offers free street parking.
244    optional bool free_street_parking = 3;
245
246    // Place offers paid street parking.
247    optional bool paid_street_parking = 4;
248
249    // Place offers valet parking.
250    optional bool valet_parking = 5;
251
252    // Place offers free garage parking.
253    optional bool free_garage_parking = 6;
254
255    // Place offers paid garage parking.
256    optional bool paid_garage_parking = 7;
257  }
258
259  // Place resource name and id of sub destinations that relate to the place.
260  // For example, different terminals are different destinations of an airport.
261  message SubDestination {
262    // The resource name of the sub destination.
263    string name = 1 [
264      (google.api.resource_reference) = { type: "places.googleapis.com/Place" }
265    ];
266
267    // The place id of the sub destination.
268    string id = 2;
269  }
270
271  // Information about the accessibility options a place offers.
272  message AccessibilityOptions {
273    // Place offers wheelchair accessible parking.
274    optional bool wheelchair_accessible_parking = 1;
275
276    // Places has wheelchair accessible entrance.
277    optional bool wheelchair_accessible_entrance = 2;
278
279    // Place has wheelchair accessible restroom.
280    optional bool wheelchair_accessible_restroom = 3;
281
282    // Place has wheelchair accessible seating.
283    optional bool wheelchair_accessible_seating = 4;
284  }
285
286  // This Place's resource name, in `places/{place_id}` format.  Can be used to
287  // look up the Place.
288  string name = 1;
289
290  // The unique identifier of a place.
291  string id = 2;
292
293  // The localized name of the place, suitable as a short human-readable
294  // description. For example, "Google Sydney", "Starbucks", "Pyrmont", etc.
295  google.type.LocalizedText display_name = 31;
296
297  // A set of type tags for this result. For example, "political" and
298  // "locality". For the complete list of possible values, see Table A and Table
299  // B at
300  // https://developers.google.com/maps/documentation/places/web-service/place-types
301  repeated string types = 5;
302
303  // The primary type of the given result. This type must one of the Places API
304  // supported types. For example, "restaurant", "cafe", "airport", etc.  A
305  // place can only have a single primary type.  For the complete list of
306  // possible values, see Table A and Table B at
307  // https://developers.google.com/maps/documentation/places/web-service/place-types
308  string primary_type = 50;
309
310  // The display name of the primary type, localized to the request language if
311  // applicable. For the complete list of possible values, see Table A and Table
312  // B at
313  // https://developers.google.com/maps/documentation/places/web-service/place-types
314  google.type.LocalizedText primary_type_display_name = 32;
315
316  // A human-readable phone number for the place, in national format.
317  string national_phone_number = 7;
318
319  // A human-readable phone number for the place, in international format.
320  string international_phone_number = 8;
321
322  // A full, human-readable address for this place.
323  string formatted_address = 9;
324
325  // A short, human-readable address for this place.
326  string short_formatted_address = 51;
327
328  // Repeated components for each locality level.
329  // Note the following facts about the address_components[] array:
330  // - The array of address components may contain more components than the
331  // formatted_address.
332  // - The array does not necessarily include all the political entities that
333  // contain an address, apart from those included in the formatted_address. To
334  // retrieve all the political entities that contain a specific address, you
335  // should use reverse geocoding, passing the latitude/longitude of the address
336  // as a parameter to the request.
337  // - The format of the response is not guaranteed to remain the same between
338  // requests. In particular, the number of address_components varies based on
339  // the address requested and can change over time for the same address. A
340  // component can change position in the array. The type of the component can
341  // change. A particular component may be missing in a later response.
342  repeated AddressComponent address_components = 10;
343
344  // Plus code of the place location lat/long.
345  PlusCode plus_code = 11;
346
347  // The position of this place.
348  google.type.LatLng location = 12;
349
350  // A viewport suitable for displaying the place on an average-sized map.
351  google.geo.type.Viewport viewport = 13;
352
353  // A rating between 1.0 and 5.0, based on user reviews of this place.
354  double rating = 14;
355
356  // A URL providing more information about this place.
357  string google_maps_uri = 15;
358
359  // The authoritative website for this place, e.g. a business' homepage.
360  // Note that for places that are part of a chain (e.g. an IKEA store), this
361  // will usually be the website for the individual store, not the overall
362  // chain.
363  string website_uri = 16;
364
365  // List of reviews about this place, sorted by relevance. A maximum of 5
366  // reviews can be returned.
367  repeated Review reviews = 53;
368
369  // The regular hours of operation.
370  OpeningHours regular_opening_hours = 21;
371
372  // Number of minutes this place's timezone is currently offset from UTC.
373  // This is expressed in minutes to support timezones that are offset by
374  // fractions of an hour, e.g. X hours and 15 minutes.
375  optional int32 utc_offset_minutes = 22;
376
377  // Information (including references) about photos of this place. A maximum of
378  // 10 photos can be returned.
379  repeated Photo photos = 54;
380
381  // The place's address in adr microformat: http://microformats.org/wiki/adr.
382  string adr_format_address = 24;
383
384  // The business status for the place.
385  BusinessStatus business_status = 25;
386
387  // Price level of the place.
388  PriceLevel price_level = 26;
389
390  // A set of data provider that must be shown with this result.
391  repeated Attribution attributions = 27;
392
393  // The total number of reviews (with or without text) for this place.
394  optional int32 user_rating_count = 28;
395
396  // A truncated URL to an icon mask. User can access different icon type by
397  // appending type suffix to the end (eg, ".svg" or ".png").
398  string icon_mask_base_uri = 29;
399
400  // Background color for icon_mask in hex format, e.g. #909CE1.
401  string icon_background_color = 30;
402
403  // Specifies if the business supports takeout.
404  optional bool takeout = 33;
405
406  // Specifies if the business supports delivery.
407  optional bool delivery = 34;
408
409  // Specifies if the business supports indoor or outdoor seating options.
410  optional bool dine_in = 35;
411
412  // Specifies if the business supports curbside pickup.
413  optional bool curbside_pickup = 36;
414
415  // Specifies if the place supports reservations.
416  optional bool reservable = 38;
417
418  // Specifies if the place serves breakfast.
419  optional bool serves_breakfast = 39;
420
421  // Specifies if the place serves lunch.
422  optional bool serves_lunch = 40;
423
424  // Specifies if the place serves dinner.
425  optional bool serves_dinner = 41;
426
427  // Specifies if the place serves beer.
428  optional bool serves_beer = 42;
429
430  // Specifies if the place serves wine.
431  optional bool serves_wine = 43;
432
433  // Specifies if the place serves brunch.
434  optional bool serves_brunch = 44;
435
436  // Specifies if the place serves vegetarian food.
437  optional bool serves_vegetarian_food = 45;
438
439  // The hours of operation for the next seven days (including today). The time
440  // period starts at midnight on the date of the request and ends at 11:59 pm
441  // six days later. This field includes the special_days subfield of all hours,
442  // set for dates that have exceptional hours.
443  OpeningHours current_opening_hours = 46;
444
445  // Contains an array of entries for the next seven days including information
446  // about secondary hours of a business. Secondary hours are different from a
447  // business's main hours. For example, a restaurant can specify drive through
448  // hours or delivery hours as its secondary hours. This field populates the
449  // type subfield, which draws from a predefined list of opening hours types
450  // (such as DRIVE_THROUGH, PICKUP, or TAKEOUT) based on the types of the
451  // place. This field includes the special_days subfield of all hours, set for
452  // dates that have exceptional hours.
453  repeated OpeningHours current_secondary_opening_hours = 47;
454
455  // Contains an array of entries for information about regular secondary hours
456  // of a business. Secondary hours are different from a business's main hours.
457  // For example, a restaurant can specify drive through hours or delivery hours
458  // as its secondary hours. This field populates the type subfield, which draws
459  // from a predefined list of opening hours types (such as DRIVE_THROUGH,
460  // PICKUP, or TAKEOUT) based on the types of the place.
461  repeated OpeningHours regular_secondary_opening_hours = 49;
462
463  // Contains a summary of the place. A summary is comprised of a textual
464  // overview, and also includes the language code for these if applicable.
465  // Summary text must be presented as-is and can not be modified or altered.
466  google.type.LocalizedText editorial_summary = 52;
467
468  // Place provides outdoor seating.
469  optional bool outdoor_seating = 55;
470
471  // Place provides live music.
472  optional bool live_music = 56;
473
474  // Place has a children's menu.
475  optional bool menu_for_children = 57;
476
477  // Place serves cocktails.
478  optional bool serves_cocktails = 58;
479
480  // Place serves dessert.
481  optional bool serves_dessert = 59;
482
483  // Place serves coffee.
484  optional bool serves_coffee = 60;
485
486  // Place is good for children.
487  optional bool good_for_children = 62;
488
489  // Place allows dogs.
490  optional bool allows_dogs = 63;
491
492  // Place has restroom.
493  optional bool restroom = 64;
494
495  // Place accommodates groups.
496  optional bool good_for_groups = 65;
497
498  // Place is suitable for watching sports.
499  optional bool good_for_watching_sports = 66;
500
501  // Payment options the place accepts. If a payment option data is not
502  // available, the payment option field will be unset.
503  PaymentOptions payment_options = 67;
504
505  // Options of parking provided by the place.
506  ParkingOptions parking_options = 70;
507
508  // A list of sub destinations related to the place.
509  repeated SubDestination sub_destinations = 71;
510
511  // Information about the accessibility options a place offers.
512  optional AccessibilityOptions accessibility_options = 72;
513
514  // The most recent information about fuel options in a gas station. This
515  // information is updated regularly.
516  FuelOptions fuel_options = 78;
517
518  // Information of ev charging options.
519  EVChargeOptions ev_charge_options = 79;
520}
521
522// Price level of the place.
523enum PriceLevel {
524  // Place price level is unspecified or unknown.
525  PRICE_LEVEL_UNSPECIFIED = 0;
526
527  // Place provides free services.
528  PRICE_LEVEL_FREE = 1;
529
530  // Place provides inexpensive services.
531  PRICE_LEVEL_INEXPENSIVE = 2;
532
533  // Place provides moderately priced services.
534  PRICE_LEVEL_MODERATE = 3;
535
536  // Place provides expensive services.
537  PRICE_LEVEL_EXPENSIVE = 4;
538
539  // Place provides very expensive services.
540  PRICE_LEVEL_VERY_EXPENSIVE = 5;
541}
542