Skip to content

Commit 07eae34

Browse files
feat: [google-maps-addressvalidation] add has_spell_corrected_components field to the Address Validation verdict in the API response (#14103)
BEGIN_COMMIT_OVERRIDE feat: add has_spell_corrected_components field to the Address Validation verdict in the API response docs: update proto field descriptions END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. docs: update proto field descriptions PiperOrigin-RevId: 783467878 Source-Link: googleapis/googleapis@68d5196 Source-Link: googleapis/googleapis-gen@bf3ea1d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtYWRkcmVzc3ZhbGlkYXRpb24vLk93bEJvdC55YW1sIiwiaCI6ImJmM2VhMWQ1ZjdiMzM3ZjBhYjA5NzgwYzkzMWMxOGE4OGVmZmE2NGYifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f4d2243 commit 07eae34

File tree

7 files changed

+71
-49
lines changed

7 files changed

+71
-49
lines changed

packages/google-maps-addressvalidation/google/maps/addressvalidation/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.19" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-maps-addressvalidation/google/maps/addressvalidation_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.19" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-maps-addressvalidation/google/maps/addressvalidation_v1/types/address.py

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ class Address(proto.Message):
3737
3838
Attributes:
3939
formatted_address (str):
40-
The post-processed address, formatted as a
41-
single-line address following the address
42-
formatting rules of the region where the address
43-
is located.
40+
The post-processed address, formatted as a single-line
41+
address following the address formatting rules of the region
42+
where the address is located.
43+
44+
Note: the format of this address may not match the format of
45+
the address in the ``postal_address`` field. For example,
46+
the ``postal_address`` always represents the country as a 2
47+
letter ``region_code``, such as "US" or "NZ". By contrast,
48+
this field uses a longer form of the country name, such as
49+
"USA" or "New Zealand".
4450
postal_address (google.type.postal_address_pb2.PostalAddress):
4551
The post-processed address represented as a
4652
postal address.
@@ -58,13 +64,20 @@ class Address(proto.Message):
5864
missing_component_types (MutableSequence[str]):
5965
The types of components that were expected to be present in
6066
a correctly formatted mailing address but were not found in
61-
the input AND could not be inferred. Components of this type
62-
are not present in ``formatted_address``,
63-
``postal_address``, or ``address_components``. An example
64-
might be ``['street_number', 'route']`` for an input like
65-
"Boulder, Colorado, 80301, USA". The list of possible types
66-
can be found
67+
the input AND could not be inferred. An example might be
68+
``['street_number', 'route']`` for an input like "Boulder,
69+
Colorado, 80301, USA". The list of possible types can be
70+
found
6771
`here <https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types>`__.
72+
73+
**Note: you might see a missing component type when you
74+
think you've already supplied the missing component.** For
75+
example, this can happen when the input address contains the
76+
building name, but not the premise number. In the address
77+
"渋谷区渋谷3丁目 Shibuya Stream", the building name
78+
"Shibuya Stream" has the component type ``premise``, but the
79+
premise number is missing, so ``missing_component_types``
80+
will contain ``premise``.
6881
unconfirmed_component_types (MutableSequence[str]):
6982
The types of the components that are present in the
7083
``address_components`` but could not be confirmed to be
@@ -83,10 +96,10 @@ class Address(proto.Message):
8396
unresolved_tokens (MutableSequence[str]):
8497
Any tokens in the input that could not be resolved. This
8598
might be an input that was not recognized as a valid part of
86-
an address (for example in an input like "123235253253 Main
87-
St, San Francisco, CA, 94105", the unresolved tokens may
88-
look like ``["123235253253"]`` since that does not look like
89-
a valid street number.
99+
an address. For example, for an input such as "Parcel
100+
0000123123 & 0000456456 Str # Guthrie Center IA 50115 US",
101+
the unresolved tokens might look like
102+
``["Parcel", "0000123123", "&", "0000456456"]``.
90103
"""
91104

92105
formatted_address: str = proto.Field(

packages/google-maps-addressvalidation/google/maps/addressvalidation_v1/types/address_validation_service.py

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,21 @@ class ValidateAddressRequest(proto.Message):
9595
string with at most 36 ASCII characters in length. Otherwise
9696
an INVALID_ARGUMENT error is returned.
9797
98-
The session begins when the user starts typing a query, and
99-
concludes when they select a place and a call to Place
100-
Details or Address Validation is made. Each session can have
101-
multiple autocomplete queries, followed by one Place Details
102-
or Address Validation request. The credentials used for each
103-
request within a session must belong to the same Google
104-
Cloud Console project. Once a session has concluded, the
105-
token is no longer valid; your app must generate a fresh
106-
token for each session. If the ``session_token`` parameter
107-
is omitted, or if you reuse a session token, the session is
108-
charged as if no session token was provided (each request is
109-
billed separately).
98+
The session begins when the user makes an Autocomplete
99+
query, and concludes when they select a place and a call to
100+
Place Details or Address Validation is made. Each session
101+
can have multiple Autocomplete queries, followed by one
102+
Place Details or Address Validation request. The credentials
103+
used for each request within a session must belong to the
104+
same Google Cloud Console project. Once a session has
105+
concluded, the token is no longer valid; your app must
106+
generate a fresh token for each session. If the
107+
``sessionToken`` parameter is omitted, or if you reuse a
108+
session token, the session is charged as if no session token
109+
was provided (each request is billed separately).
110110
111111
Note: Address Validation can only be used in sessions with
112-
the Autocomplete (New) API, not the old Autocomplete API.
113-
See
112+
the Autocomplete (New) API, not the Autocomplete API. See
114113
https://developers.google.com/maps/documentation/places/web-service/session-pricing
115114
for more details.
116115
"""
@@ -287,15 +286,16 @@ class Verdict(proto.Message):
287286
288287
For example, if the input address includes a specific
289288
apartment number, then the ``input_granularity`` here will
290-
be ``SUB_PREMISE``. If we cannot match the apartment number
291-
in the databases or the apartment number is invalid, the
292-
``validation_granularity`` will likely be ``PREMISE`` or
293-
below.
289+
be ``SUB_PREMISE``. If the address validation service cannot
290+
match the apartment number in the databases or the apartment
291+
number is invalid, the ``validation_granularity`` will
292+
likely be ``PREMISE`` or more coarse.
294293
validation_granularity (google.maps.addressvalidation_v1.types.Verdict.Granularity):
295-
The granularity level that the API can fully **validate**
296-
the address to. For example, an ``validation_granularity``
297-
of ``PREMISE`` indicates all address components at the level
298-
of ``PREMISE`` or more coarse can be validated.
294+
The level of granularity for the post-processed address that
295+
the API can fully validate. For example, a
296+
``validation_granularity`` of ``PREMISE`` indicates all
297+
address components at the level of ``PREMISE`` or more
298+
coarse can be validated.
299299
300300
Per address component validation result can be found in
301301
[google.maps.addressvalidation.v1.Address.address_components].
@@ -313,9 +313,10 @@ class Verdict(proto.Message):
313313
``SUB_PREMISE`` but the ``geocode_granularity`` will be
314314
``PREMISE``.
315315
address_complete (bool):
316-
The address is considered complete if there are no
317-
unresolved tokens, no unexpected or missing address
318-
components. See
316+
The post-processed address is considered complete if there
317+
are no unresolved tokens, no unexpected or missing address
318+
components. If unset, indicates that the value is ``false``.
319+
See
319320
[``missing_component_types``][google.maps.addressvalidation.v1.Address.missing_component_types],
320321
[``unresolved_tokens``][google.maps.addressvalidation.v1.Address.unresolved_tokens]
321322
or
@@ -335,6 +336,10 @@ class Verdict(proto.Message):
335336
At least one address component was replaced, see
336337
[google.maps.addressvalidation.v1.Address.address_components]
337338
for details.
339+
has_spell_corrected_components (bool):
340+
At least one address component was spell-corrected, see
341+
[google.maps.addressvalidation.v1.Address.address_components]
342+
for details.
338343
"""
339344

340345
class Granularity(proto.Enum):
@@ -409,6 +414,10 @@ class Granularity(proto.Enum):
409414
proto.BOOL,
410415
number=7,
411416
)
417+
has_spell_corrected_components: bool = proto.Field(
418+
proto.BOOL,
419+
number=9,
420+
)
412421

413422

414423
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-maps-addressvalidation/google/maps/addressvalidation_v1/types/metadata_.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929

3030
class AddressMetadata(proto.Message):
31-
r"""The metadata for the address. ``metadata`` is not guaranteed to be
32-
fully populated for every address sent to the Address Validation
33-
API.
31+
r"""The metadata for the post-processed address. ``metadata`` is not
32+
guaranteed to be fully populated for every address sent to the
33+
Address Validation API.
3434
3535
3636
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

packages/google-maps-addressvalidation/google/maps/addressvalidation_v1/types/usps_data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ class UspsData(proto.Message):
250250
- ``N``: Primary and any secondary number information
251251
failed to DPV confirm.
252252
- ``S``: Address was DPV confirmed for the primary number
253-
only, and the secondary number information was present by
254-
not confirmed, or a single trailing alpha on a primary
255-
number was dropped to make a DPV match and secondary
256-
information required.
253+
only, and the secondary number information was present
254+
but not confirmed, or a single trailing alpha on a
255+
primary number was dropped to make a DPV match and
256+
secondary information required.
257257
- ``D``: Address was DPV confirmed for the primary number
258258
only, and the secondary number information was missing.
259259
- ``R``: Address confirmed but assigned to phantom route

packages/google-maps-addressvalidation/samples/generated_samples/snippet_metadata_google.maps.addressvalidation.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-maps-addressvalidation",
11-
"version": "0.3.19"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)