region_search_values.proto 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.maps.regionlookup.v1alpha;
  16. import "google/api/field_behavior.proto";
  17. import "google/type/latlng.proto";
  18. option cc_enable_arenas = true;
  19. option csharp_namespace = "Google.Maps.RegionLookup.V1Alpha";
  20. option go_package = "google.golang.org/genproto/googleapis/maps/regionlookup/v1alpha;regionlookup";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "RegionSearchValuesProto";
  23. option java_package = "com.google.maps.regionlookup.v1alpha";
  24. option objc_class_prefix = "MRLV1A";
  25. option php_namespace = "Google\\Maps\\RegionLookup\\V1alpha";
  26. // Region Search Values.
  27. //
  28. // Desired search values of a single region.
  29. //
  30. // Location must be specified by one of the following: address, latlng or
  31. // place_id. If none is specified, an INVALID_ARGUMENT error is returned.
  32. // region_code must also be provided when address is specified.
  33. //
  34. // The fields address, latlng and place_id specify a location contained inside
  35. // the region to match. For example if address is "1600 Amphitheatre Pkwy,
  36. // Mountain View, CA 94043" the API returns the following matched_place_id
  37. // results when the following place_types are specified:
  38. //
  39. // place_type: matched_place_id results:
  40. // postal_code Place ID for "94043"
  41. // administrative_area_level_1 Place ID for The State of California
  42. // administrative_area_level_2 Place ID for Santa Clara County
  43. // etc.
  44. //
  45. // More Examples:
  46. //
  47. // If latlng is "latitude: 37.4220656 longitude: -122.0862784" and place_type
  48. // is "locality", the result contains the Place ID (of type "locality") for
  49. // that location (the Place ID of Mountain View, CA, in this case).
  50. //
  51. // If place_id is "ChIJj61dQgK6j4AR4GeTYWZsKWw" (Place ID for Google office in
  52. // Mountain view, CA) and place_type is "locality", the result contains the
  53. // Place ID (of type "locality") for that location (the Place ID of Mountain
  54. // View, CA, in this case).
  55. //
  56. // If no match is found, matched_place_id is not set.
  57. //
  58. // Candidates Place IDs are returned when a search finds multiple Place
  59. // IDs for the location specified. For example if the API is searching for
  60. // region Place IDs of type neighboorhood for a location that is contained
  61. // within multiple neighboords. The Place Ids will be returned as candidates in
  62. // the candidate_place_ids field.
  63. //
  64. // Next available tag: 10
  65. message RegionSearchValue {
  66. // Possible place types to match to.
  67. enum PlaceType {
  68. // Default value. This value is unused.
  69. PLACE_TYPE_UNSPECIFIED = 0;
  70. // Postal code.
  71. POSTAL_CODE = 1;
  72. // Administrative area level 1 (State in the US).
  73. ADMINISTRATIVE_AREA_LEVEL_1 = 2;
  74. // Administrative area level 2 (County in the US).
  75. ADMINISTRATIVE_AREA_LEVEL_2 = 3;
  76. // Locality (City).
  77. LOCALITY = 4;
  78. // Neighborhood.
  79. NEIGHBORHOOD = 5;
  80. // Country.
  81. COUNTRY = 6;
  82. // Sublocality.
  83. SUBLOCALITY = 7;
  84. // Administrative area level 3.
  85. ADMINISTRATIVE_AREA_LEVEL_3 = 8;
  86. // Administrative area level 4.
  87. ADMINISTRATIVE_AREA_LEVEL_4 = 9;
  88. // School district.
  89. SCHOOL_DISTRICT = 10;
  90. }
  91. // The location must be specified by one of the following:
  92. oneof location {
  93. // The unstructured street address that is contained inside a region to
  94. // match. region_code is required when address is specified.
  95. string address = 1;
  96. // The latitude and longitude that is contained inside a region to match.
  97. google.type.LatLng latlng = 2;
  98. // The Place ID that is contained inside a region to match.
  99. string place_id = 3;
  100. }
  101. // Required. The type of the place to match.
  102. PlaceType place_type = 6 [(google.api.field_behavior) = REQUIRED];
  103. // The BCP-47 language code, such as "en-US" or "sr-Latn", corresponding to
  104. // the language in which the place name and address is requested. If none is
  105. // requested, then it defaults to English.
  106. string language_code = 7;
  107. // Two-letter ISO-3166 country/region code for the location you're trying to
  108. // match. region_code is required when address is specified.
  109. string region_code = 8;
  110. }