Skip to content

Commit 4725324

Browse files
fix!: [retail] fix the HTTP format for merchant center link service (#9360)
* fix!: fix the HTTP format for merchant center link service PiperOrigin-RevId: 524889384 Source-Link: googleapis/googleapis@5b42ea6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2aa53eb47e349b101e07d6e9321c746aa02418aa Copy-Tag: eyJwIjoiamF2YS1yZXRhaWwvLk93bEJvdC55YW1sIiwiaCI6IjJhYTUzZWI0N2UzNDliMTAxZTA3ZDZlOTMyMWM3NDZhYTAyNDE4YWEifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 83187b6 commit 4725324

File tree

8 files changed

+71
-149
lines changed

8 files changed

+71
-149
lines changed

java-retail/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
195195
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
196196
[stability-image]: https://img.shields.io/badge/stability-stable-green
197197
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-retail.svg
198-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-retail/2.16.0
198+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-retail/2.17.0
199199
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
200200
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
201201
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterAccountLinkServiceClient.java

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,7 @@ public final ListMerchantCenterAccountLinksResponse listMerchantCenterAccountLin
340340

341341
// AUTO-GENERATED DOCUMENTATION AND METHOD.
342342
/**
343-
* Creates a MerchantCenterAccountLink.
344-
*
345-
* <p>[MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] cannot be
346-
* set to a different oneof field, if so an INVALID_ARGUMENT is returned.
343+
* Creates a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
347344
*
348345
* <p>Sample code:
349346
*
@@ -388,10 +385,7 @@ public final ListMerchantCenterAccountLinksResponse listMerchantCenterAccountLin
388385

389386
// AUTO-GENERATED DOCUMENTATION AND METHOD.
390387
/**
391-
* Creates a MerchantCenterAccountLink.
392-
*
393-
* <p>[MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] cannot be
394-
* set to a different oneof field, if so an INVALID_ARGUMENT is returned.
388+
* Creates a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
395389
*
396390
* <p>Sample code:
397391
*
@@ -436,10 +430,7 @@ public final ListMerchantCenterAccountLinksResponse listMerchantCenterAccountLin
436430

437431
// AUTO-GENERATED DOCUMENTATION AND METHOD.
438432
/**
439-
* Creates a MerchantCenterAccountLink.
440-
*
441-
* <p>[MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] cannot be
442-
* set to a different oneof field, if so an INVALID_ARGUMENT is returned.
433+
* Creates a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
443434
*
444435
* <p>Sample code:
445436
*
@@ -473,10 +464,7 @@ public final ListMerchantCenterAccountLinksResponse listMerchantCenterAccountLin
473464

474465
// AUTO-GENERATED DOCUMENTATION AND METHOD.
475466
/**
476-
* Creates a MerchantCenterAccountLink.
477-
*
478-
* <p>[MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] cannot be
479-
* set to a different oneof field, if so an INVALID_ARGUMENT is returned.
467+
* Creates a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
480468
*
481469
* <p>Sample code:
482470
*
@@ -512,10 +500,7 @@ public final ListMerchantCenterAccountLinksResponse listMerchantCenterAccountLin
512500

513501
// AUTO-GENERATED DOCUMENTATION AND METHOD.
514502
/**
515-
* Creates a MerchantCenterAccountLink.
516-
*
517-
* <p>[MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] cannot be
518-
* set to a different oneof field, if so an INVALID_ARGUMENT is returned.
503+
* Creates a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
519504
*
520505
* <p>Sample code:
521506
*
@@ -548,9 +533,9 @@ public final ListMerchantCenterAccountLinksResponse listMerchantCenterAccountLin
548533

549534
// AUTO-GENERATED DOCUMENTATION AND METHOD.
550535
/**
551-
* Deletes a MerchantCenterAccountLink. If the
552-
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to delete
553-
* does not exist, a NOT_FOUND error is returned.
536+
* Deletes a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
537+
* If the [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to
538+
* delete does not exist, a NOT_FOUND error is returned.
554539
*
555540
* <p>Sample code:
556541
*
@@ -583,9 +568,9 @@ public final void deleteMerchantCenterAccountLink(MerchantCenterAccountLinkName
583568

584569
// AUTO-GENERATED DOCUMENTATION AND METHOD.
585570
/**
586-
* Deletes a MerchantCenterAccountLink. If the
587-
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to delete
588-
* does not exist, a NOT_FOUND error is returned.
571+
* Deletes a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
572+
* If the [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to
573+
* delete does not exist, a NOT_FOUND error is returned.
589574
*
590575
* <p>Sample code:
591576
*
@@ -617,9 +602,9 @@ public final void deleteMerchantCenterAccountLink(String name) {
617602

618603
// AUTO-GENERATED DOCUMENTATION AND METHOD.
619604
/**
620-
* Deletes a MerchantCenterAccountLink. If the
621-
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to delete
622-
* does not exist, a NOT_FOUND error is returned.
605+
* Deletes a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
606+
* If the [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to
607+
* delete does not exist, a NOT_FOUND error is returned.
623608
*
624609
* <p>Sample code:
625610
*
@@ -652,9 +637,9 @@ public final void deleteMerchantCenterAccountLink(
652637

653638
// AUTO-GENERATED DOCUMENTATION AND METHOD.
654639
/**
655-
* Deletes a MerchantCenterAccountLink. If the
656-
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to delete
657-
* does not exist, a NOT_FOUND error is returned.
640+
* Deletes a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
641+
* If the [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to
642+
* delete does not exist, a NOT_FOUND error is returned.
658643
*
659644
* <p>Sample code:
660645
*

java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcMerchantCenterAccountLinkServiceStub.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ protected GrpcMerchantCenterAccountLinkServiceStub(
169169
.setParamsExtractor(
170170
request -> {
171171
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
172-
params.put(
173-
"merchant_center_account_link.name",
174-
String.valueOf(request.getMerchantCenterAccountLink().getName()));
172+
params.put("parent", String.valueOf(request.getParent()));
175173
return params.build();
176174
})
177175
.build();

java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/HttpJsonMerchantCenterAccountLinkServiceStub.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,19 @@ public class HttpJsonMerchantCenterAccountLinkServiceStub
115115
.setRequestFormatter(
116116
ProtoMessageRequestFormatter.<CreateMerchantCenterAccountLinkRequest>newBuilder()
117117
.setPath(
118-
"/v2alpha/{merchantCenterAccountLink.name=projects/*/locations/*/catalogs/*/merchantCenterAccountLinks/*}",
118+
"/v2alpha/{parent=projects/*/locations/*/catalogs/*}/merchantCenterAccountLinks",
119119
request -> {
120120
Map<String, String> fields = new HashMap<>();
121121
ProtoRestSerializer<CreateMerchantCenterAccountLinkRequest> serializer =
122122
ProtoRestSerializer.create();
123-
serializer.putPathParam(
124-
fields,
125-
"merchantCenterAccountLink.name",
126-
request.getMerchantCenterAccountLink().getName());
123+
serializer.putPathParam(fields, "parent", request.getParent());
127124
return fields;
128125
})
129126
.setQueryParamsExtractor(
130127
request -> {
131128
Map<String, List<String>> fields = new HashMap<>();
132129
ProtoRestSerializer<CreateMerchantCenterAccountLinkRequest> serializer =
133130
ProtoRestSerializer.create();
134-
serializer.putQueryParam(fields, "parent", request.getParent());
135131
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
136132
return fields;
137133
})

java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MerchantCenterAccountLinkServiceClientHttpJsonTest.java

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,7 @@ public void createMerchantCenterAccountLinkTest() throws Exception {
192192

193193
CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
194194
MerchantCenterAccountLink merchantCenterAccountLink =
195-
MerchantCenterAccountLink.newBuilder()
196-
.setName(
197-
MerchantCenterAccountLinkName.of(
198-
"[PROJECT]", "[LOCATION]", "[CATALOG]", "[MERCHANT_CENTER_ACCOUNT_LINK]")
199-
.toString())
200-
.setId("id3355")
201-
.setMerchantCenterAccountId(-1368465440)
202-
.setBranchId("branchId-25407907")
203-
.setFeedLabel("feedLabel-1661895690")
204-
.setLanguageCode("languageCode-2092349083")
205-
.addAllFeedFilters(new ArrayList<MerchantCenterAccountLink.MerchantCenterFeedFilter>())
206-
.setProjectId("projectId-894832108")
207-
.build();
195+
MerchantCenterAccountLink.newBuilder().build();
208196

209197
MerchantCenterAccountLink actualResponse =
210198
client.createMerchantCenterAccountLinkAsync(parent, merchantCenterAccountLink).get();
@@ -235,20 +223,7 @@ public void createMerchantCenterAccountLinkExceptionTest() throws Exception {
235223
try {
236224
CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
237225
MerchantCenterAccountLink merchantCenterAccountLink =
238-
MerchantCenterAccountLink.newBuilder()
239-
.setName(
240-
MerchantCenterAccountLinkName.of(
241-
"[PROJECT]", "[LOCATION]", "[CATALOG]", "[MERCHANT_CENTER_ACCOUNT_LINK]")
242-
.toString())
243-
.setId("id3355")
244-
.setMerchantCenterAccountId(-1368465440)
245-
.setBranchId("branchId-25407907")
246-
.setFeedLabel("feedLabel-1661895690")
247-
.setLanguageCode("languageCode-2092349083")
248-
.addAllFeedFilters(
249-
new ArrayList<MerchantCenterAccountLink.MerchantCenterFeedFilter>())
250-
.setProjectId("projectId-894832108")
251-
.build();
226+
MerchantCenterAccountLink.newBuilder().build();
252227
client.createMerchantCenterAccountLinkAsync(parent, merchantCenterAccountLink).get();
253228
Assert.fail("No exception raised");
254229
} catch (ExecutionException e) {
@@ -279,21 +254,9 @@ public void createMerchantCenterAccountLinkTest2() throws Exception {
279254
.build();
280255
mockService.addResponse(resultOperation);
281256

282-
String parent = "parent-995424086";
257+
String parent = "projects/project-6267/locations/location-6267/catalogs/catalog-6267";
283258
MerchantCenterAccountLink merchantCenterAccountLink =
284-
MerchantCenterAccountLink.newBuilder()
285-
.setName(
286-
MerchantCenterAccountLinkName.of(
287-
"[PROJECT]", "[LOCATION]", "[CATALOG]", "[MERCHANT_CENTER_ACCOUNT_LINK]")
288-
.toString())
289-
.setId("id3355")
290-
.setMerchantCenterAccountId(-1368465440)
291-
.setBranchId("branchId-25407907")
292-
.setFeedLabel("feedLabel-1661895690")
293-
.setLanguageCode("languageCode-2092349083")
294-
.addAllFeedFilters(new ArrayList<MerchantCenterAccountLink.MerchantCenterFeedFilter>())
295-
.setProjectId("projectId-894832108")
296-
.build();
259+
MerchantCenterAccountLink.newBuilder().build();
297260

298261
MerchantCenterAccountLink actualResponse =
299262
client.createMerchantCenterAccountLinkAsync(parent, merchantCenterAccountLink).get();
@@ -322,22 +285,9 @@ public void createMerchantCenterAccountLinkExceptionTest2() throws Exception {
322285
mockService.addException(exception);
323286

324287
try {
325-
String parent = "parent-995424086";
288+
String parent = "projects/project-6267/locations/location-6267/catalogs/catalog-6267";
326289
MerchantCenterAccountLink merchantCenterAccountLink =
327-
MerchantCenterAccountLink.newBuilder()
328-
.setName(
329-
MerchantCenterAccountLinkName.of(
330-
"[PROJECT]", "[LOCATION]", "[CATALOG]", "[MERCHANT_CENTER_ACCOUNT_LINK]")
331-
.toString())
332-
.setId("id3355")
333-
.setMerchantCenterAccountId(-1368465440)
334-
.setBranchId("branchId-25407907")
335-
.setFeedLabel("feedLabel-1661895690")
336-
.setLanguageCode("languageCode-2092349083")
337-
.addAllFeedFilters(
338-
new ArrayList<MerchantCenterAccountLink.MerchantCenterFeedFilter>())
339-
.setProjectId("projectId-894832108")
340-
.build();
290+
MerchantCenterAccountLink.newBuilder().build();
341291
client.createMerchantCenterAccountLinkAsync(parent, merchantCenterAccountLink).get();
342292
Assert.fail("No exception raised");
343293
} catch (ExecutionException e) {

java-retail/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterAccountLinkServiceGrpc.java

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,8 @@ default void listMerchantCenterAccountLinks(
266266
*
267267
*
268268
* <pre>
269-
* Creates a MerchantCenterAccountLink.
270-
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
271-
* cannot be set to a different oneof field, if so an INVALID_ARGUMENT is
272-
* returned.
269+
* Creates a
270+
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
273271
* </pre>
274272
*/
275273
default void createMerchantCenterAccountLink(
@@ -283,7 +281,8 @@ default void createMerchantCenterAccountLink(
283281
*
284282
*
285283
* <pre>
286-
* Deletes a MerchantCenterAccountLink.
284+
* Deletes a
285+
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
287286
* If the
288287
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
289288
* to delete does not exist, a NOT_FOUND error is returned.
@@ -358,10 +357,8 @@ public void listMerchantCenterAccountLinks(
358357
*
359358
*
360359
* <pre>
361-
* Creates a MerchantCenterAccountLink.
362-
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
363-
* cannot be set to a different oneof field, if so an INVALID_ARGUMENT is
364-
* returned.
360+
* Creates a
361+
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
365362
* </pre>
366363
*/
367364
public void createMerchantCenterAccountLink(
@@ -377,7 +374,8 @@ public void createMerchantCenterAccountLink(
377374
*
378375
*
379376
* <pre>
380-
* Deletes a MerchantCenterAccountLink.
377+
* Deletes a
378+
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
381379
* If the
382380
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
383381
* to delete does not exist, a NOT_FOUND error is returned.
@@ -434,10 +432,8 @@ protected MerchantCenterAccountLinkServiceBlockingStub build(
434432
*
435433
*
436434
* <pre>
437-
* Creates a MerchantCenterAccountLink.
438-
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
439-
* cannot be set to a different oneof field, if so an INVALID_ARGUMENT is
440-
* returned.
435+
* Creates a
436+
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
441437
* </pre>
442438
*/
443439
public com.google.longrunning.Operation createMerchantCenterAccountLink(
@@ -450,7 +446,8 @@ public com.google.longrunning.Operation createMerchantCenterAccountLink(
450446
*
451447
*
452448
* <pre>
453-
* Deletes a MerchantCenterAccountLink.
449+
* Deletes a
450+
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
454451
* If the
455452
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
456453
* to delete does not exist, a NOT_FOUND error is returned.
@@ -506,10 +503,8 @@ protected MerchantCenterAccountLinkServiceFutureStub build(
506503
*
507504
*
508505
* <pre>
509-
* Creates a MerchantCenterAccountLink.
510-
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
511-
* cannot be set to a different oneof field, if so an INVALID_ARGUMENT is
512-
* returned.
506+
* Creates a
507+
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
513508
* </pre>
514509
*/
515510
public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation>
@@ -524,7 +519,8 @@ protected MerchantCenterAccountLinkServiceFutureStub build(
524519
*
525520
*
526521
* <pre>
527-
* Deletes a MerchantCenterAccountLink.
522+
* Deletes a
523+
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].
528524
* If the
529525
* [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]
530526
* to delete does not exist, a NOT_FOUND error is returned.

0 commit comments

Comments
 (0)