Skip to content

Commit 7158e2d

Browse files
feat: [maps-addressvalidation] add session token support for Autocomplete (New) sessions that end with a call to Address Validation (#10405)
* feat: add session token support for Autocomplete (New) sessions that end with a call to Address Validation feat: add new fields to USPS data docs: update proto field descriptions PiperOrigin-RevId: 608369029 Source-Link: googleapis/googleapis@5ff3e52 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c1828358be412ba02e45bfbae3afc2b3dadd5d32 Copy-Tag: eyJwIjoiamF2YS1tYXBzLWFkZHJlc3N2YWxpZGF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiJjMTgyODM1OGJlNDEyYmEwMmU0NWJmYmFlM2FmYzJiM2RhZGQ1ZDMyIn0= * 🦉 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 05acf2d commit 7158e2d

File tree

18 files changed

+4672
-1961
lines changed

18 files changed

+4672
-1961
lines changed

java-maps-addressvalidation/google-maps-addressvalidation/src/main/java/com/google/maps/addressvalidation/v1/AddressValidationClient.java

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* .setAddress(PostalAddress.newBuilder().build())
4444
* .setPreviousResponseId("previousResponseId468754323")
4545
* .setEnableUspsCass(true)
46+
* .setSessionToken("sessionToken-696552189")
4647
* .build();
4748
* ValidateAddressResponse response = addressValidationClient.validateAddress(request);
4849
* }
@@ -213,6 +214,7 @@ public AddressValidationStub getStub() {
213214
* .setAddress(PostalAddress.newBuilder().build())
214215
* .setPreviousResponseId("previousResponseId468754323")
215216
* .setEnableUspsCass(true)
217+
* .setSessionToken("sessionToken-696552189")
216218
* .build();
217219
* ValidateAddressResponse response = addressValidationClient.validateAddress(request);
218220
* }
@@ -243,6 +245,7 @@ public final ValidateAddressResponse validateAddress(ValidateAddressRequest requ
243245
* .setAddress(PostalAddress.newBuilder().build())
244246
* .setPreviousResponseId("previousResponseId468754323")
245247
* .setEnableUspsCass(true)
248+
* .setSessionToken("sessionToken-696552189")
246249
* .build();
247250
* ApiFuture<ValidateAddressResponse> future =
248251
* addressValidationClient.validateAddressCallable().futureCall(request);

java-maps-addressvalidation/google-maps-addressvalidation/src/main/java/com/google/maps/addressvalidation/v1/package-info.java

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
* .setAddress(PostalAddress.newBuilder().build())
3838
* .setPreviousResponseId("previousResponseId468754323")
3939
* .setEnableUspsCass(true)
40+
* .setSessionToken("sessionToken-696552189")
4041
* .build();
4142
* ValidateAddressResponse response = addressValidationClient.validateAddress(request);
4243
* }

java-maps-addressvalidation/google-maps-addressvalidation/src/test/java/com/google/maps/addressvalidation/v1/AddressValidationClientHttpJsonTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void validateAddressTest() throws Exception {
8686
.setAddress(PostalAddress.newBuilder().build())
8787
.setPreviousResponseId("previousResponseId468754323")
8888
.setEnableUspsCass(true)
89+
.setSessionToken("sessionToken-696552189")
8990
.build();
9091

9192
ValidateAddressResponse actualResponse = client.validateAddress(request);
@@ -119,6 +120,7 @@ public void validateAddressExceptionTest() throws Exception {
119120
.setAddress(PostalAddress.newBuilder().build())
120121
.setPreviousResponseId("previousResponseId468754323")
121122
.setEnableUspsCass(true)
123+
.setSessionToken("sessionToken-696552189")
122124
.build();
123125
client.validateAddress(request);
124126
Assert.fail("No exception raised");

java-maps-addressvalidation/google-maps-addressvalidation/src/test/java/com/google/maps/addressvalidation/v1/AddressValidationClientTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void validateAddressTest() throws Exception {
9090
.setAddress(PostalAddress.newBuilder().build())
9191
.setPreviousResponseId("previousResponseId468754323")
9292
.setEnableUspsCass(true)
93+
.setSessionToken("sessionToken-696552189")
9394
.build();
9495

9596
ValidateAddressResponse actualResponse = client.validateAddress(request);
@@ -102,6 +103,7 @@ public void validateAddressTest() throws Exception {
102103
Assert.assertEquals(request.getAddress(), actualRequest.getAddress());
103104
Assert.assertEquals(request.getPreviousResponseId(), actualRequest.getPreviousResponseId());
104105
Assert.assertEquals(request.getEnableUspsCass(), actualRequest.getEnableUspsCass());
106+
Assert.assertEquals(request.getSessionToken(), actualRequest.getSessionToken());
105107
Assert.assertTrue(
106108
channelProvider.isHeaderSent(
107109
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -119,6 +121,7 @@ public void validateAddressExceptionTest() throws Exception {
119121
.setAddress(PostalAddress.newBuilder().build())
120122
.setPreviousResponseId("previousResponseId468754323")
121123
.setEnableUspsCass(true)
124+
.setSessionToken("sessionToken-696552189")
122125
.build();
123126
client.validateAddress(request);
124127
Assert.fail("No exception raised");

java-maps-addressvalidation/proto-google-maps-addressvalidation-v1/src/main/java/com/google/maps/addressvalidation/v1/AddressComponent.java

+20-12
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,11 @@ public boolean getInferred() {
435435
*
436436
*
437437
* <pre>
438-
* Indicates the spelling of the component name was corrected in a minor way,
439-
* for example by switching two characters that appeared in the wrong order.
440-
* This indicates a cosmetic change.
438+
* Indicates a correction to a misspelling in the component name. The API
439+
* does not always flag changes from one spelling variant to another, such as
440+
* when changing "centre" to "center". It also does not always flag common
441+
* misspellings, such as when changing "Amphitheater Pkwy" to "Amphitheatre
442+
* Pkwy".
441443
* </pre>
442444
*
443445
* <code>bool spell_corrected = 5;</code>
@@ -1475,9 +1477,11 @@ public Builder clearInferred() {
14751477
*
14761478
*
14771479
* <pre>
1478-
* Indicates the spelling of the component name was corrected in a minor way,
1479-
* for example by switching two characters that appeared in the wrong order.
1480-
* This indicates a cosmetic change.
1480+
* Indicates a correction to a misspelling in the component name. The API
1481+
* does not always flag changes from one spelling variant to another, such as
1482+
* when changing "centre" to "center". It also does not always flag common
1483+
* misspellings, such as when changing "Amphitheater Pkwy" to "Amphitheatre
1484+
* Pkwy".
14811485
* </pre>
14821486
*
14831487
* <code>bool spell_corrected = 5;</code>
@@ -1492,9 +1496,11 @@ public boolean getSpellCorrected() {
14921496
*
14931497
*
14941498
* <pre>
1495-
* Indicates the spelling of the component name was corrected in a minor way,
1496-
* for example by switching two characters that appeared in the wrong order.
1497-
* This indicates a cosmetic change.
1499+
* Indicates a correction to a misspelling in the component name. The API
1500+
* does not always flag changes from one spelling variant to another, such as
1501+
* when changing "centre" to "center". It also does not always flag common
1502+
* misspellings, such as when changing "Amphitheater Pkwy" to "Amphitheatre
1503+
* Pkwy".
14981504
* </pre>
14991505
*
15001506
* <code>bool spell_corrected = 5;</code>
@@ -1513,9 +1519,11 @@ public Builder setSpellCorrected(boolean value) {
15131519
*
15141520
*
15151521
* <pre>
1516-
* Indicates the spelling of the component name was corrected in a minor way,
1517-
* for example by switching two characters that appeared in the wrong order.
1518-
* This indicates a cosmetic change.
1522+
* Indicates a correction to a misspelling in the component name. The API
1523+
* does not always flag changes from one spelling variant to another, such as
1524+
* when changing "centre" to "center". It also does not always flag common
1525+
* misspellings, such as when changing "Amphitheater Pkwy" to "Amphitheatre
1526+
* Pkwy".
15191527
* </pre>
15201528
*
15211529
* <code>bool spell_corrected = 5;</code>

java-maps-addressvalidation/proto-google-maps-addressvalidation-v1/src/main/java/com/google/maps/addressvalidation/v1/AddressComponentOrBuilder.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,11 @@ public interface AddressComponentOrBuilder
140140
*
141141
*
142142
* <pre>
143-
* Indicates the spelling of the component name was corrected in a minor way,
144-
* for example by switching two characters that appeared in the wrong order.
145-
* This indicates a cosmetic change.
143+
* Indicates a correction to a misspelling in the component name. The API
144+
* does not always flag changes from one spelling variant to another, such as
145+
* when changing "centre" to "center". It also does not always flag common
146+
* misspellings, such as when changing "Amphitheater Pkwy" to "Amphitheatre
147+
* Pkwy".
146148
* </pre>
147149
*
148150
* <code>bool spell_corrected = 5;</code>

java-maps-addressvalidation/proto-google-maps-addressvalidation-v1/src/main/java/com/google/maps/addressvalidation/v1/AddressValidationServiceProto.java

+55-54
Original file line numberDiff line numberDiff line change
@@ -71,62 +71,63 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
7171
+ "proto\032/google/maps/addressvalidation/v1/"
7272
+ "metadata.proto\0320google/maps/addressvalid"
7373
+ "ation/v1/usps_data.proto\032 google/type/po"
74-
+ "stal_address.proto\"\202\001\n\026ValidateAddressRe"
74+
+ "stal_address.proto\"\236\001\n\026ValidateAddressRe"
7575
+ "quest\0220\n\007address\030\001 \001(\0132\032.google.type.Pos"
7676
+ "talAddressB\003\340A\002\022\034\n\024previous_response_id\030"
77-
+ "\002 \001(\t\022\030\n\020enable_usps_cass\030\003 \001(\010\"r\n\027Valid"
78-
+ "ateAddressResponse\022B\n\006result\030\001 \001(\01322.goo"
79-
+ "gle.maps.addressvalidation.v1.Validation"
80-
+ "Result\022\023\n\013response_id\030\002 \001(\t\"\313\002\n ProvideV"
81-
+ "alidationFeedbackRequest\022p\n\nconclusion\030\001"
82-
+ " \001(\0162W.google.maps.addressvalidation.v1."
83-
+ "ProvideValidationFeedbackRequest.Validat"
84-
+ "ionConclusionB\003\340A\002\022\030\n\013response_id\030\002 \001(\tB"
85-
+ "\003\340A\002\"\232\001\n\024ValidationConclusion\022%\n!VALIDAT"
86-
+ "ION_CONCLUSION_UNSPECIFIED\020\000\022\032\n\026VALIDATE"
87-
+ "D_VERSION_USED\020\001\022\025\n\021USER_VERSION_USED\020\002\022"
88-
+ "\034\n\030UNVALIDATED_VERSION_USED\020\003\022\n\n\006UNUSED\020"
89-
+ "\004\"#\n!ProvideValidationFeedbackResponse\"\312"
90-
+ "\002\n\020ValidationResult\022:\n\007verdict\030\001 \001(\0132).g"
91-
+ "oogle.maps.addressvalidation.v1.Verdict\022"
92-
+ ":\n\007address\030\002 \001(\0132).google.maps.addressva"
93-
+ "lidation.v1.Address\022:\n\007geocode\030\003 \001(\0132).g"
94-
+ "oogle.maps.addressvalidation.v1.Geocode\022"
95-
+ "C\n\010metadata\030\004 \001(\01321.google.maps.addressv"
96-
+ "alidation.v1.AddressMetadata\022=\n\tusps_dat"
97-
+ "a\030\005 \001(\0132*.google.maps.addressvalidation."
98-
+ "v1.UspsData\"\211\004\n\007Verdict\022P\n\021input_granula"
99-
+ "rity\030\001 \001(\01625.google.maps.addressvalidati"
100-
+ "on.v1.Verdict.Granularity\022U\n\026validation_"
101-
+ "granularity\030\002 \001(\01625.google.maps.addressv"
102-
+ "alidation.v1.Verdict.Granularity\022R\n\023geoc"
103-
+ "ode_granularity\030\003 \001(\01625.google.maps.addr"
104-
+ "essvalidation.v1.Verdict.Granularity\022\030\n\020"
105-
+ "address_complete\030\004 \001(\010\022\"\n\032has_unconfirme"
106-
+ "d_components\030\005 \001(\010\022\037\n\027has_inferred_compo"
107-
+ "nents\030\006 \001(\010\022\037\n\027has_replaced_components\030\007"
108-
+ " \001(\010\"\200\001\n\013Granularity\022\033\n\027GRANULARITY_UNSP"
109-
+ "ECIFIED\020\000\022\017\n\013SUB_PREMISE\020\001\022\013\n\007PREMISE\020\002\022"
110-
+ "\025\n\021PREMISE_PROXIMITY\020\003\022\t\n\005BLOCK\020\004\022\t\n\005ROU"
111-
+ "TE\020\005\022\t\n\005OTHER\020\0062\262\003\n\021AddressValidation\022\246\001"
112-
+ "\n\017ValidateAddress\0228.google.maps.addressv"
113-
+ "alidation.v1.ValidateAddressRequest\0329.go"
114-
+ "ogle.maps.addressvalidation.v1.ValidateA"
115-
+ "ddressResponse\"\036\202\323\344\223\002\030\"\023/v1:validateAddr"
116-
+ "ess:\001*\022\316\001\n\031ProvideValidationFeedback\022B.g"
117-
+ "oogle.maps.addressvalidation.v1.ProvideV"
118-
+ "alidationFeedbackRequest\032C.google.maps.a"
77+
+ "\002 \001(\t\022\030\n\020enable_usps_cass\030\003 \001(\010\022\032\n\rsessi"
78+
+ "on_token\030\005 \001(\tB\003\340A\001\"r\n\027ValidateAddressRe"
79+
+ "sponse\022B\n\006result\030\001 \001(\01322.google.maps.add"
80+
+ "ressvalidation.v1.ValidationResult\022\023\n\013re"
81+
+ "sponse_id\030\002 \001(\t\"\313\002\n ProvideValidationFee"
82+
+ "dbackRequest\022p\n\nconclusion\030\001 \001(\0162W.googl"
83+
+ "e.maps.addressvalidation.v1.ProvideValid"
84+
+ "ationFeedbackRequest.ValidationConclusio"
85+
+ "nB\003\340A\002\022\030\n\013response_id\030\002 \001(\tB\003\340A\002\"\232\001\n\024Val"
86+
+ "idationConclusion\022%\n!VALIDATION_CONCLUSI"
87+
+ "ON_UNSPECIFIED\020\000\022\032\n\026VALIDATED_VERSION_US"
88+
+ "ED\020\001\022\025\n\021USER_VERSION_USED\020\002\022\034\n\030UNVALIDAT"
89+
+ "ED_VERSION_USED\020\003\022\n\n\006UNUSED\020\004\"#\n!Provide"
90+
+ "ValidationFeedbackResponse\"\312\002\n\020Validatio"
91+
+ "nResult\022:\n\007verdict\030\001 \001(\0132).google.maps.a"
92+
+ "ddressvalidation.v1.Verdict\022:\n\007address\030\002"
93+
+ " \001(\0132).google.maps.addressvalidation.v1."
94+
+ "Address\022:\n\007geocode\030\003 \001(\0132).google.maps.a"
95+
+ "ddressvalidation.v1.Geocode\022C\n\010metadata\030"
96+
+ "\004 \001(\01321.google.maps.addressvalidation.v1"
97+
+ ".AddressMetadata\022=\n\tusps_data\030\005 \001(\0132*.go"
98+
+ "ogle.maps.addressvalidation.v1.UspsData\""
99+
+ "\211\004\n\007Verdict\022P\n\021input_granularity\030\001 \001(\01625"
100+
+ ".google.maps.addressvalidation.v1.Verdic"
101+
+ "t.Granularity\022U\n\026validation_granularity\030"
102+
+ "\002 \001(\01625.google.maps.addressvalidation.v1"
103+
+ ".Verdict.Granularity\022R\n\023geocode_granular"
104+
+ "ity\030\003 \001(\01625.google.maps.addressvalidatio"
105+
+ "n.v1.Verdict.Granularity\022\030\n\020address_comp"
106+
+ "lete\030\004 \001(\010\022\"\n\032has_unconfirmed_components"
107+
+ "\030\005 \001(\010\022\037\n\027has_inferred_components\030\006 \001(\010\022"
108+
+ "\037\n\027has_replaced_components\030\007 \001(\010\"\200\001\n\013Gra"
109+
+ "nularity\022\033\n\027GRANULARITY_UNSPECIFIED\020\000\022\017\n"
110+
+ "\013SUB_PREMISE\020\001\022\013\n\007PREMISE\020\002\022\025\n\021PREMISE_P"
111+
+ "ROXIMITY\020\003\022\t\n\005BLOCK\020\004\022\t\n\005ROUTE\020\005\022\t\n\005OTHE"
112+
+ "R\020\0062\262\003\n\021AddressValidation\022\246\001\n\017ValidateAd"
113+
+ "dress\0228.google.maps.addressvalidation.v1"
114+
+ ".ValidateAddressRequest\0329.google.maps.ad"
115+
+ "dressvalidation.v1.ValidateAddressRespon"
116+
+ "se\"\036\202\323\344\223\002\030\"\023/v1:validateAddress:\001*\022\316\001\n\031P"
117+
+ "rovideValidationFeedback\022B.google.maps.a"
119118
+ "ddressvalidation.v1.ProvideValidationFee"
120-
+ "dbackResponse\"(\202\323\344\223\002\"\"\035/v1:provideValida"
121-
+ "tionFeedback:\001*\032#\312A addressvalidation.go"
122-
+ "ogleapis.comB\232\002\n$com.google.maps.address"
123-
+ "validation.v1B\035AddressValidationServiceP"
124-
+ "rotoP\001ZXcloud.google.com/go/maps/address"
125-
+ "validation/apiv1/addressvalidationpb;add"
126-
+ "ressvalidationpb\370\001\001\242\002\007GMPAVV1\252\002 Google.M"
127-
+ "aps.AddressValidation.V1\312\002 Google\\Maps\\A"
128-
+ "ddressValidation\\V1\352\002#Google::Maps::Addr"
129-
+ "essValidation::V1b\006proto3"
119+
+ "dbackRequest\032C.google.maps.addressvalida"
120+
+ "tion.v1.ProvideValidationFeedbackRespons"
121+
+ "e\"(\202\323\344\223\002\"\"\035/v1:provideValidationFeedback"
122+
+ ":\001*\032#\312A addressvalidation.googleapis.com"
123+
+ "B\232\002\n$com.google.maps.addressvalidation.v"
124+
+ "1B\035AddressValidationServiceProtoP\001ZXclou"
125+
+ "d.google.com/go/maps/addressvalidation/a"
126+
+ "piv1/addressvalidationpb;addressvalidati"
127+
+ "onpb\370\001\001\242\002\007GMPAVV1\252\002 Google.Maps.AddressV"
128+
+ "alidation.V1\312\002 Google\\Maps\\AddressValida"
129+
+ "tion\\V1\352\002#Google::Maps::AddressValidatio"
130+
+ "n::V1b\006proto3"
130131
};
131132
descriptor =
132133
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -147,7 +148,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
147148
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
148149
internal_static_google_maps_addressvalidation_v1_ValidateAddressRequest_descriptor,
149150
new java.lang.String[] {
150-
"Address", "PreviousResponseId", "EnableUspsCass",
151+
"Address", "PreviousResponseId", "EnableUspsCass", "SessionToken",
151152
});
152153
internal_static_google_maps_addressvalidation_v1_ValidateAddressResponse_descriptor =
153154
getDescriptor().getMessageTypes().get(1);

0 commit comments

Comments
 (0)