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