region_lookup_service.proto 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/maps/regionlookup/v1alpha/region_identifier.proto";
  19. import "google/maps/regionlookup/v1alpha/region_match.proto";
  20. import "google/maps/regionlookup/v1alpha/region_search_values.proto";
  21. option cc_enable_arenas = true;
  22. option csharp_namespace = "Google.Maps.RegionLookup.V1Alpha";
  23. option go_package = "google.golang.org/genproto/googleapis/maps/regionlookup/v1alpha;regionlookup";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "RegionLookupServiceProto";
  26. option java_package = "com.google.maps.regionlookup.v1alpha";
  27. option objc_class_prefix = "MRLV1A";
  28. option php_namespace = "Google\\Maps\\RegionLookup\\V1alpha";
  29. // Service definition for the Region Lookup API.
  30. service RegionLookup {
  31. option (google.api.default_host) = "regionlookup.googleapis.com";
  32. // Lookup region RPC.
  33. //
  34. // Looks up a set of region Place IDs of types related to geographic
  35. // boundaries.
  36. //
  37. // The API looks up a region Place ID using the `RegionIdentifier` proto. See
  38. // `RegionIdentifier` for more details and examples.
  39. //
  40. // The following region place types are supported for look up: postal_code,
  41. // administrative_area_level_1, administrative_area_level_2, locality,
  42. // neighborhood, and country.
  43. rpc LookupRegion(LookupRegionRequest) returns (LookupRegionResponse) {
  44. option (google.api.http) = {
  45. post: "/v1alpha:lookupRegion"
  46. body: "*"
  47. };
  48. }
  49. // Search region RPC.
  50. //
  51. // Searches for a set of region Place IDs of types related to geographic
  52. // boundaries.
  53. //
  54. // Similar to `LookupRegion` RPC but instead of looking up Place IDs for the
  55. // given `RegionIdentifier`, the API searches for Region Place IDs by
  56. // considering all regions that are contained within a specified location. The
  57. // `RegionSearchValue` is used to specify the search values. See
  58. // `RegionSearchValue` for more details and examples.
  59. //
  60. // The following region place types are supported for searching: postal_code,
  61. // administrative_area_level_1, administrative_area_level_2, locality,
  62. // neighborhood, and country.
  63. rpc SearchRegion(SearchRegionRequest) returns (SearchRegionResponse) {
  64. option (google.api.http) = {
  65. post: "/v1alpha:searchRegion"
  66. body: "*"
  67. };
  68. }
  69. }
  70. // Lookup Region Request.
  71. //
  72. // Next available tag: 4
  73. message LookupRegionRequest {
  74. // Each `RegionIdentifier` represents the desired fields used to lookup a
  75. // single region. See `RegionIdentifier` proto for more details and examples.
  76. repeated RegionIdentifier identifiers = 1;
  77. // The maximum number of matches to return. The service may return fewer than
  78. // this value.
  79. //
  80. // If unspecified, at most 50 matches will be returned. The maximum value is
  81. // 1000; values above 1000 will be coerced to 1000.
  82. int32 page_size = 2;
  83. // A page token, received from a previous `LookupRegion` call. Provide this to
  84. // retrieve the subsequent page.
  85. //
  86. // When paginating, all other parameters provided to `LookupRegion` must match
  87. // the call that provided the page token.
  88. string page_token = 3;
  89. }
  90. // Lookup Region Response.
  91. //
  92. // Next available tag: 3
  93. message LookupRegionResponse {
  94. // Lookup region matches, one for each `RegionIdentifier` in
  95. // `LookupRegionRequest.identifiers`.
  96. repeated RegionMatch matches = 1;
  97. // A token that can be sent as `page_token` to retrieve the next page.
  98. // If this field is omitted, there are no subsequent pages.
  99. string next_page_token = 2;
  100. }
  101. // Search Region Request.
  102. //
  103. // Next available tag: 4
  104. message SearchRegionRequest {
  105. // Each value represents desired search values of a single region to match.
  106. // The API tries to match them to Place IDs. See `RegionSearchValue`
  107. // proto for more info and examples.
  108. repeated RegionSearchValue search_values = 1;
  109. // The maximum number of matches to return. The service may return fewer than
  110. // this value.
  111. //
  112. // If unspecified, at most 50 matches will be returned. The maximum value is
  113. // 1000; values above 1000 will be coerced to 1000.
  114. int32 page_size = 2;
  115. // A page token, received from a previous `SearchRegion` call. Provide this to
  116. // retrieve the subsequent page.
  117. //
  118. // When paginating, all other parameters provided to `LookupRegion` must match
  119. // the call that provided the page token.
  120. string page_token = 3;
  121. }
  122. // Match Region Response.
  123. //
  124. // Next available tag: 3
  125. message SearchRegionResponse {
  126. // Search region matches, one for each `RegionSearchValue` in
  127. // `SearchRegionRequest.search_values`.
  128. repeated RegionMatch matches = 1;
  129. // A token that can be sent as `page_token` to retrieve the next page.
  130. // If this field is omitted, there are no subsequent pages.
  131. string next_page_token = 2;
  132. }