Skip to content

Commit a39702e

Browse files
feat: [addressvalidation] add has_spell_corrected_components field to the Address Validation verdict in the API response (#6498)
* feat: add has_spell_corrected_components field to the Address Validation verdict in the API response docs: update proto field descriptions PiperOrigin-RevId: 783467878 Source-Link: googleapis/googleapis@68d5196 Source-Link: googleapis/googleapis-gen@bf3ea1d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtYWRkcmVzc3ZhbGlkYXRpb24vLk93bEJvdC55YW1sIiwiaCI6ImJmM2VhMWQ1ZjdiMzM3ZjBhYjA5NzgwYzkzMWMxOGE4OGVmZmE2NGYifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 2d56d45 commit a39702e

10 files changed

Lines changed: 2523 additions & 118 deletions

File tree

packages/google-maps-addressvalidation/protos/google/maps/addressvalidation/v1/address.proto

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package google.maps.addressvalidation.v1;
1919
import "google/api/field_behavior.proto";
2020
import "google/type/postal_address.proto";
2121

22-
option cc_enable_arenas = true;
2322
option csharp_namespace = "Google.Maps.AddressValidation.V1";
2423
option go_package = "cloud.google.com/go/maps/addressvalidation/apiv1/addressvalidationpb;addressvalidationpb";
2524
option java_multiple_files = true;
@@ -35,6 +34,12 @@ option ruby_package = "Google::Maps::AddressValidation::V1";
3534
message Address {
3635
// The post-processed address, formatted as a single-line address following
3736
// the address formatting rules of the region where the address is located.
37+
//
38+
// Note: the format of this address may not match the format of the address
39+
// in the `postal_address` field. For example, the `postal_address` always
40+
// represents the country as a 2 letter `region_code`, such as "US" or "NZ".
41+
// By contrast, this field uses a longer form of the country name, such as
42+
// "USA" or "New Zealand".
3843
string formatted_address = 2;
3944

4045
// The post-processed address represented as a postal address.
@@ -51,11 +56,17 @@ message Address {
5156

5257
// The types of components that were expected to be present in a correctly
5358
// formatted mailing address but were not found in the input AND could
54-
// not be inferred. Components of this type are not present in
55-
// `formatted_address`, `postal_address`, or `address_components`. An
56-
// example might be `['street_number', 'route']` for an input like
57-
// "Boulder, Colorado, 80301, USA". The list of possible types can be found
59+
// not be inferred. An example might be `['street_number', 'route']` for an
60+
// input like "Boulder, Colorado, 80301, USA". The list of possible types can
61+
// be found
5862
// [here](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types).
63+
//
64+
// **Note: you might see a missing component type when you think you've
65+
// already supplied the missing component.** For example, this can happen when
66+
// the input address contains the building name, but not the premise number.
67+
// In the address "渋谷区渋谷3丁目 Shibuya Stream", the building name
68+
// "Shibuya Stream" has the component type `premise`, but the premise number
69+
// is missing, so `missing_component_types` will contain `premise`.
5970
repeated string missing_component_types = 5;
6071

6172
// The types of the components that are present in the `address_components`
@@ -72,10 +83,10 @@ message Address {
7283
repeated string unconfirmed_component_types = 6;
7384

7485
// Any tokens in the input that could not be resolved. This might be an
75-
// input that was not recognized as a valid part of an address (for example
76-
// in an input like "123235253253 Main St, San Francisco, CA, 94105", the
77-
// unresolved tokens may look like `["123235253253"]` since that does not
78-
// look like a valid street number.
86+
// input that was not recognized as a valid part of an address. For example,
87+
// for an input such as "Parcel 0000123123 & 0000456456 Str # Guthrie Center
88+
// IA 50115 US", the unresolved tokens might look like `["Parcel",
89+
// "0000123123", "&", "0000456456"]`.
7990
repeated string unresolved_tokens = 7;
8091
}
8192

packages/google-maps-addressvalidation/protos/google/maps/addressvalidation/v1/address_validation_service.proto

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import "google/maps/addressvalidation/v1/metadata.proto";
2525
import "google/maps/addressvalidation/v1/usps_data.proto";
2626
import "google/type/postal_address.proto";
2727

28-
option cc_enable_arenas = true;
2928
option csharp_namespace = "Google.Maps.AddressValidation.V1";
3029
option go_package = "cloud.google.com/go/maps/addressvalidation/apiv1/addressvalidationpb;addressvalidationpb";
3130
option java_multiple_files = true;
@@ -113,19 +112,19 @@ message ValidateAddressRequest {
113112
// ASCII characters in length. Otherwise an INVALID_ARGUMENT error is
114113
// returned.
115114
//
116-
// The session begins when the user starts typing a query, and concludes when
117-
// they select a place and a call to Place Details or Address Validation is
118-
// made. Each session can have multiple autocomplete queries, followed by one
119-
// Place Details or Address Validation request. The credentials used for each
120-
// request within a session must belong to the same Google Cloud Console
115+
// The session begins when the user makes an Autocomplete query, and concludes
116+
// when they select a place and a call to Place Details or Address Validation
117+
// is made. Each session can have multiple Autocomplete queries, followed by
118+
// one Place Details or Address Validation request. The credentials used for
119+
// each request within a session must belong to the same Google Cloud Console
121120
// project. Once a session has concluded, the token is no longer valid; your
122-
// app must generate a fresh token for each session. If the `session_token`
121+
// app must generate a fresh token for each session. If the `sessionToken`
123122
// parameter is omitted, or if you reuse a session token, the session is
124123
// charged as if no session token was provided (each request is billed
125124
// separately).
126125
//
127126
// Note: Address Validation can only be used in sessions with the
128-
// Autocomplete (New) API, not the old Autocomplete API. See
127+
// Autocomplete (New) API, not the Autocomplete API. See
129128
// https://developers.google.com/maps/documentation/places/web-service/session-pricing
130129
// for more details.
131130
string session_token = 5 [(google.api.field_behavior) = OPTIONAL];
@@ -247,14 +246,16 @@ message Verdict {
247246
// signals, refer to `validation_granularity` below.
248247
//
249248
// For example, if the input address includes a specific apartment number,
250-
// then the `input_granularity` here will be `SUB_PREMISE`. If we cannot match
251-
// the apartment number in the databases or the apartment number is invalid,
252-
// the `validation_granularity` will likely be `PREMISE` or below.
249+
// then the `input_granularity` here will be `SUB_PREMISE`. If the address
250+
// validation service cannot match the apartment number in the databases or
251+
// the apartment number is invalid, the `validation_granularity` will likely
252+
// be `PREMISE` or more coarse.
253253
Granularity input_granularity = 1;
254254

255-
// The granularity level that the API can fully **validate** the address to.
256-
// For example, an `validation_granularity` of `PREMISE` indicates all address
257-
// components at the level of `PREMISE` or more coarse can be validated.
255+
// The level of granularity for the post-processed address that the API can
256+
// fully validate. For example, a `validation_granularity` of `PREMISE`
257+
// indicates all address components at the level of `PREMISE` or more coarse
258+
// can be validated.
258259
//
259260
// Per address component validation result can be found in
260261
// [google.maps.addressvalidation.v1.Address.address_components].
@@ -272,8 +273,9 @@ message Verdict {
272273
// but the `geocode_granularity` will be `PREMISE`.
273274
Granularity geocode_granularity = 3;
274275

275-
// The address is considered complete if there are no unresolved tokens, no
276-
// unexpected or missing address components. See
276+
// The post-processed address is considered complete if there are no
277+
// unresolved tokens, no unexpected or missing address components. If unset,
278+
// indicates that the value is `false`. See
277279
// [`missing_component_types`][google.maps.addressvalidation.v1.Address.missing_component_types],
278280
// [`unresolved_tokens`][google.maps.addressvalidation.v1.Address.unresolved_tokens]
279281
// or
@@ -296,4 +298,9 @@ message Verdict {
296298
// [google.maps.addressvalidation.v1.Address.address_components] for
297299
// details.
298300
bool has_replaced_components = 7;
301+
302+
// At least one address component was spell-corrected, see
303+
// [google.maps.addressvalidation.v1.Address.address_components] for
304+
// details.
305+
bool has_spell_corrected_components = 9;
299306
}

packages/google-maps-addressvalidation/protos/google/maps/addressvalidation/v1/geocode.proto

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package google.maps.addressvalidation.v1;
1919
import "google/geo/type/viewport.proto";
2020
import "google/type/latlng.proto";
2121

22-
option cc_enable_arenas = true;
2322
option csharp_namespace = "Google.Maps.AddressValidation.V1";
2423
option go_package = "cloud.google.com/go/maps/addressvalidation/apiv1/addressvalidationpb;addressvalidationpb";
2524
option java_multiple_files = true;

packages/google-maps-addressvalidation/protos/google/maps/addressvalidation/v1/metadata.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ syntax = "proto3";
1616

1717
package google.maps.addressvalidation.v1;
1818

19-
option cc_enable_arenas = true;
2019
option csharp_namespace = "Google.Maps.AddressValidation.V1";
2120
option go_package = "cloud.google.com/go/maps/addressvalidation/apiv1/addressvalidationpb;addressvalidationpb";
2221
option java_multiple_files = true;
@@ -26,8 +25,8 @@ option objc_class_prefix = "GMPAVV1";
2625
option php_namespace = "Google\\Maps\\AddressValidation\\V1";
2726
option ruby_package = "Google::Maps::AddressValidation::V1";
2827

29-
// The metadata for the address. `metadata` is not guaranteed to be fully
30-
// populated for every address sent to the Address Validation API.
28+
// The metadata for the post-processed address. `metadata` is not guaranteed to
29+
// be fully populated for every address sent to the Address Validation API.
3130
message AddressMetadata {
3231
// Indicates that this is the address of a business.
3332
// If unset, indicates that the value is unknown.

packages/google-maps-addressvalidation/protos/google/maps/addressvalidation/v1/usps_data.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ syntax = "proto3";
1616

1717
package google.maps.addressvalidation.v1;
1818

19-
option cc_enable_arenas = true;
2019
option csharp_namespace = "Google.Maps.AddressValidation.V1";
2120
option go_package = "cloud.google.com/go/maps/addressvalidation/apiv1/addressvalidationpb;addressvalidationpb";
2221
option java_multiple_files = true;
@@ -211,7 +210,7 @@ message UspsData {
211210
// * `N`: Primary and any secondary number information failed to
212211
// DPV confirm.
213212
// * `S`: Address was DPV confirmed for the primary number only, and the
214-
// secondary number information was present by not confirmed, or a single
213+
// secondary number information was present but not confirmed, or a single
215214
// trailing alpha on a primary number was dropped to make a DPV match and
216215
// secondary information required.
217216
// * `D`: Address was DPV confirmed for the primary number only, and the

0 commit comments

Comments
 (0)