| 1 |
// Copyright 2026 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 |
|
| 15 |
syntax = "proto3"; |
| 16 |
|
| 17 |
package google.type; |
| 18 |
|
| 19 |
option go_package = "google.golang.org/genproto/googleapis/type/postaladdress;postaladdress"; |
| 20 |
option java_multiple_files = true; |
| 21 |
option java_outer_classname = "PostalAddressProto"; |
| 22 |
option java_package = "com.google.type"; |
| 23 |
option objc_class_prefix = "GTP"; |
| 24 |
|
| 25 |
// Represents a postal address, such as for postal delivery or payments |
| 26 |
// addresses. With a postal address, a postal service can deliver items to a |
| 27 |
// premise, P.O. box, or similar. A postal address is not intended to model |
| 28 |
// geographical locations like roads, towns, or mountains. |
| 29 |
// |
| 30 |
// In typical usage, an address would be created by user input or from importing |
| 31 |
// existing data, depending on the type of process. |
| 32 |
// |
| 33 |
// Advice on address input or editing: |
| 34 |
// |
| 35 |
// - Use an internationalization-ready address widget such as |
| 36 |
// https://github.com/google/libaddressinput. |
| 37 |
// - Users should not be presented with UI elements for input or editing of |
| 38 |
// fields outside countries where that field is used. |
| 39 |
// |
| 40 |
// For more guidance on how to use this schema, see: |
| 41 |
// https://support.google.com/business/answer/6397478. |
| 42 |
message PostalAddress { |
| 43 |
// The schema revision of the `PostalAddress`. This must be set to 0, which is |
| 44 |
// the latest revision. |
| 45 |
// |
| 46 |
// All new revisions **must** be backward compatible with old revisions. |
| 47 |
int32 revision = 1; |
| 48 |
|
| 49 |
// Required. CLDR region code of the country/region of the address. This |
| 50 |
// is never inferred and it is up to the user to ensure the value is |
| 51 |
// correct. See https://cldr.unicode.org/ and |
| 52 |
// https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html |
| 53 |
// for details. Example: "CH" for Switzerland. |
| 54 |
string region_code = 2; |
| 55 |
|
| 56 |
// Optional. BCP-47 language code of the contents of this address (if |
| 57 |
// known). This is often the UI language of the input form or is expected |
| 58 |
// to match one of the languages used in the address' country/region, or their |
| 59 |
// transliterated equivalents. |
| 60 |
// This can affect formatting in certain countries, but is not critical |
| 61 |
// to the correctness of the data and will never affect any validation or |
| 62 |
// other non-formatting related operations. |
| 63 |
// |
| 64 |
// If this value is not known, it should be omitted (rather than specifying a |
| 65 |
// possibly incorrect default). |
| 66 |
// |
| 67 |
// Examples: "zh-Hant", "ja", "ja-Latn", "en". |
| 68 |
string language_code = 3; |
| 69 |
|
| 70 |
// Optional. Postal code of the address. Not all countries use or require |
| 71 |
// postal codes to be present, but where they are used, they may trigger |
| 72 |
// additional validation with other parts of the address (for example, |
| 73 |
// state or zip code validation in the United States). |
| 74 |
string postal_code = 4; |
| 75 |
|
| 76 |
// Optional. Additional, country-specific, sorting code. This is not used |
| 77 |
// in most regions. Where it is used, the value is either a string like |
| 78 |
// "CEDEX", optionally followed by a number (for example, "CEDEX 7"), or just |
| 79 |
// a number alone, representing the "sector code" (Jamaica), "delivery area |
| 80 |
// indicator" (Malawi) or "post office indicator" (Côte d'Ivoire). |
| 81 |
string sorting_code = 5; |
| 82 |
|
| 83 |
// Optional. Highest administrative subdivision which is used for postal |
| 84 |
// addresses of a country or region. |
| 85 |
// For example, this can be a state, a province, an oblast, or a prefecture. |
| 86 |
// For Spain, this is the province and not the autonomous |
| 87 |
// community (for example, "Barcelona" and not "Catalonia"). |
| 88 |
// Many countries don't use an administrative area in postal addresses. For |
| 89 |
// example, in Switzerland, this should be left unpopulated. |
| 90 |
string administrative_area = 6; |
| 91 |
|
| 92 |
// Optional. Generally refers to the city or town portion of the address. |
| 93 |
// Examples: US city, IT comune, UK post town. |
| 94 |
// In regions of the world where localities are not well defined or do not fit |
| 95 |
// into this structure well, leave `locality` empty and use `address_lines`. |
| 96 |
string locality = 7; |
| 97 |
|
| 98 |
// Optional. Sublocality of the address. |
| 99 |
// For example, this can be a neighborhood, borough, or district. |
| 100 |
string sublocality = 8; |
| 101 |
|
| 102 |
// Unstructured address lines describing the lower levels of an address. |
| 103 |
// |
| 104 |
// Because values in `address_lines` do not have type information and may |
| 105 |
// sometimes contain multiple values in a single field (for example, |
| 106 |
// "Austin, TX"), it is important that the line order is clear. The order of |
| 107 |
// address lines should be "envelope order" for the country or region of the |
| 108 |
// address. In places where this can vary (for example, Japan), |
| 109 |
// `address_language` is used to make it explicit (for example, "ja" for |
| 110 |
// large-to-small ordering and "ja-Latn" or "en" for small-to-large). In this |
| 111 |
// way, the most specific line of an address can be selected based on the |
| 112 |
// language. |
| 113 |
// |
| 114 |
// The minimum permitted structural representation of an address consists |
| 115 |
// of a `region_code` with all remaining information placed in the |
| 116 |
// `address_lines`. It would be possible to format such an address very |
| 117 |
// approximately without geocoding, but no semantic reasoning could be |
| 118 |
// made about any of the address components until it was at least |
| 119 |
// partially resolved. |
| 120 |
// |
| 121 |
// Creating an address only containing a `region_code` and `address_lines` and |
| 122 |
// then geocoding is the recommended way to handle completely unstructured |
| 123 |
// addresses (as opposed to guessing which parts of the address should be |
| 124 |
// localities or administrative areas). |
| 125 |
repeated string address_lines = 9; |
| 126 |
|
| 127 |
// Optional. The recipient at the address. |
| 128 |
// This field may, under certain circumstances, contain multiline information. |
| 129 |
// For example, it might contain "care of" information. |
| 130 |
repeated string recipients = 10; |
| 131 |
|
| 132 |
// Optional. The name of the organization at the address. |
| 133 |
string organization = 11; |
| 134 |
} |