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