From 3141dafaaa59392d09ac9b63175b79dc77b537a2 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:30:17 +0000 Subject: [PATCH] feat: [merchantapi] new module for merchantapi inventories (#9891) ``` python3.9 generation/new_client/new-client.py generate --api_shortname=merchantapi --proto-path=google/shopping/merchant/inventories --name-pretty="Merchant API" --product-docs="https://developers.google.com/merchant/api" --api-description="Programmatically manage your Merchant Center accounts." --distribution-name="com.google.shopping:google-shopping-merchant-inventories" ``` --- java-merchantapi/.OwlBot.yaml | 36 + java-merchantapi/.repo-metadata.json | 16 + java-merchantapi/README.md | 225 ++ .../pom.xml | 44 + .../pom.xml | 113 + .../v1beta/LocalInventoryServiceClient.java | 662 ++++ .../v1beta/LocalInventoryServiceSettings.java | 243 ++ .../RegionalInventoryServiceClient.java | 670 ++++ .../RegionalInventoryServiceSettings.java | 248 ++ .../inventories/v1beta/gapic_metadata.json | 45 + .../inventories/v1beta/package-info.java | 72 + ...cLocalInventoryServiceCallableFactory.java | 115 + .../stub/GrpcLocalInventoryServiceStub.java | 256 ++ ...gionalInventoryServiceCallableFactory.java | 115 + .../GrpcRegionalInventoryServiceStub.java | 263 ++ ...nLocalInventoryServiceCallableFactory.java | 105 + .../HttpJsonLocalInventoryServiceStub.java | 352 ++ ...gionalInventoryServiceCallableFactory.java | 105 + .../HttpJsonRegionalInventoryServiceStub.java | 357 ++ .../stub/LocalInventoryServiceStub.java | 62 + .../LocalInventoryServiceStubSettings.java | 474 +++ .../stub/RegionalInventoryServiceStub.java | 64 + .../RegionalInventoryServiceStubSettings.java | 485 +++ .../reflect-config.json | 1271 ++++++ ...calInventoryServiceClientHttpJsonTest.java | 277 ++ .../LocalInventoryServiceClientTest.java | 260 ++ .../v1beta/MockLocalInventoryService.java | 59 + .../v1beta/MockLocalInventoryServiceImpl.java | 125 + .../v1beta/MockRegionalInventoryService.java | 59 + .../MockRegionalInventoryServiceImpl.java | 125 + ...nalInventoryServiceClientHttpJsonTest.java | 273 ++ .../RegionalInventoryServiceClientTest.java | 256 ++ .../pom.xml | 45 + .../v1beta/LocalInventoryServiceGrpc.java | 700 ++++ .../v1beta/RegionalInventoryServiceGrpc.java | 728 ++++ java-merchantapi/owlbot.py | 36 + java-merchantapi/pom.xml | 54 + .../clirr-ignored-differences.xml | 33 + .../pom.xml | 37 + .../v1beta/DeleteLocalInventoryRequest.java | 676 ++++ .../DeleteLocalInventoryRequestOrBuilder.java | 58 + .../DeleteRegionalInventoryRequest.java | 681 ++++ ...leteRegionalInventoryRequestOrBuilder.java | 58 + .../v1beta/InsertLocalInventoryRequest.java | 976 +++++ .../InsertLocalInventoryRequestOrBuilder.java | 100 + .../InsertRegionalInventoryRequest.java | 985 +++++ ...sertRegionalInventoryRequestOrBuilder.java | 100 + .../v1beta/ListLocalInventoriesRequest.java | 995 +++++ .../ListLocalInventoriesRequestOrBuilder.java | 108 + .../v1beta/ListLocalInventoriesResponse.java | 1245 ++++++ ...ListLocalInventoriesResponseOrBuilder.java | 121 + .../ListRegionalInventoriesRequest.java | 993 +++++ ...stRegionalInventoriesRequestOrBuilder.java | 106 + .../ListRegionalInventoriesResponse.java | 1256 ++++++ ...tRegionalInventoriesResponseOrBuilder.java | 123 + .../inventories/v1beta/LocalInventory.java | 3416 +++++++++++++++++ .../v1beta/LocalInventoryName.java | 223 ++ .../v1beta/LocalInventoryOrBuilder.java | 480 +++ .../v1beta/LocalInventoryProto.java | 211 + .../inventories/v1beta/RegionalInventory.java | 2562 +++++++++++++ .../v1beta/RegionalInventoryName.java | 223 ++ .../v1beta/RegionalInventoryOrBuilder.java | 318 ++ .../v1beta/RegionalInventoryProto.java | 200 + .../google/shopping/type/CustomAttribute.java | 1405 +++++++ .../type/CustomAttributeOrBuilder.java | 159 + .../com/google/shopping/type/Destination.java | 223 ++ .../java/com/google/shopping/type/Price.java | 806 ++++ .../google/shopping/type/PriceOrBuilder.java | 94 + .../com/google/shopping/type/TypesProto.java | 85 + .../inventories/v1beta/localinventory.proto | 210 + .../v1beta/regionalinventory.proto | 191 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncDeleteLocalInventory.java | 51 + .../SyncDeleteLocalInventory.java | 47 + ...eleteLocalInventoryLocalinventoryname.java | 43 + .../SyncDeleteLocalInventoryString.java | 43 + .../AsyncInsertLocalInventory.java | 51 + .../SyncInsertLocalInventory.java | 47 + .../AsyncListLocalInventories.java | 54 + .../AsyncListLocalInventoriesPaged.java | 62 + .../SyncListLocalInventories.java | 51 + .../SyncListLocalInventoriesString.java | 45 + .../SyncInsertLocalInventory.java | 50 + .../SyncCreateSetCredentialsProvider.java | 45 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 42 + .../AsyncDeleteRegionalInventory.java | 51 + .../SyncDeleteRegionalInventory.java | 47 + ...egionalInventoryRegionalinventoryname.java | 43 + .../SyncDeleteRegionalInventoryString.java | 43 + .../AsyncInsertRegionalInventory.java | 51 + .../SyncInsertRegionalInventory.java | 47 + .../AsyncListRegionalInventories.java | 54 + .../AsyncListRegionalInventoriesPaged.java | 62 + .../SyncListRegionalInventories.java | 51 + .../SyncListRegionalInventoriesString.java | 45 + .../SyncInsertRegionalInventory.java | 50 + .../SyncInsertLocalInventory.java | 50 + .../SyncInsertRegionalInventory.java | 50 + pom.xml | 1 + versions.txt | 3 + 103 files changed, 30300 insertions(+) create mode 100644 java-merchantapi/.OwlBot.yaml create mode 100644 java-merchantapi/.repo-metadata.json create mode 100644 java-merchantapi/README.md create mode 100644 java-merchantapi/google-shopping-merchant-inventories-bom/pom.xml create mode 100644 java-merchantapi/google-shopping-merchant-inventories/pom.xml create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClient.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceSettings.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClient.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceSettings.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/gapic_metadata.json create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/package-info.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcLocalInventoryServiceCallableFactory.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcLocalInventoryServiceStub.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcRegionalInventoryServiceCallableFactory.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcRegionalInventoryServiceStub.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonLocalInventoryServiceCallableFactory.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonLocalInventoryServiceStub.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonRegionalInventoryServiceCallableFactory.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonRegionalInventoryServiceStub.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/LocalInventoryServiceStub.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/LocalInventoryServiceStubSettings.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/RegionalInventoryServiceStub.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/RegionalInventoryServiceStubSettings.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/main/resources/META-INF/native-image/com.google.shopping.merchant.inventories.v1beta/reflect-config.json create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClientHttpJsonTest.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClientTest.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockLocalInventoryService.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockLocalInventoryServiceImpl.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockRegionalInventoryService.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockRegionalInventoryServiceImpl.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClientHttpJsonTest.java create mode 100644 java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClientTest.java create mode 100644 java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/pom.xml create mode 100644 java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceGrpc.java create mode 100644 java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceGrpc.java create mode 100644 java-merchantapi/owlbot.py create mode 100644 java-merchantapi/pom.xml create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/clirr-ignored-differences.xml create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/pom.xml create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteLocalInventoryRequest.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteLocalInventoryRequestOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteRegionalInventoryRequest.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteRegionalInventoryRequestOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertLocalInventoryRequest.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertLocalInventoryRequestOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertRegionalInventoryRequest.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertRegionalInventoryRequestOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesRequest.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesRequestOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesResponse.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesResponseOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesRequest.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesRequestOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesResponse.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesResponseOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventory.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryName.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryProto.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventory.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryName.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryProto.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/CustomAttribute.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/Destination.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/Price.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/PriceOrBuilder.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/TypesProto.java create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/proto/google/shopping/merchant/inventories/v1beta/localinventory.proto create mode 100644 java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/proto/google/shopping/merchant/inventories/v1beta/regionalinventory.proto create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetEndpoint.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/AsyncDeleteLocalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventoryLocalinventoryname.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventoryString.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/insertlocalinventory/AsyncInsertLocalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/insertlocalinventory/SyncInsertLocalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/AsyncListLocalInventories.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/AsyncListLocalInventoriesPaged.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/SyncListLocalInventories.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/SyncListLocalInventoriesString.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservicesettings/insertlocalinventory/SyncInsertLocalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetEndpoint.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/AsyncDeleteRegionalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventoryRegionalinventoryname.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventoryString.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/insertregionalinventory/AsyncInsertRegionalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/insertregionalinventory/SyncInsertRegionalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/AsyncListRegionalInventories.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/AsyncListRegionalInventoriesPaged.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/SyncListRegionalInventories.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/SyncListRegionalInventoriesString.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservicesettings/insertregionalinventory/SyncInsertRegionalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/stub/localinventoryservicestubsettings/insertlocalinventory/SyncInsertLocalInventory.java create mode 100644 java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/stub/regionalinventoryservicestubsettings/insertregionalinventory/SyncInsertRegionalInventory.java diff --git a/java-merchantapi/.OwlBot.yaml b/java-merchantapi/.OwlBot.yaml new file mode 100644 index 000000000000..76487c4b03f9 --- /dev/null +++ b/java-merchantapi/.OwlBot.yaml @@ -0,0 +1,36 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: +- "/java-merchantapi/grpc-google-.*/src" +- "/java-merchantapi/proto-google-.*/src" +- "/java-merchantapi/google-.*/src" +- "/java-merchantapi/samples/snippets/generated" + +deep-preserve-regex: +- "/java-merchantapi/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/shopping/merchant/inventories/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-merchantapi/$1/proto-google-shopping-merchant-inventories-$1/src" +- source: "/google/shopping/merchant/inventories/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-merchantapi/$1/grpc-google-shopping-merchant-inventories-$1/src" +- source: "/google/shopping/merchant/inventories/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-merchantapi/$1/google-shopping-merchant-inventories/src" +- source: "/google/shopping/merchant/inventories/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-merchantapi/$1/samples/snippets/generated" + + +api-name: merchantapi \ No newline at end of file diff --git a/java-merchantapi/.repo-metadata.json b/java-merchantapi/.repo-metadata.json new file mode 100644 index 000000000000..9ca45e478c88 --- /dev/null +++ b/java-merchantapi/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "api_description": "Programmatically manage your Merchant Center accounts.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-shopping-merchant-inventories/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-merchantapi", + "repo_short": "java-merchantapi", + "distribution_name": "com.google.shopping:google-shopping-merchant-inventories", + "api_id": "merchantapi.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-merchantapi/README.md b/java-merchantapi/README.md new file mode 100644 index 000000000000..10cd99f2384f --- /dev/null +++ b/java-merchantapi/README.md @@ -0,0 +1,225 @@ +# Google Merchant API Client for Java + +Java idiomatic client for [Merchant API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.23.0 + pom + import + + + + + + + com.google.shopping + google-shopping-merchant-inventories + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.shopping + google-shopping-merchant-inventories + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.shopping:google-shopping-merchant-inventories:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.shopping" % "google-shopping-merchant-inventories" % "0.0.0" +``` + + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Merchant API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Merchant API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Merchant API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Merchant API. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-shopping-merchant-inventories` library. See the [Quickstart](#quickstart) section +to add `google-shopping-merchant-inventories` as a dependency in your code. + +## About Merchant API + + +[Merchant API][product-docs] Programmatically manage your Merchant Center accounts. + +See the [Merchant API client library docs][javadocs] to learn how to +use this Merchant API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Merchant API uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://developers.google.com/merchant/api +[javadocs]: https://cloud.google.com/java/docs/reference/google-shopping-merchant-inventories/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-merchantapi/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.shopping/google-shopping-merchant-inventories.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.shopping/google-shopping-merchant-inventories/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-merchantapi/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-merchantapi/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-merchantapi/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=merchantapi.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-merchantapi/google-shopping-merchant-inventories-bom/pom.xml b/java-merchantapi/google-shopping-merchant-inventories-bom/pom.xml new file mode 100644 index 000000000000..72d8ccce1f20 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-inventories-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.19.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Merchant API BOM + + BOM for Merchant API + + + + true + + + + + + com.google.shopping + google-shopping-merchant-inventories + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-inventories-v1beta + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-inventories-v1beta + 0.0.1-SNAPSHOT + + + + diff --git a/java-merchantapi/google-shopping-merchant-inventories/pom.xml b/java-merchantapi/google-shopping-merchant-inventories/pom.xml new file mode 100644 index 000000000000..0da3f3cb242f --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-inventories + 0.0.1-SNAPSHOT + jar + Google Merchant API + Merchant API Programmatically manage your Merchant Center accounts. + + com.google.shopping + google-shopping-merchant-inventories-parent + 0.0.1-SNAPSHOT + + + google-shopping-merchant-inventories + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-inventories-v1beta + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-inventories-v1beta + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClient.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClient.java new file mode 100644 index 000000000000..6b12d701a279 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClient.java @@ -0,0 +1,662 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.stub.LocalInventoryServiceStub; +import com.google.shopping.merchant.inventories.v1beta.stub.LocalInventoryServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to manage local inventory for products + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LocalInventoryServiceClient localInventoryServiceClient =
+ *     LocalInventoryServiceClient.create()) {
+ *   InsertLocalInventoryRequest request =
+ *       InsertLocalInventoryRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setLocalInventory(LocalInventory.newBuilder().build())
+ *           .build();
+ *   LocalInventory response = localInventoryServiceClient.insertLocalInventory(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the LocalInventoryServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of LocalInventoryServiceSettings + * to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LocalInventoryServiceSettings localInventoryServiceSettings =
+ *     LocalInventoryServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * LocalInventoryServiceClient localInventoryServiceClient =
+ *     LocalInventoryServiceClient.create(localInventoryServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LocalInventoryServiceSettings localInventoryServiceSettings =
+ *     LocalInventoryServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LocalInventoryServiceClient localInventoryServiceClient =
+ *     LocalInventoryServiceClient.create(localInventoryServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LocalInventoryServiceSettings localInventoryServiceSettings =
+ *     LocalInventoryServiceSettings.newHttpJsonBuilder().build();
+ * LocalInventoryServiceClient localInventoryServiceClient =
+ *     LocalInventoryServiceClient.create(localInventoryServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class LocalInventoryServiceClient implements BackgroundResource { + private final LocalInventoryServiceSettings settings; + private final LocalInventoryServiceStub stub; + + /** Constructs an instance of LocalInventoryServiceClient with default settings. */ + public static final LocalInventoryServiceClient create() throws IOException { + return create(LocalInventoryServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of LocalInventoryServiceClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final LocalInventoryServiceClient create(LocalInventoryServiceSettings settings) + throws IOException { + return new LocalInventoryServiceClient(settings); + } + + /** + * Constructs an instance of LocalInventoryServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(LocalInventoryServiceSettings). + */ + public static final LocalInventoryServiceClient create(LocalInventoryServiceStub stub) { + return new LocalInventoryServiceClient(stub); + } + + /** + * Constructs an instance of LocalInventoryServiceClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected LocalInventoryServiceClient(LocalInventoryServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((LocalInventoryServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected LocalInventoryServiceClient(LocalInventoryServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final LocalInventoryServiceSettings getSettings() { + return settings; + } + + public LocalInventoryServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the `LocalInventory` resources for the given product in your merchant account. The + * response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in + * previous request, it can be used to obtain additional results. + * + *

`LocalInventory` resources are listed per product for a given account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   String parent = "parent-995424086";
+   *   for (LocalInventory element :
+   *       localInventoryServiceClient.listLocalInventories(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The `name` of the parent product to list local inventories for. Format: + * `accounts/{account}/products/{product}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocalInventoriesPagedResponse listLocalInventories(String parent) { + ListLocalInventoriesRequest request = + ListLocalInventoriesRequest.newBuilder().setParent(parent).build(); + return listLocalInventories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the `LocalInventory` resources for the given product in your merchant account. The + * response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in + * previous request, it can be used to obtain additional results. + * + *

`LocalInventory` resources are listed per product for a given account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   ListLocalInventoriesRequest request =
+   *       ListLocalInventoriesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (LocalInventory element :
+   *       localInventoryServiceClient.listLocalInventories(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocalInventoriesPagedResponse listLocalInventories( + ListLocalInventoriesRequest request) { + return listLocalInventoriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the `LocalInventory` resources for the given product in your merchant account. The + * response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in + * previous request, it can be used to obtain additional results. + * + *

`LocalInventory` resources are listed per product for a given account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   ListLocalInventoriesRequest request =
+   *       ListLocalInventoriesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       localInventoryServiceClient.listLocalInventoriesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (LocalInventory element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocalInventoriesPagedCallable() { + return stub.listLocalInventoriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the `LocalInventory` resources for the given product in your merchant account. The + * response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in + * previous request, it can be used to obtain additional results. + * + *

`LocalInventory` resources are listed per product for a given account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   ListLocalInventoriesRequest request =
+   *       ListLocalInventoriesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocalInventoriesResponse response =
+   *         localInventoryServiceClient.listLocalInventoriesCallable().call(request);
+   *     for (LocalInventory element : response.getLocalInventoriesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocalInventoriesCallable() { + return stub.listLocalInventoriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Inserts a `LocalInventory` resource to a product in your merchant account. + * + *

Replaces the full `LocalInventory` resource if an entry with the same + * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code] already + * exists for the product. + * + *

It might take up to 30 minutes for the new or updated `LocalInventory` resource to appear in + * products. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   InsertLocalInventoryRequest request =
+   *       InsertLocalInventoryRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setLocalInventory(LocalInventory.newBuilder().build())
+   *           .build();
+   *   LocalInventory response = localInventoryServiceClient.insertLocalInventory(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LocalInventory insertLocalInventory(InsertLocalInventoryRequest request) { + return insertLocalInventoryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Inserts a `LocalInventory` resource to a product in your merchant account. + * + *

Replaces the full `LocalInventory` resource if an entry with the same + * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code] already + * exists for the product. + * + *

It might take up to 30 minutes for the new or updated `LocalInventory` resource to appear in + * products. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   InsertLocalInventoryRequest request =
+   *       InsertLocalInventoryRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setLocalInventory(LocalInventory.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       localInventoryServiceClient.insertLocalInventoryCallable().futureCall(request);
+   *   // Do something.
+   *   LocalInventory response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + insertLocalInventoryCallable() { + return stub.insertLocalInventoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified `LocalInventory` from the given product in your merchant account. It + * might take a up to an hour for the `LocalInventory` to be deleted from the specific product. + * Once you have received a successful delete response, wait for that period before attempting a + * delete again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   LocalInventoryName name = LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]");
+   *   localInventoryServiceClient.deleteLocalInventory(name);
+   * }
+   * }
+ * + * @param name Required. The name of the local inventory for the given product to delete. Format: + * `accounts/{account}/products/{product}/localInventories/{store_code}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLocalInventory(LocalInventoryName name) { + DeleteLocalInventoryRequest request = + DeleteLocalInventoryRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteLocalInventory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified `LocalInventory` from the given product in your merchant account. It + * might take a up to an hour for the `LocalInventory` to be deleted from the specific product. + * Once you have received a successful delete response, wait for that period before attempting a + * delete again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   String name = LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]").toString();
+   *   localInventoryServiceClient.deleteLocalInventory(name);
+   * }
+   * }
+ * + * @param name Required. The name of the local inventory for the given product to delete. Format: + * `accounts/{account}/products/{product}/localInventories/{store_code}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLocalInventory(String name) { + DeleteLocalInventoryRequest request = + DeleteLocalInventoryRequest.newBuilder().setName(name).build(); + deleteLocalInventory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified `LocalInventory` from the given product in your merchant account. It + * might take a up to an hour for the `LocalInventory` to be deleted from the specific product. + * Once you have received a successful delete response, wait for that period before attempting a + * delete again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   DeleteLocalInventoryRequest request =
+   *       DeleteLocalInventoryRequest.newBuilder()
+   *           .setName(LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]").toString())
+   *           .build();
+   *   localInventoryServiceClient.deleteLocalInventory(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLocalInventory(DeleteLocalInventoryRequest request) { + deleteLocalInventoryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified `LocalInventory` from the given product in your merchant account. It + * might take a up to an hour for the `LocalInventory` to be deleted from the specific product. + * Once you have received a successful delete response, wait for that period before attempting a + * delete again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LocalInventoryServiceClient localInventoryServiceClient =
+   *     LocalInventoryServiceClient.create()) {
+   *   DeleteLocalInventoryRequest request =
+   *       DeleteLocalInventoryRequest.newBuilder()
+   *           .setName(LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       localInventoryServiceClient.deleteLocalInventoryCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteLocalInventoryCallable() { + return stub.deleteLocalInventoryCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLocalInventoriesPagedResponse + extends AbstractPagedListResponse< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + LocalInventory, + ListLocalInventoriesPage, + ListLocalInventoriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocalInventoriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocalInventoriesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocalInventoriesPagedResponse(ListLocalInventoriesPage page) { + super(page, ListLocalInventoriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocalInventoriesPage + extends AbstractPage< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + LocalInventory, + ListLocalInventoriesPage> { + + private ListLocalInventoriesPage( + PageContext + context, + ListLocalInventoriesResponse response) { + super(context, response); + } + + private static ListLocalInventoriesPage createEmptyPage() { + return new ListLocalInventoriesPage(null, null); + } + + @Override + protected ListLocalInventoriesPage createPage( + PageContext + context, + ListLocalInventoriesResponse response) { + return new ListLocalInventoriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocalInventoriesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + LocalInventory, + ListLocalInventoriesPage, + ListLocalInventoriesFixedSizeCollection> { + + private ListLocalInventoriesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocalInventoriesFixedSizeCollection createEmptyCollection() { + return new ListLocalInventoriesFixedSizeCollection(null, 0); + } + + @Override + protected ListLocalInventoriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocalInventoriesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceSettings.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceSettings.java new file mode 100644 index 000000000000..128602d89417 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceSettings.java @@ -0,0 +1,243 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import static com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient.ListLocalInventoriesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.stub.LocalInventoryServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link LocalInventoryServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (merchantapi.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of insertLocalInventory to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LocalInventoryServiceSettings.Builder localInventoryServiceSettingsBuilder =
+ *     LocalInventoryServiceSettings.newBuilder();
+ * localInventoryServiceSettingsBuilder
+ *     .insertLocalInventorySettings()
+ *     .setRetrySettings(
+ *         localInventoryServiceSettingsBuilder
+ *             .insertLocalInventorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * LocalInventoryServiceSettings localInventoryServiceSettings =
+ *     localInventoryServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class LocalInventoryServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listLocalInventories. */ + public PagedCallSettings< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + ListLocalInventoriesPagedResponse> + listLocalInventoriesSettings() { + return ((LocalInventoryServiceStubSettings) getStubSettings()).listLocalInventoriesSettings(); + } + + /** Returns the object with the settings used for calls to insertLocalInventory. */ + public UnaryCallSettings + insertLocalInventorySettings() { + return ((LocalInventoryServiceStubSettings) getStubSettings()).insertLocalInventorySettings(); + } + + /** Returns the object with the settings used for calls to deleteLocalInventory. */ + public UnaryCallSettings deleteLocalInventorySettings() { + return ((LocalInventoryServiceStubSettings) getStubSettings()).deleteLocalInventorySettings(); + } + + public static final LocalInventoryServiceSettings create(LocalInventoryServiceStubSettings stub) + throws IOException { + return new LocalInventoryServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LocalInventoryServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return LocalInventoryServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return LocalInventoryServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LocalInventoryServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return LocalInventoryServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return LocalInventoryServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LocalInventoryServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LocalInventoryServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LocalInventoryServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for LocalInventoryServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(LocalInventoryServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(LocalInventoryServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(LocalInventoryServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(LocalInventoryServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(LocalInventoryServiceStubSettings.newHttpJsonBuilder()); + } + + public LocalInventoryServiceStubSettings.Builder getStubSettingsBuilder() { + return ((LocalInventoryServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listLocalInventories. */ + public PagedCallSettings.Builder< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + ListLocalInventoriesPagedResponse> + listLocalInventoriesSettings() { + return getStubSettingsBuilder().listLocalInventoriesSettings(); + } + + /** Returns the builder for the settings used for calls to insertLocalInventory. */ + public UnaryCallSettings.Builder + insertLocalInventorySettings() { + return getStubSettingsBuilder().insertLocalInventorySettings(); + } + + /** Returns the builder for the settings used for calls to deleteLocalInventory. */ + public UnaryCallSettings.Builder + deleteLocalInventorySettings() { + return getStubSettingsBuilder().deleteLocalInventorySettings(); + } + + @Override + public LocalInventoryServiceSettings build() throws IOException { + return new LocalInventoryServiceSettings(this); + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClient.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClient.java new file mode 100644 index 000000000000..4254abdb895f --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClient.java @@ -0,0 +1,670 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.stub.RegionalInventoryServiceStub; +import com.google.shopping.merchant.inventories.v1beta.stub.RegionalInventoryServiceStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service to manage regional inventory for products. There is also separate + * `regions` resource and API to manage regions definitions. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+ *     RegionalInventoryServiceClient.create()) {
+ *   InsertRegionalInventoryRequest request =
+ *       InsertRegionalInventoryRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setRegionalInventory(RegionalInventory.newBuilder().build())
+ *           .build();
+ *   RegionalInventory response = regionalInventoryServiceClient.insertRegionalInventory(request);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the RegionalInventoryServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of + * RegionalInventoryServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RegionalInventoryServiceSettings regionalInventoryServiceSettings =
+ *     RegionalInventoryServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RegionalInventoryServiceClient regionalInventoryServiceClient =
+ *     RegionalInventoryServiceClient.create(regionalInventoryServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RegionalInventoryServiceSettings regionalInventoryServiceSettings =
+ *     RegionalInventoryServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * RegionalInventoryServiceClient regionalInventoryServiceClient =
+ *     RegionalInventoryServiceClient.create(regionalInventoryServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RegionalInventoryServiceSettings regionalInventoryServiceSettings =
+ *     RegionalInventoryServiceSettings.newHttpJsonBuilder().build();
+ * RegionalInventoryServiceClient regionalInventoryServiceClient =
+ *     RegionalInventoryServiceClient.create(regionalInventoryServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class RegionalInventoryServiceClient implements BackgroundResource { + private final RegionalInventoryServiceSettings settings; + private final RegionalInventoryServiceStub stub; + + /** Constructs an instance of RegionalInventoryServiceClient with default settings. */ + public static final RegionalInventoryServiceClient create() throws IOException { + return create(RegionalInventoryServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of RegionalInventoryServiceClient, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final RegionalInventoryServiceClient create( + RegionalInventoryServiceSettings settings) throws IOException { + return new RegionalInventoryServiceClient(settings); + } + + /** + * Constructs an instance of RegionalInventoryServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer using create(RegionalInventoryServiceSettings). + */ + public static final RegionalInventoryServiceClient create(RegionalInventoryServiceStub stub) { + return new RegionalInventoryServiceClient(stub); + } + + /** + * Constructs an instance of RegionalInventoryServiceClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected RegionalInventoryServiceClient(RegionalInventoryServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((RegionalInventoryServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected RegionalInventoryServiceClient(RegionalInventoryServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final RegionalInventoryServiceSettings getSettings() { + return settings; + } + + public RegionalInventoryServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the `RegionalInventory` resources for the given product in your merchant account. The + * response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in + * previous request, it can be used to obtain additional results. + * + *

`RegionalInventory` resources are listed per product for a given account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   String parent = "parent-995424086";
+   *   for (RegionalInventory element :
+   *       regionalInventoryServiceClient.listRegionalInventories(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The `name` of the parent product to list `RegionalInventory` resources + * for. Format: `accounts/{account}/products/{product}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRegionalInventoriesPagedResponse listRegionalInventories(String parent) { + ListRegionalInventoriesRequest request = + ListRegionalInventoriesRequest.newBuilder().setParent(parent).build(); + return listRegionalInventories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the `RegionalInventory` resources for the given product in your merchant account. The + * response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in + * previous request, it can be used to obtain additional results. + * + *

`RegionalInventory` resources are listed per product for a given account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   ListRegionalInventoriesRequest request =
+   *       ListRegionalInventoriesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (RegionalInventory element :
+   *       regionalInventoryServiceClient.listRegionalInventories(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRegionalInventoriesPagedResponse listRegionalInventories( + ListRegionalInventoriesRequest request) { + return listRegionalInventoriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the `RegionalInventory` resources for the given product in your merchant account. The + * response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in + * previous request, it can be used to obtain additional results. + * + *

`RegionalInventory` resources are listed per product for a given account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   ListRegionalInventoriesRequest request =
+   *       ListRegionalInventoriesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       regionalInventoryServiceClient.listRegionalInventoriesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (RegionalInventory element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listRegionalInventoriesPagedCallable() { + return stub.listRegionalInventoriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the `RegionalInventory` resources for the given product in your merchant account. The + * response might contain fewer items than specified by `pageSize`. If `pageToken` was returned in + * previous request, it can be used to obtain additional results. + * + *

`RegionalInventory` resources are listed per product for a given account. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   ListRegionalInventoriesRequest request =
+   *       ListRegionalInventoriesRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListRegionalInventoriesResponse response =
+   *         regionalInventoryServiceClient.listRegionalInventoriesCallable().call(request);
+   *     for (RegionalInventory element : response.getRegionalInventoriesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listRegionalInventoriesCallable() { + return stub.listRegionalInventoriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Inserts a `RegionalInventory` to a given product in your merchant account. + * + *

Replaces the full `RegionalInventory` resource if an entry with the same + * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region] already exists + * for the product. + * + *

It might take up to 30 minutes for the new or updated `RegionalInventory` resource to appear + * in products. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   InsertRegionalInventoryRequest request =
+   *       InsertRegionalInventoryRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setRegionalInventory(RegionalInventory.newBuilder().build())
+   *           .build();
+   *   RegionalInventory response = regionalInventoryServiceClient.insertRegionalInventory(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RegionalInventory insertRegionalInventory(InsertRegionalInventoryRequest request) { + return insertRegionalInventoryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Inserts a `RegionalInventory` to a given product in your merchant account. + * + *

Replaces the full `RegionalInventory` resource if an entry with the same + * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region] already exists + * for the product. + * + *

It might take up to 30 minutes for the new or updated `RegionalInventory` resource to appear + * in products. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   InsertRegionalInventoryRequest request =
+   *       InsertRegionalInventoryRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setRegionalInventory(RegionalInventory.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       regionalInventoryServiceClient.insertRegionalInventoryCallable().futureCall(request);
+   *   // Do something.
+   *   RegionalInventory response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + insertRegionalInventoryCallable() { + return stub.insertRegionalInventoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified `RegionalInventory` resource from the given product in your merchant + * account. It might take up to an hour for the `RegionalInventory` to be deleted from the + * specific product. Once you have received a successful delete response, wait for that period + * before attempting a delete again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   RegionalInventoryName name = RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]");
+   *   regionalInventoryServiceClient.deleteRegionalInventory(name);
+   * }
+   * }
+ * + * @param name Required. The name of the `RegionalInventory` resource to delete. Format: + * `accounts/{account}/products/{product}/regionalInventories/{region}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRegionalInventory(RegionalInventoryName name) { + DeleteRegionalInventoryRequest request = + DeleteRegionalInventoryRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteRegionalInventory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified `RegionalInventory` resource from the given product in your merchant + * account. It might take up to an hour for the `RegionalInventory` to be deleted from the + * specific product. Once you have received a successful delete response, wait for that period + * before attempting a delete again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   String name = RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]").toString();
+   *   regionalInventoryServiceClient.deleteRegionalInventory(name);
+   * }
+   * }
+ * + * @param name Required. The name of the `RegionalInventory` resource to delete. Format: + * `accounts/{account}/products/{product}/regionalInventories/{region}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRegionalInventory(String name) { + DeleteRegionalInventoryRequest request = + DeleteRegionalInventoryRequest.newBuilder().setName(name).build(); + deleteRegionalInventory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified `RegionalInventory` resource from the given product in your merchant + * account. It might take up to an hour for the `RegionalInventory` to be deleted from the + * specific product. Once you have received a successful delete response, wait for that period + * before attempting a delete again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   DeleteRegionalInventoryRequest request =
+   *       DeleteRegionalInventoryRequest.newBuilder()
+   *           .setName(RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]").toString())
+   *           .build();
+   *   regionalInventoryServiceClient.deleteRegionalInventory(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteRegionalInventory(DeleteRegionalInventoryRequest request) { + deleteRegionalInventoryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified `RegionalInventory` resource from the given product in your merchant + * account. It might take up to an hour for the `RegionalInventory` to be deleted from the + * specific product. Once you have received a successful delete response, wait for that period + * before attempting a delete again. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+   *     RegionalInventoryServiceClient.create()) {
+   *   DeleteRegionalInventoryRequest request =
+   *       DeleteRegionalInventoryRequest.newBuilder()
+   *           .setName(RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       regionalInventoryServiceClient.deleteRegionalInventoryCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deleteRegionalInventoryCallable() { + return stub.deleteRegionalInventoryCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListRegionalInventoriesPagedResponse + extends AbstractPagedListResponse< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + RegionalInventory, + ListRegionalInventoriesPage, + ListRegionalInventoriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListRegionalInventoriesRequest, ListRegionalInventoriesResponse, RegionalInventory> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListRegionalInventoriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListRegionalInventoriesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListRegionalInventoriesPagedResponse(ListRegionalInventoriesPage page) { + super(page, ListRegionalInventoriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListRegionalInventoriesPage + extends AbstractPage< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + RegionalInventory, + ListRegionalInventoriesPage> { + + private ListRegionalInventoriesPage( + PageContext< + ListRegionalInventoriesRequest, ListRegionalInventoriesResponse, RegionalInventory> + context, + ListRegionalInventoriesResponse response) { + super(context, response); + } + + private static ListRegionalInventoriesPage createEmptyPage() { + return new ListRegionalInventoriesPage(null, null); + } + + @Override + protected ListRegionalInventoriesPage createPage( + PageContext< + ListRegionalInventoriesRequest, ListRegionalInventoriesResponse, RegionalInventory> + context, + ListRegionalInventoriesResponse response) { + return new ListRegionalInventoriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListRegionalInventoriesRequest, ListRegionalInventoriesResponse, RegionalInventory> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListRegionalInventoriesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + RegionalInventory, + ListRegionalInventoriesPage, + ListRegionalInventoriesFixedSizeCollection> { + + private ListRegionalInventoriesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListRegionalInventoriesFixedSizeCollection createEmptyCollection() { + return new ListRegionalInventoriesFixedSizeCollection(null, 0); + } + + @Override + protected ListRegionalInventoriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListRegionalInventoriesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceSettings.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceSettings.java new file mode 100644 index 000000000000..4387ecb52bda --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceSettings.java @@ -0,0 +1,248 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import static com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient.ListRegionalInventoriesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.stub.RegionalInventoryServiceStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link RegionalInventoryServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (merchantapi.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of insertRegionalInventory to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RegionalInventoryServiceSettings.Builder regionalInventoryServiceSettingsBuilder =
+ *     RegionalInventoryServiceSettings.newBuilder();
+ * regionalInventoryServiceSettingsBuilder
+ *     .insertRegionalInventorySettings()
+ *     .setRetrySettings(
+ *         regionalInventoryServiceSettingsBuilder
+ *             .insertRegionalInventorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RegionalInventoryServiceSettings regionalInventoryServiceSettings =
+ *     regionalInventoryServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class RegionalInventoryServiceSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to listRegionalInventories. */ + public PagedCallSettings< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + ListRegionalInventoriesPagedResponse> + listRegionalInventoriesSettings() { + return ((RegionalInventoryServiceStubSettings) getStubSettings()) + .listRegionalInventoriesSettings(); + } + + /** Returns the object with the settings used for calls to insertRegionalInventory. */ + public UnaryCallSettings + insertRegionalInventorySettings() { + return ((RegionalInventoryServiceStubSettings) getStubSettings()) + .insertRegionalInventorySettings(); + } + + /** Returns the object with the settings used for calls to deleteRegionalInventory. */ + public UnaryCallSettings + deleteRegionalInventorySettings() { + return ((RegionalInventoryServiceStubSettings) getStubSettings()) + .deleteRegionalInventorySettings(); + } + + public static final RegionalInventoryServiceSettings create( + RegionalInventoryServiceStubSettings stub) throws IOException { + return new RegionalInventoryServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RegionalInventoryServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RegionalInventoryServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RegionalInventoryServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RegionalInventoryServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RegionalInventoryServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return RegionalInventoryServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RegionalInventoryServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionalInventoryServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionalInventoryServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RegionalInventoryServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(RegionalInventoryServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(RegionalInventoryServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RegionalInventoryServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(RegionalInventoryServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(RegionalInventoryServiceStubSettings.newHttpJsonBuilder()); + } + + public RegionalInventoryServiceStubSettings.Builder getStubSettingsBuilder() { + return ((RegionalInventoryServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listRegionalInventories. */ + public PagedCallSettings.Builder< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + ListRegionalInventoriesPagedResponse> + listRegionalInventoriesSettings() { + return getStubSettingsBuilder().listRegionalInventoriesSettings(); + } + + /** Returns the builder for the settings used for calls to insertRegionalInventory. */ + public UnaryCallSettings.Builder + insertRegionalInventorySettings() { + return getStubSettingsBuilder().insertRegionalInventorySettings(); + } + + /** Returns the builder for the settings used for calls to deleteRegionalInventory. */ + public UnaryCallSettings.Builder + deleteRegionalInventorySettings() { + return getStubSettingsBuilder().deleteRegionalInventorySettings(); + } + + @Override + public RegionalInventoryServiceSettings build() throws IOException { + return new RegionalInventoryServiceSettings(this); + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/gapic_metadata.json b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..6a09fbb0366a --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/gapic_metadata.json @@ -0,0 +1,45 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.shopping.merchant.inventories.v1beta", + "libraryPackage": "com.google.shopping.merchant.inventories.v1beta", + "services": { + "LocalInventoryService": { + "clients": { + "grpc": { + "libraryClient": "LocalInventoryServiceClient", + "rpcs": { + "DeleteLocalInventory": { + "methods": ["deleteLocalInventory", "deleteLocalInventory", "deleteLocalInventory", "deleteLocalInventoryCallable"] + }, + "InsertLocalInventory": { + "methods": ["insertLocalInventory", "insertLocalInventoryCallable"] + }, + "ListLocalInventories": { + "methods": ["listLocalInventories", "listLocalInventories", "listLocalInventoriesPagedCallable", "listLocalInventoriesCallable"] + } + } + } + } + }, + "RegionalInventoryService": { + "clients": { + "grpc": { + "libraryClient": "RegionalInventoryServiceClient", + "rpcs": { + "DeleteRegionalInventory": { + "methods": ["deleteRegionalInventory", "deleteRegionalInventory", "deleteRegionalInventory", "deleteRegionalInventoryCallable"] + }, + "InsertRegionalInventory": { + "methods": ["insertRegionalInventory", "insertRegionalInventoryCallable"] + }, + "ListRegionalInventories": { + "methods": ["listRegionalInventories", "listRegionalInventories", "listRegionalInventoriesPagedCallable", "listRegionalInventoriesCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/package-info.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/package-info.java new file mode 100644 index 000000000000..d95ea4ae7b21 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/package-info.java @@ -0,0 +1,72 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Merchant API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= LocalInventoryServiceClient ======================= + * + *

Service Description: Service to manage local inventory for products + * + *

Sample for LocalInventoryServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LocalInventoryServiceClient localInventoryServiceClient =
+ *     LocalInventoryServiceClient.create()) {
+ *   InsertLocalInventoryRequest request =
+ *       InsertLocalInventoryRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setLocalInventory(LocalInventory.newBuilder().build())
+ *           .build();
+ *   LocalInventory response = localInventoryServiceClient.insertLocalInventory(request);
+ * }
+ * }
+ * + *

======================= RegionalInventoryServiceClient ======================= + * + *

Service Description: Service to manage regional inventory for products. There is also separate + * `regions` resource and API to manage regions definitions. + * + *

Sample for RegionalInventoryServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (RegionalInventoryServiceClient regionalInventoryServiceClient =
+ *     RegionalInventoryServiceClient.create()) {
+ *   InsertRegionalInventoryRequest request =
+ *       InsertRegionalInventoryRequest.newBuilder()
+ *           .setParent("parent-995424086")
+ *           .setRegionalInventory(RegionalInventory.newBuilder().build())
+ *           .build();
+ *   RegionalInventory response = regionalInventoryServiceClient.insertRegionalInventory(request);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.shopping.merchant.inventories.v1beta; + +import javax.annotation.Generated; diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcLocalInventoryServiceCallableFactory.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcLocalInventoryServiceCallableFactory.java new file mode 100644 index 000000000000..b0eb2ccd0e0a --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcLocalInventoryServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the LocalInventoryService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcLocalInventoryServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcLocalInventoryServiceStub.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcLocalInventoryServiceStub.java new file mode 100644 index 000000000000..e7ce7fc3a527 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcLocalInventoryServiceStub.java @@ -0,0 +1,256 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import static com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient.ListLocalInventoriesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the LocalInventoryService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcLocalInventoryServiceStub extends LocalInventoryServiceStub { + private static final MethodDescriptor + listLocalInventoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.LocalInventoryService/ListLocalInventories") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocalInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocalInventoriesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + insertLocalInventoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.LocalInventoryService/InsertLocalInventory") + .setRequestMarshaller( + ProtoUtils.marshaller(InsertLocalInventoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LocalInventory.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteLocalInventoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.LocalInventoryService/DeleteLocalInventory") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteLocalInventoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable + listLocalInventoriesCallable; + private final UnaryCallable + listLocalInventoriesPagedCallable; + private final UnaryCallable + insertLocalInventoryCallable; + private final UnaryCallable deleteLocalInventoryCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcLocalInventoryServiceStub create( + LocalInventoryServiceStubSettings settings) throws IOException { + return new GrpcLocalInventoryServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcLocalInventoryServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcLocalInventoryServiceStub( + LocalInventoryServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcLocalInventoryServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcLocalInventoryServiceStub( + LocalInventoryServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcLocalInventoryServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcLocalInventoryServiceStub( + LocalInventoryServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcLocalInventoryServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcLocalInventoryServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcLocalInventoryServiceStub( + LocalInventoryServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listLocalInventoriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocalInventoriesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + insertLocalInventoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertLocalInventoryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteLocalInventoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteLocalInventoryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listLocalInventoriesCallable = + callableFactory.createUnaryCallable( + listLocalInventoriesTransportSettings, + settings.listLocalInventoriesSettings(), + clientContext); + this.listLocalInventoriesPagedCallable = + callableFactory.createPagedCallable( + listLocalInventoriesTransportSettings, + settings.listLocalInventoriesSettings(), + clientContext); + this.insertLocalInventoryCallable = + callableFactory.createUnaryCallable( + insertLocalInventoryTransportSettings, + settings.insertLocalInventorySettings(), + clientContext); + this.deleteLocalInventoryCallable = + callableFactory.createUnaryCallable( + deleteLocalInventoryTransportSettings, + settings.deleteLocalInventorySettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listLocalInventoriesCallable() { + return listLocalInventoriesCallable; + } + + @Override + public UnaryCallable + listLocalInventoriesPagedCallable() { + return listLocalInventoriesPagedCallable; + } + + @Override + public UnaryCallable insertLocalInventoryCallable() { + return insertLocalInventoryCallable; + } + + @Override + public UnaryCallable deleteLocalInventoryCallable() { + return deleteLocalInventoryCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcRegionalInventoryServiceCallableFactory.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcRegionalInventoryServiceCallableFactory.java new file mode 100644 index 000000000000..bc877a402b76 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcRegionalInventoryServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the RegionalInventoryService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcRegionalInventoryServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcRegionalInventoryServiceStub.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcRegionalInventoryServiceStub.java new file mode 100644 index 000000000000..998717f893b6 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/GrpcRegionalInventoryServiceStub.java @@ -0,0 +1,263 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import static com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient.ListRegionalInventoriesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the RegionalInventoryService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcRegionalInventoryServiceStub extends RegionalInventoryServiceStub { + private static final MethodDescriptor< + ListRegionalInventoriesRequest, ListRegionalInventoriesResponse> + listRegionalInventoriesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.RegionalInventoryService/ListRegionalInventories") + .setRequestMarshaller( + ProtoUtils.marshaller(ListRegionalInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRegionalInventoriesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + insertRegionalInventoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.RegionalInventoryService/InsertRegionalInventory") + .setRequestMarshaller( + ProtoUtils.marshaller(InsertRegionalInventoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RegionalInventory.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteRegionalInventoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.RegionalInventoryService/DeleteRegionalInventory") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteRegionalInventoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable + listRegionalInventoriesCallable; + private final UnaryCallable + listRegionalInventoriesPagedCallable; + private final UnaryCallable + insertRegionalInventoryCallable; + private final UnaryCallable + deleteRegionalInventoryCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRegionalInventoryServiceStub create( + RegionalInventoryServiceStubSettings settings) throws IOException { + return new GrpcRegionalInventoryServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcRegionalInventoryServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcRegionalInventoryServiceStub( + RegionalInventoryServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRegionalInventoryServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRegionalInventoryServiceStub( + RegionalInventoryServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcRegionalInventoryServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcRegionalInventoryServiceStub( + RegionalInventoryServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcRegionalInventoryServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcRegionalInventoryServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcRegionalInventoryServiceStub( + RegionalInventoryServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listRegionalInventoriesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listRegionalInventoriesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + insertRegionalInventoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(insertRegionalInventoryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deleteRegionalInventoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionalInventoryMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listRegionalInventoriesCallable = + callableFactory.createUnaryCallable( + listRegionalInventoriesTransportSettings, + settings.listRegionalInventoriesSettings(), + clientContext); + this.listRegionalInventoriesPagedCallable = + callableFactory.createPagedCallable( + listRegionalInventoriesTransportSettings, + settings.listRegionalInventoriesSettings(), + clientContext); + this.insertRegionalInventoryCallable = + callableFactory.createUnaryCallable( + insertRegionalInventoryTransportSettings, + settings.insertRegionalInventorySettings(), + clientContext); + this.deleteRegionalInventoryCallable = + callableFactory.createUnaryCallable( + deleteRegionalInventoryTransportSettings, + settings.deleteRegionalInventorySettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable + listRegionalInventoriesCallable() { + return listRegionalInventoriesCallable; + } + + @Override + public UnaryCallable + listRegionalInventoriesPagedCallable() { + return listRegionalInventoriesPagedCallable; + } + + @Override + public UnaryCallable + insertRegionalInventoryCallable() { + return insertRegionalInventoryCallable; + } + + @Override + public UnaryCallable deleteRegionalInventoryCallable() { + return deleteRegionalInventoryCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonLocalInventoryServiceCallableFactory.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonLocalInventoryServiceCallableFactory.java new file mode 100644 index 000000000000..f34de13e400b --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonLocalInventoryServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the LocalInventoryService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonLocalInventoryServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonLocalInventoryServiceStub.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonLocalInventoryServiceStub.java new file mode 100644 index 000000000000..ba77873eaa7e --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonLocalInventoryServiceStub.java @@ -0,0 +1,352 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import static com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient.ListLocalInventoriesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the LocalInventoryService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonLocalInventoryServiceStub extends LocalInventoryServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + ListLocalInventoriesRequest, ListLocalInventoriesResponse> + listLocalInventoriesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.LocalInventoryService/ListLocalInventories") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/inventories/v1beta/{parent=accounts/*/products/*}/localInventories", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocalInventoriesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertLocalInventoryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.LocalInventoryService/InsertLocalInventory") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/inventories/v1beta/{parent=accounts/*/products/*}/localInventories:insert", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("localInventory", request.getLocalInventory(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(LocalInventory.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteLocalInventoryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.LocalInventoryService/DeleteLocalInventory") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/inventories/v1beta/{name=accounts/*/products/*/localInventories/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listLocalInventoriesCallable; + private final UnaryCallable + listLocalInventoriesPagedCallable; + private final UnaryCallable + insertLocalInventoryCallable; + private final UnaryCallable deleteLocalInventoryCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonLocalInventoryServiceStub create( + LocalInventoryServiceStubSettings settings) throws IOException { + return new HttpJsonLocalInventoryServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonLocalInventoryServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonLocalInventoryServiceStub( + LocalInventoryServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonLocalInventoryServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonLocalInventoryServiceStub( + LocalInventoryServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonLocalInventoryServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonLocalInventoryServiceStub( + LocalInventoryServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonLocalInventoryServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonLocalInventoryServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonLocalInventoryServiceStub( + LocalInventoryServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listLocalInventoriesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listLocalInventoriesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + insertLocalInventoryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertLocalInventoryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteLocalInventoryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteLocalInventoryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listLocalInventoriesCallable = + callableFactory.createUnaryCallable( + listLocalInventoriesTransportSettings, + settings.listLocalInventoriesSettings(), + clientContext); + this.listLocalInventoriesPagedCallable = + callableFactory.createPagedCallable( + listLocalInventoriesTransportSettings, + settings.listLocalInventoriesSettings(), + clientContext); + this.insertLocalInventoryCallable = + callableFactory.createUnaryCallable( + insertLocalInventoryTransportSettings, + settings.insertLocalInventorySettings(), + clientContext); + this.deleteLocalInventoryCallable = + callableFactory.createUnaryCallable( + deleteLocalInventoryTransportSettings, + settings.deleteLocalInventorySettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listLocalInventoriesMethodDescriptor); + methodDescriptors.add(insertLocalInventoryMethodDescriptor); + methodDescriptors.add(deleteLocalInventoryMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + listLocalInventoriesCallable() { + return listLocalInventoriesCallable; + } + + @Override + public UnaryCallable + listLocalInventoriesPagedCallable() { + return listLocalInventoriesPagedCallable; + } + + @Override + public UnaryCallable insertLocalInventoryCallable() { + return insertLocalInventoryCallable; + } + + @Override + public UnaryCallable deleteLocalInventoryCallable() { + return deleteLocalInventoryCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonRegionalInventoryServiceCallableFactory.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonRegionalInventoryServiceCallableFactory.java new file mode 100644 index 000000000000..8f2f0ef5cc07 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonRegionalInventoryServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the RegionalInventoryService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonRegionalInventoryServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonRegionalInventoryServiceStub.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonRegionalInventoryServiceStub.java new file mode 100644 index 000000000000..ef1f28d70b06 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/HttpJsonRegionalInventoryServiceStub.java @@ -0,0 +1,357 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import static com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient.ListRegionalInventoriesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the RegionalInventoryService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonRegionalInventoryServiceStub extends RegionalInventoryServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor< + ListRegionalInventoriesRequest, ListRegionalInventoriesResponse> + listRegionalInventoriesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.RegionalInventoryService/ListRegionalInventories") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/inventories/v1beta/{parent=accounts/*/products/*}/regionalInventories", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRegionalInventoriesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + insertRegionalInventoryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.RegionalInventoryService/InsertRegionalInventory") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/inventories/v1beta/{parent=accounts/*/products/*}/regionalInventories:insert", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "regionalInventory", request.getRegionalInventory(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RegionalInventory.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteRegionalInventoryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.inventories.v1beta.RegionalInventoryService/DeleteRegionalInventory") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/inventories/v1beta/{name=accounts/*/products/*/regionalInventories/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listRegionalInventoriesCallable; + private final UnaryCallable + listRegionalInventoriesPagedCallable; + private final UnaryCallable + insertRegionalInventoryCallable; + private final UnaryCallable + deleteRegionalInventoryCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonRegionalInventoryServiceStub create( + RegionalInventoryServiceStubSettings settings) throws IOException { + return new HttpJsonRegionalInventoryServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonRegionalInventoryServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonRegionalInventoryServiceStub( + RegionalInventoryServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonRegionalInventoryServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonRegionalInventoryServiceStub( + RegionalInventoryServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonRegionalInventoryServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonRegionalInventoryServiceStub( + RegionalInventoryServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonRegionalInventoryServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonRegionalInventoryServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonRegionalInventoryServiceStub( + RegionalInventoryServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listRegionalInventoriesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listRegionalInventoriesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + insertRegionalInventoryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(insertRegionalInventoryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deleteRegionalInventoryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRegionalInventoryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listRegionalInventoriesCallable = + callableFactory.createUnaryCallable( + listRegionalInventoriesTransportSettings, + settings.listRegionalInventoriesSettings(), + clientContext); + this.listRegionalInventoriesPagedCallable = + callableFactory.createPagedCallable( + listRegionalInventoriesTransportSettings, + settings.listRegionalInventoriesSettings(), + clientContext); + this.insertRegionalInventoryCallable = + callableFactory.createUnaryCallable( + insertRegionalInventoryTransportSettings, + settings.insertRegionalInventorySettings(), + clientContext); + this.deleteRegionalInventoryCallable = + callableFactory.createUnaryCallable( + deleteRegionalInventoryTransportSettings, + settings.deleteRegionalInventorySettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listRegionalInventoriesMethodDescriptor); + methodDescriptors.add(insertRegionalInventoryMethodDescriptor); + methodDescriptors.add(deleteRegionalInventoryMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + listRegionalInventoriesCallable() { + return listRegionalInventoriesCallable; + } + + @Override + public UnaryCallable + listRegionalInventoriesPagedCallable() { + return listRegionalInventoriesPagedCallable; + } + + @Override + public UnaryCallable + insertRegionalInventoryCallable() { + return insertRegionalInventoryCallable; + } + + @Override + public UnaryCallable deleteRegionalInventoryCallable() { + return deleteRegionalInventoryCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/LocalInventoryServiceStub.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/LocalInventoryServiceStub.java new file mode 100644 index 000000000000..f4df64803ad7 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/LocalInventoryServiceStub.java @@ -0,0 +1,62 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import static com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient.ListLocalInventoriesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the LocalInventoryService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class LocalInventoryServiceStub implements BackgroundResource { + + public UnaryCallable + listLocalInventoriesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocalInventoriesPagedCallable()"); + } + + public UnaryCallable + listLocalInventoriesCallable() { + throw new UnsupportedOperationException("Not implemented: listLocalInventoriesCallable()"); + } + + public UnaryCallable insertLocalInventoryCallable() { + throw new UnsupportedOperationException("Not implemented: insertLocalInventoryCallable()"); + } + + public UnaryCallable deleteLocalInventoryCallable() { + throw new UnsupportedOperationException("Not implemented: deleteLocalInventoryCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/LocalInventoryServiceStubSettings.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/LocalInventoryServiceStubSettings.java new file mode 100644 index 000000000000..b686fbeb7ae1 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/LocalInventoryServiceStubSettings.java @@ -0,0 +1,474 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import static com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient.ListLocalInventoriesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link LocalInventoryServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (merchantapi.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of insertLocalInventory to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LocalInventoryServiceStubSettings.Builder localInventoryServiceSettingsBuilder =
+ *     LocalInventoryServiceStubSettings.newBuilder();
+ * localInventoryServiceSettingsBuilder
+ *     .insertLocalInventorySettings()
+ *     .setRetrySettings(
+ *         localInventoryServiceSettingsBuilder
+ *             .insertLocalInventorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * LocalInventoryServiceStubSettings localInventoryServiceSettings =
+ *     localInventoryServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class LocalInventoryServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/content").build(); + + private final PagedCallSettings< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + ListLocalInventoriesPagedResponse> + listLocalInventoriesSettings; + private final UnaryCallSettings + insertLocalInventorySettings; + private final UnaryCallSettings deleteLocalInventorySettings; + + private static final PagedListDescriptor< + ListLocalInventoriesRequest, ListLocalInventoriesResponse, LocalInventory> + LIST_LOCAL_INVENTORIES_PAGE_STR_DESC = + new PagedListDescriptor< + ListLocalInventoriesRequest, ListLocalInventoriesResponse, LocalInventory>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocalInventoriesRequest injectToken( + ListLocalInventoriesRequest payload, String token) { + return ListLocalInventoriesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocalInventoriesRequest injectPageSize( + ListLocalInventoriesRequest payload, int pageSize) { + return ListLocalInventoriesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocalInventoriesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocalInventoriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocalInventoriesResponse payload) { + return payload.getLocalInventoriesList() == null + ? ImmutableList.of() + : payload.getLocalInventoriesList(); + } + }; + + private static final PagedListResponseFactory< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + ListLocalInventoriesPagedResponse> + LIST_LOCAL_INVENTORIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + ListLocalInventoriesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocalInventoriesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_LOCAL_INVENTORIES_PAGE_STR_DESC, request, context); + return ListLocalInventoriesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listLocalInventories. */ + public PagedCallSettings< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + ListLocalInventoriesPagedResponse> + listLocalInventoriesSettings() { + return listLocalInventoriesSettings; + } + + /** Returns the object with the settings used for calls to insertLocalInventory. */ + public UnaryCallSettings + insertLocalInventorySettings() { + return insertLocalInventorySettings; + } + + /** Returns the object with the settings used for calls to deleteLocalInventory. */ + public UnaryCallSettings deleteLocalInventorySettings() { + return deleteLocalInventorySettings; + } + + public LocalInventoryServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcLocalInventoryServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonLocalInventoryServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "merchantapi.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "merchantapi.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(LocalInventoryServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(LocalInventoryServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LocalInventoryServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected LocalInventoryServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listLocalInventoriesSettings = settingsBuilder.listLocalInventoriesSettings().build(); + insertLocalInventorySettings = settingsBuilder.insertLocalInventorySettings().build(); + deleteLocalInventorySettings = settingsBuilder.deleteLocalInventorySettings().build(); + } + + /** Builder for LocalInventoryServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + ListLocalInventoriesPagedResponse> + listLocalInventoriesSettings; + private final UnaryCallSettings.Builder + insertLocalInventorySettings; + private final UnaryCallSettings.Builder + deleteLocalInventorySettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listLocalInventoriesSettings = + PagedCallSettings.newBuilder(LIST_LOCAL_INVENTORIES_PAGE_STR_FACT); + insertLocalInventorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteLocalInventorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listLocalInventoriesSettings, + insertLocalInventorySettings, + deleteLocalInventorySettings); + initDefaults(this); + } + + protected Builder(LocalInventoryServiceStubSettings settings) { + super(settings); + + listLocalInventoriesSettings = settings.listLocalInventoriesSettings.toBuilder(); + insertLocalInventorySettings = settings.insertLocalInventorySettings.toBuilder(); + deleteLocalInventorySettings = settings.deleteLocalInventorySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listLocalInventoriesSettings, + insertLocalInventorySettings, + deleteLocalInventorySettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listLocalInventoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .insertLocalInventorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteLocalInventorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listLocalInventories. */ + public PagedCallSettings.Builder< + ListLocalInventoriesRequest, + ListLocalInventoriesResponse, + ListLocalInventoriesPagedResponse> + listLocalInventoriesSettings() { + return listLocalInventoriesSettings; + } + + /** Returns the builder for the settings used for calls to insertLocalInventory. */ + public UnaryCallSettings.Builder + insertLocalInventorySettings() { + return insertLocalInventorySettings; + } + + /** Returns the builder for the settings used for calls to deleteLocalInventory. */ + public UnaryCallSettings.Builder + deleteLocalInventorySettings() { + return deleteLocalInventorySettings; + } + + @Override + public LocalInventoryServiceStubSettings build() throws IOException { + return new LocalInventoryServiceStubSettings(this); + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/RegionalInventoryServiceStub.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/RegionalInventoryServiceStub.java new file mode 100644 index 000000000000..9fad6dfa82d2 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/RegionalInventoryServiceStub.java @@ -0,0 +1,64 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import static com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient.ListRegionalInventoriesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the RegionalInventoryService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class RegionalInventoryServiceStub implements BackgroundResource { + + public UnaryCallable + listRegionalInventoriesPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listRegionalInventoriesPagedCallable()"); + } + + public UnaryCallable + listRegionalInventoriesCallable() { + throw new UnsupportedOperationException("Not implemented: listRegionalInventoriesCallable()"); + } + + public UnaryCallable + insertRegionalInventoryCallable() { + throw new UnsupportedOperationException("Not implemented: insertRegionalInventoryCallable()"); + } + + public UnaryCallable deleteRegionalInventoryCallable() { + throw new UnsupportedOperationException("Not implemented: deleteRegionalInventoryCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/RegionalInventoryServiceStubSettings.java b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/RegionalInventoryServiceStubSettings.java new file mode 100644 index 000000000000..69a800ac3694 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/java/com/google/shopping/merchant/inventories/v1beta/stub/RegionalInventoryServiceStubSettings.java @@ -0,0 +1,485 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub; + +import static com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient.ListRegionalInventoriesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link RegionalInventoryServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (merchantapi.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of insertRegionalInventory to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * RegionalInventoryServiceStubSettings.Builder regionalInventoryServiceSettingsBuilder =
+ *     RegionalInventoryServiceStubSettings.newBuilder();
+ * regionalInventoryServiceSettingsBuilder
+ *     .insertRegionalInventorySettings()
+ *     .setRetrySettings(
+ *         regionalInventoryServiceSettingsBuilder
+ *             .insertRegionalInventorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * RegionalInventoryServiceStubSettings regionalInventoryServiceSettings =
+ *     regionalInventoryServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class RegionalInventoryServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/content").build(); + + private final PagedCallSettings< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + ListRegionalInventoriesPagedResponse> + listRegionalInventoriesSettings; + private final UnaryCallSettings + insertRegionalInventorySettings; + private final UnaryCallSettings + deleteRegionalInventorySettings; + + private static final PagedListDescriptor< + ListRegionalInventoriesRequest, ListRegionalInventoriesResponse, RegionalInventory> + LIST_REGIONAL_INVENTORIES_PAGE_STR_DESC = + new PagedListDescriptor< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + RegionalInventory>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListRegionalInventoriesRequest injectToken( + ListRegionalInventoriesRequest payload, String token) { + return ListRegionalInventoriesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListRegionalInventoriesRequest injectPageSize( + ListRegionalInventoriesRequest payload, int pageSize) { + return ListRegionalInventoriesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListRegionalInventoriesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListRegionalInventoriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListRegionalInventoriesResponse payload) { + return payload.getRegionalInventoriesList() == null + ? ImmutableList.of() + : payload.getRegionalInventoriesList(); + } + }; + + private static final PagedListResponseFactory< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + ListRegionalInventoriesPagedResponse> + LIST_REGIONAL_INVENTORIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + ListRegionalInventoriesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListRegionalInventoriesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + RegionalInventory> + pageContext = + PageContext.create( + callable, LIST_REGIONAL_INVENTORIES_PAGE_STR_DESC, request, context); + return ListRegionalInventoriesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listRegionalInventories. */ + public PagedCallSettings< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + ListRegionalInventoriesPagedResponse> + listRegionalInventoriesSettings() { + return listRegionalInventoriesSettings; + } + + /** Returns the object with the settings used for calls to insertRegionalInventory. */ + public UnaryCallSettings + insertRegionalInventorySettings() { + return insertRegionalInventorySettings; + } + + /** Returns the object with the settings used for calls to deleteRegionalInventory. */ + public UnaryCallSettings + deleteRegionalInventorySettings() { + return deleteRegionalInventorySettings; + } + + public RegionalInventoryServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRegionalInventoryServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonRegionalInventoryServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "merchantapi.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "merchantapi.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RegionalInventoryServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(RegionalInventoryServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RegionalInventoryServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RegionalInventoryServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listRegionalInventoriesSettings = settingsBuilder.listRegionalInventoriesSettings().build(); + insertRegionalInventorySettings = settingsBuilder.insertRegionalInventorySettings().build(); + deleteRegionalInventorySettings = settingsBuilder.deleteRegionalInventorySettings().build(); + } + + /** Builder for RegionalInventoryServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + ListRegionalInventoriesPagedResponse> + listRegionalInventoriesSettings; + private final UnaryCallSettings.Builder + insertRegionalInventorySettings; + private final UnaryCallSettings.Builder + deleteRegionalInventorySettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(10000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listRegionalInventoriesSettings = + PagedCallSettings.newBuilder(LIST_REGIONAL_INVENTORIES_PAGE_STR_FACT); + insertRegionalInventorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteRegionalInventorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listRegionalInventoriesSettings, + insertRegionalInventorySettings, + deleteRegionalInventorySettings); + initDefaults(this); + } + + protected Builder(RegionalInventoryServiceStubSettings settings) { + super(settings); + + listRegionalInventoriesSettings = settings.listRegionalInventoriesSettings.toBuilder(); + insertRegionalInventorySettings = settings.insertRegionalInventorySettings.toBuilder(); + deleteRegionalInventorySettings = settings.deleteRegionalInventorySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listRegionalInventoriesSettings, + insertRegionalInventorySettings, + deleteRegionalInventorySettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listRegionalInventoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .insertRegionalInventorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deleteRegionalInventorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listRegionalInventories. */ + public PagedCallSettings.Builder< + ListRegionalInventoriesRequest, + ListRegionalInventoriesResponse, + ListRegionalInventoriesPagedResponse> + listRegionalInventoriesSettings() { + return listRegionalInventoriesSettings; + } + + /** Returns the builder for the settings used for calls to insertRegionalInventory. */ + public UnaryCallSettings.Builder + insertRegionalInventorySettings() { + return insertRegionalInventorySettings; + } + + /** Returns the builder for the settings used for calls to deleteRegionalInventory. */ + public UnaryCallSettings.Builder + deleteRegionalInventorySettings() { + return deleteRegionalInventorySettings; + } + + @Override + public RegionalInventoryServiceStubSettings build() throws IOException { + return new RegionalInventoryServiceStubSettings(this); + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/main/resources/META-INF/native-image/com.google.shopping.merchant.inventories.v1beta/reflect-config.json b/java-merchantapi/google-shopping-merchant-inventories/src/main/resources/META-INF/native-image/com.google.shopping.merchant.inventories.v1beta/reflect-config.json new file mode 100644 index 000000000000..f55085ce4e90 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/main/resources/META-INF/native-image/com.google.shopping.merchant.inventories.v1beta/reflect-config.json @@ -0,0 +1,1271 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.LocalInventory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.LocalInventory$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.RegionalInventory", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.inventories.v1beta.RegionalInventory$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.CustomAttribute", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.CustomAttribute$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Destination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Price", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.type.Price$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Interval", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Interval$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClientHttpJsonTest.java b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..077841ec7f58 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClientHttpJsonTest.java @@ -0,0 +1,277 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import static com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient.ListLocalInventoriesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.stub.HttpJsonLocalInventoryServiceStub; +import com.google.shopping.type.CustomAttribute; +import com.google.shopping.type.Price; +import com.google.type.Interval; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class LocalInventoryServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static LocalInventoryServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonLocalInventoryServiceStub.getMethodDescriptors(), + LocalInventoryServiceSettings.getDefaultEndpoint()); + LocalInventoryServiceSettings settings = + LocalInventoryServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + LocalInventoryServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LocalInventoryServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listLocalInventoriesTest() throws Exception { + LocalInventory responsesElement = LocalInventory.newBuilder().build(); + ListLocalInventoriesResponse expectedResponse = + ListLocalInventoriesResponse.newBuilder() + .setNextPageToken("") + .addAllLocalInventories(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-653/products/product-653"; + + ListLocalInventoriesPagedResponse pagedListResponse = client.listLocalInventories(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocalInventoriesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocalInventoriesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-653/products/product-653"; + client.listLocalInventories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertLocalInventoryTest() throws Exception { + LocalInventory expectedResponse = + LocalInventory.newBuilder() + .setName(LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]").toString()) + .setAccount(-1177318867) + .setStoreCode("storeCode1691468398") + .setPrice(Price.newBuilder().build()) + .setSalePrice(Price.newBuilder().build()) + .setSalePriceEffectiveDate(Interval.newBuilder().build()) + .setAvailability("availability1997542747") + .setQuantity(-1285004149) + .setPickupMethod("pickupMethod139786877") + .setPickupSla("pickupSla-1416603380") + .setInstoreProductLocation("instoreProductLocation965688136") + .addAllCustomAttributes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + InsertLocalInventoryRequest request = + InsertLocalInventoryRequest.newBuilder() + .setParent("accounts/account-653/products/product-653") + .setLocalInventory(LocalInventory.newBuilder().build()) + .build(); + + LocalInventory actualResponse = client.insertLocalInventory(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void insertLocalInventoryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InsertLocalInventoryRequest request = + InsertLocalInventoryRequest.newBuilder() + .setParent("accounts/account-653/products/product-653") + .setLocalInventory(LocalInventory.newBuilder().build()) + .build(); + client.insertLocalInventory(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteLocalInventoryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + LocalInventoryName name = LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]"); + + client.deleteLocalInventory(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteLocalInventoryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocalInventoryName name = LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]"); + client.deleteLocalInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteLocalInventoryTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "accounts/account-7207/products/product-7207/localInventories/localInventorie-7207"; + + client.deleteLocalInventory(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteLocalInventoryExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "accounts/account-7207/products/product-7207/localInventories/localInventorie-7207"; + client.deleteLocalInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClientTest.java b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClientTest.java new file mode 100644 index 000000000000..475b0ababc26 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceClientTest.java @@ -0,0 +1,260 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import static com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient.ListLocalInventoriesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.type.CustomAttribute; +import com.google.shopping.type.Price; +import com.google.type.Interval; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class LocalInventoryServiceClientTest { + private static MockLocalInventoryService mockLocalInventoryService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private LocalInventoryServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockLocalInventoryService = new MockLocalInventoryService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockLocalInventoryService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + LocalInventoryServiceSettings settings = + LocalInventoryServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LocalInventoryServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listLocalInventoriesTest() throws Exception { + LocalInventory responsesElement = LocalInventory.newBuilder().build(); + ListLocalInventoriesResponse expectedResponse = + ListLocalInventoriesResponse.newBuilder() + .setNextPageToken("") + .addAllLocalInventories(Arrays.asList(responsesElement)) + .build(); + mockLocalInventoryService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListLocalInventoriesPagedResponse pagedListResponse = client.listLocalInventories(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocalInventoriesList().get(0), resources.get(0)); + + List actualRequests = mockLocalInventoryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocalInventoriesRequest actualRequest = + ((ListLocalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocalInventoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocalInventoryService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listLocalInventories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertLocalInventoryTest() throws Exception { + LocalInventory expectedResponse = + LocalInventory.newBuilder() + .setName(LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]").toString()) + .setAccount(-1177318867) + .setStoreCode("storeCode1691468398") + .setPrice(Price.newBuilder().build()) + .setSalePrice(Price.newBuilder().build()) + .setSalePriceEffectiveDate(Interval.newBuilder().build()) + .setAvailability("availability1997542747") + .setQuantity(-1285004149) + .setPickupMethod("pickupMethod139786877") + .setPickupSla("pickupSla-1416603380") + .setInstoreProductLocation("instoreProductLocation965688136") + .addAllCustomAttributes(new ArrayList()) + .build(); + mockLocalInventoryService.addResponse(expectedResponse); + + InsertLocalInventoryRequest request = + InsertLocalInventoryRequest.newBuilder() + .setParent("parent-995424086") + .setLocalInventory(LocalInventory.newBuilder().build()) + .build(); + + LocalInventory actualResponse = client.insertLocalInventory(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocalInventoryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InsertLocalInventoryRequest actualRequest = + ((InsertLocalInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getLocalInventory(), actualRequest.getLocalInventory()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertLocalInventoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocalInventoryService.addException(exception); + + try { + InsertLocalInventoryRequest request = + InsertLocalInventoryRequest.newBuilder() + .setParent("parent-995424086") + .setLocalInventory(LocalInventory.newBuilder().build()) + .build(); + client.insertLocalInventory(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteLocalInventoryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockLocalInventoryService.addResponse(expectedResponse); + + LocalInventoryName name = LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]"); + + client.deleteLocalInventory(name); + + List actualRequests = mockLocalInventoryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLocalInventoryRequest actualRequest = + ((DeleteLocalInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLocalInventoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocalInventoryService.addException(exception); + + try { + LocalInventoryName name = LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]"); + client.deleteLocalInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteLocalInventoryTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockLocalInventoryService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteLocalInventory(name); + + List actualRequests = mockLocalInventoryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLocalInventoryRequest actualRequest = + ((DeleteLocalInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLocalInventoryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocalInventoryService.addException(exception); + + try { + String name = "name3373707"; + client.deleteLocalInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockLocalInventoryService.java b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockLocalInventoryService.java new file mode 100644 index 000000000000..d94cdd3c1fb2 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockLocalInventoryService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocalInventoryService implements MockGrpcService { + private final MockLocalInventoryServiceImpl serviceImpl; + + public MockLocalInventoryService() { + serviceImpl = new MockLocalInventoryServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockLocalInventoryServiceImpl.java b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockLocalInventoryServiceImpl.java new file mode 100644 index 000000000000..221a8f798de4 --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockLocalInventoryServiceImpl.java @@ -0,0 +1,125 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceGrpc.LocalInventoryServiceImplBase; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocalInventoryServiceImpl extends LocalInventoryServiceImplBase { + private List requests; + private Queue responses; + + public MockLocalInventoryServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocalInventories( + ListLocalInventoriesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocalInventoriesResponse) { + requests.add(request); + responseObserver.onNext(((ListLocalInventoriesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocalInventories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocalInventoriesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insertLocalInventory( + InsertLocalInventoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LocalInventory) { + requests.add(request); + responseObserver.onNext(((LocalInventory) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method InsertLocalInventory, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LocalInventory.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteLocalInventory( + DeleteLocalInventoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteLocalInventory, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockRegionalInventoryService.java b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockRegionalInventoryService.java new file mode 100644 index 000000000000..99318aa003ae --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockRegionalInventoryService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockRegionalInventoryService implements MockGrpcService { + private final MockRegionalInventoryServiceImpl serviceImpl; + + public MockRegionalInventoryService() { + serviceImpl = new MockRegionalInventoryServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockRegionalInventoryServiceImpl.java b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockRegionalInventoryServiceImpl.java new file mode 100644 index 000000000000..22ac7c9cee8e --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/MockRegionalInventoryServiceImpl.java @@ -0,0 +1,125 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceGrpc.RegionalInventoryServiceImplBase; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockRegionalInventoryServiceImpl extends RegionalInventoryServiceImplBase { + private List requests; + private Queue responses; + + public MockRegionalInventoryServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listRegionalInventories( + ListRegionalInventoriesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRegionalInventoriesResponse) { + requests.add(request); + responseObserver.onNext(((ListRegionalInventoriesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListRegionalInventories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRegionalInventoriesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void insertRegionalInventory( + InsertRegionalInventoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RegionalInventory) { + requests.add(request); + responseObserver.onNext(((RegionalInventory) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method InsertRegionalInventory, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RegionalInventory.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteRegionalInventory( + DeleteRegionalInventoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteRegionalInventory, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClientHttpJsonTest.java b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..5f6690673cfd --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClientHttpJsonTest.java @@ -0,0 +1,273 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import static com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient.ListRegionalInventoriesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.stub.HttpJsonRegionalInventoryServiceStub; +import com.google.shopping.type.CustomAttribute; +import com.google.shopping.type.Price; +import com.google.type.Interval; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class RegionalInventoryServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static RegionalInventoryServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonRegionalInventoryServiceStub.getMethodDescriptors(), + RegionalInventoryServiceSettings.getDefaultEndpoint()); + RegionalInventoryServiceSettings settings = + RegionalInventoryServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + RegionalInventoryServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionalInventoryServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listRegionalInventoriesTest() throws Exception { + RegionalInventory responsesElement = RegionalInventory.newBuilder().build(); + ListRegionalInventoriesResponse expectedResponse = + ListRegionalInventoriesResponse.newBuilder() + .setNextPageToken("") + .addAllRegionalInventories(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-653/products/product-653"; + + ListRegionalInventoriesPagedResponse pagedListResponse = client.listRegionalInventories(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRegionalInventoriesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRegionalInventoriesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-653/products/product-653"; + client.listRegionalInventories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertRegionalInventoryTest() throws Exception { + RegionalInventory expectedResponse = + RegionalInventory.newBuilder() + .setName(RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]").toString()) + .setAccount(-1177318867) + .setRegion("region-934795532") + .setPrice(Price.newBuilder().build()) + .setSalePrice(Price.newBuilder().build()) + .setSalePriceEffectiveDate(Interval.newBuilder().build()) + .setAvailability("availability1997542747") + .addAllCustomAttributes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + InsertRegionalInventoryRequest request = + InsertRegionalInventoryRequest.newBuilder() + .setParent("accounts/account-653/products/product-653") + .setRegionalInventory(RegionalInventory.newBuilder().build()) + .build(); + + RegionalInventory actualResponse = client.insertRegionalInventory(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void insertRegionalInventoryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InsertRegionalInventoryRequest request = + InsertRegionalInventoryRequest.newBuilder() + .setParent("accounts/account-653/products/product-653") + .setRegionalInventory(RegionalInventory.newBuilder().build()) + .build(); + client.insertRegionalInventory(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRegionalInventoryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + RegionalInventoryName name = RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]"); + + client.deleteRegionalInventory(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRegionalInventoryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RegionalInventoryName name = RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]"); + client.deleteRegionalInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRegionalInventoryTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "accounts/account-9207/products/product-9207/regionalInventories/regionalInventorie-9207"; + + client.deleteRegionalInventory(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteRegionalInventoryExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "accounts/account-9207/products/product-9207/regionalInventories/regionalInventorie-9207"; + client.deleteRegionalInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClientTest.java b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClientTest.java new file mode 100644 index 000000000000..97de0b37ea0a --- /dev/null +++ b/java-merchantapi/google-shopping-merchant-inventories/src/test/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceClientTest.java @@ -0,0 +1,256 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import static com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient.ListRegionalInventoriesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.shopping.type.CustomAttribute; +import com.google.shopping.type.Price; +import com.google.type.Interval; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class RegionalInventoryServiceClientTest { + private static MockRegionalInventoryService mockRegionalInventoryService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private RegionalInventoryServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockRegionalInventoryService = new MockRegionalInventoryService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockRegionalInventoryService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + RegionalInventoryServiceSettings settings = + RegionalInventoryServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RegionalInventoryServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listRegionalInventoriesTest() throws Exception { + RegionalInventory responsesElement = RegionalInventory.newBuilder().build(); + ListRegionalInventoriesResponse expectedResponse = + ListRegionalInventoriesResponse.newBuilder() + .setNextPageToken("") + .addAllRegionalInventories(Arrays.asList(responsesElement)) + .build(); + mockRegionalInventoryService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListRegionalInventoriesPagedResponse pagedListResponse = client.listRegionalInventories(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRegionalInventoriesList().get(0), resources.get(0)); + + List actualRequests = mockRegionalInventoryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRegionalInventoriesRequest actualRequest = + ((ListRegionalInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRegionalInventoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRegionalInventoryService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRegionalInventories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void insertRegionalInventoryTest() throws Exception { + RegionalInventory expectedResponse = + RegionalInventory.newBuilder() + .setName(RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]").toString()) + .setAccount(-1177318867) + .setRegion("region-934795532") + .setPrice(Price.newBuilder().build()) + .setSalePrice(Price.newBuilder().build()) + .setSalePriceEffectiveDate(Interval.newBuilder().build()) + .setAvailability("availability1997542747") + .addAllCustomAttributes(new ArrayList()) + .build(); + mockRegionalInventoryService.addResponse(expectedResponse); + + InsertRegionalInventoryRequest request = + InsertRegionalInventoryRequest.newBuilder() + .setParent("parent-995424086") + .setRegionalInventory(RegionalInventory.newBuilder().build()) + .build(); + + RegionalInventory actualResponse = client.insertRegionalInventory(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRegionalInventoryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + InsertRegionalInventoryRequest actualRequest = + ((InsertRegionalInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getRegionalInventory(), actualRequest.getRegionalInventory()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void insertRegionalInventoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRegionalInventoryService.addException(exception); + + try { + InsertRegionalInventoryRequest request = + InsertRegionalInventoryRequest.newBuilder() + .setParent("parent-995424086") + .setRegionalInventory(RegionalInventory.newBuilder().build()) + .build(); + client.insertRegionalInventory(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRegionalInventoryTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockRegionalInventoryService.addResponse(expectedResponse); + + RegionalInventoryName name = RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]"); + + client.deleteRegionalInventory(name); + + List actualRequests = mockRegionalInventoryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRegionalInventoryRequest actualRequest = + ((DeleteRegionalInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRegionalInventoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRegionalInventoryService.addException(exception); + + try { + RegionalInventoryName name = RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]"); + client.deleteRegionalInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteRegionalInventoryTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockRegionalInventoryService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteRegionalInventory(name); + + List actualRequests = mockRegionalInventoryService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteRegionalInventoryRequest actualRequest = + ((DeleteRegionalInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteRegionalInventoryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockRegionalInventoryService.addException(exception); + + try { + String name = "name3373707"; + client.deleteRegionalInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/pom.xml b/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/pom.xml new file mode 100644 index 000000000000..62f88a1202a4 --- /dev/null +++ b/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.shopping.api.grpc + grpc-google-shopping-merchant-inventories-v1beta + 0.0.1-SNAPSHOT + grpc-google-shopping-merchant-inventories-v1beta + GRPC library for google-shopping-merchant-inventories + + com.google.shopping + google-shopping-merchant-inventories-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-inventories-v1beta + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceGrpc.java b/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceGrpc.java new file mode 100644 index 000000000000..5c54cd4168cd --- /dev/null +++ b/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryServiceGrpc.java @@ -0,0 +1,700 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.shopping.merchant.inventories.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage local inventory for products
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/merchant/inventories/v1beta/localinventory.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class LocalInventoryServiceGrpc { + + private LocalInventoryServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.shopping.merchant.inventories.v1beta.LocalInventoryService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest, + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse> + getListLocalInventoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLocalInventories", + requestType = + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest.class, + responseType = + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest, + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse> + getListLocalInventoriesMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest, + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse> + getListLocalInventoriesMethod; + if ((getListLocalInventoriesMethod = LocalInventoryServiceGrpc.getListLocalInventoriesMethod) + == null) { + synchronized (LocalInventoryServiceGrpc.class) { + if ((getListLocalInventoriesMethod = + LocalInventoryServiceGrpc.getListLocalInventoriesMethod) + == null) { + LocalInventoryServiceGrpc.getListLocalInventoriesMethod = + getListLocalInventoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListLocalInventories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta + .ListLocalInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta + .ListLocalInventoriesResponse.getDefaultInstance())) + .setSchemaDescriptor( + new LocalInventoryServiceMethodDescriptorSupplier("ListLocalInventories")) + .build(); + } + } + } + return getListLocalInventoriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest, + com.google.shopping.merchant.inventories.v1beta.LocalInventory> + getInsertLocalInventoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InsertLocalInventory", + requestType = + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest.class, + responseType = com.google.shopping.merchant.inventories.v1beta.LocalInventory.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest, + com.google.shopping.merchant.inventories.v1beta.LocalInventory> + getInsertLocalInventoryMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest, + com.google.shopping.merchant.inventories.v1beta.LocalInventory> + getInsertLocalInventoryMethod; + if ((getInsertLocalInventoryMethod = LocalInventoryServiceGrpc.getInsertLocalInventoryMethod) + == null) { + synchronized (LocalInventoryServiceGrpc.class) { + if ((getInsertLocalInventoryMethod = + LocalInventoryServiceGrpc.getInsertLocalInventoryMethod) + == null) { + LocalInventoryServiceGrpc.getInsertLocalInventoryMethod = + getInsertLocalInventoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "InsertLocalInventory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta + .InsertLocalInventoryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta.LocalInventory + .getDefaultInstance())) + .setSchemaDescriptor( + new LocalInventoryServiceMethodDescriptorSupplier("InsertLocalInventory")) + .build(); + } + } + } + return getInsertLocalInventoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest, + com.google.protobuf.Empty> + getDeleteLocalInventoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteLocalInventory", + requestType = + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest, + com.google.protobuf.Empty> + getDeleteLocalInventoryMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest, + com.google.protobuf.Empty> + getDeleteLocalInventoryMethod; + if ((getDeleteLocalInventoryMethod = LocalInventoryServiceGrpc.getDeleteLocalInventoryMethod) + == null) { + synchronized (LocalInventoryServiceGrpc.class) { + if ((getDeleteLocalInventoryMethod = + LocalInventoryServiceGrpc.getDeleteLocalInventoryMethod) + == null) { + LocalInventoryServiceGrpc.getDeleteLocalInventoryMethod = + getDeleteLocalInventoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteLocalInventory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta + .DeleteLocalInventoryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new LocalInventoryServiceMethodDescriptorSupplier("DeleteLocalInventory")) + .build(); + } + } + } + return getDeleteLocalInventoryMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static LocalInventoryServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocalInventoryServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocalInventoryServiceStub(channel, callOptions); + } + }; + return LocalInventoryServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static LocalInventoryServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocalInventoryServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocalInventoryServiceBlockingStub(channel, callOptions); + } + }; + return LocalInventoryServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static LocalInventoryServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LocalInventoryServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocalInventoryServiceFutureStub(channel, callOptions); + } + }; + return LocalInventoryServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage local inventory for products
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists the `LocalInventory` resources for the given product in your merchant
+     * account. The response might contain fewer items than specified by
+     * `pageSize`. If `pageToken` was returned in previous request, it can be used
+     * to obtain additional results.
+     * `LocalInventory` resources are listed per product for a given account.
+     * 
+ */ + default void listLocalInventories( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListLocalInventoriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Inserts a `LocalInventory` resource to a product in your merchant
+     * account.
+     * Replaces the full `LocalInventory` resource if an entry with the same
+     * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code]
+     * already exists for the product.
+     * It might take up to 30 minutes for the new or updated `LocalInventory`
+     * resource to appear in products.
+     * 
+ */ + default void insertLocalInventory( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getInsertLocalInventoryMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified `LocalInventory` from the given product in your
+     * merchant account. It might take a up to an hour for the
+     * `LocalInventory` to be deleted from the specific product.
+     * Once you have received a successful delete response, wait for that
+     * period before attempting a delete again.
+     * 
+ */ + default void deleteLocalInventory( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteLocalInventoryMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service LocalInventoryService. + * + *
+   * Service to manage local inventory for products
+   * 
+ */ + public abstract static class LocalInventoryServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return LocalInventoryServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service LocalInventoryService. + * + *
+   * Service to manage local inventory for products
+   * 
+ */ + public static final class LocalInventoryServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private LocalInventoryServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocalInventoryServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocalInventoryServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the `LocalInventory` resources for the given product in your merchant
+     * account. The response might contain fewer items than specified by
+     * `pageSize`. If `pageToken` was returned in previous request, it can be used
+     * to obtain additional results.
+     * `LocalInventory` resources are listed per product for a given account.
+     * 
+ */ + public void listLocalInventories( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLocalInventoriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Inserts a `LocalInventory` resource to a product in your merchant
+     * account.
+     * Replaces the full `LocalInventory` resource if an entry with the same
+     * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code]
+     * already exists for the product.
+     * It might take up to 30 minutes for the new or updated `LocalInventory`
+     * resource to appear in products.
+     * 
+ */ + public void insertLocalInventory( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertLocalInventoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified `LocalInventory` from the given product in your
+     * merchant account. It might take a up to an hour for the
+     * `LocalInventory` to be deleted from the specific product.
+     * Once you have received a successful delete response, wait for that
+     * period before attempting a delete again.
+     * 
+ */ + public void deleteLocalInventory( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteLocalInventoryMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service LocalInventoryService. + * + *
+   * Service to manage local inventory for products
+   * 
+ */ + public static final class LocalInventoryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private LocalInventoryServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocalInventoryServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocalInventoryServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the `LocalInventory` resources for the given product in your merchant
+     * account. The response might contain fewer items than specified by
+     * `pageSize`. If `pageToken` was returned in previous request, it can be used
+     * to obtain additional results.
+     * `LocalInventory` resources are listed per product for a given account.
+     * 
+ */ + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + listLocalInventories( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLocalInventoriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Inserts a `LocalInventory` resource to a product in your merchant
+     * account.
+     * Replaces the full `LocalInventory` resource if an entry with the same
+     * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code]
+     * already exists for the product.
+     * It might take up to 30 minutes for the new or updated `LocalInventory`
+     * resource to appear in products.
+     * 
+ */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventory insertLocalInventory( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertLocalInventoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified `LocalInventory` from the given product in your
+     * merchant account. It might take a up to an hour for the
+     * `LocalInventory` to be deleted from the specific product.
+     * Once you have received a successful delete response, wait for that
+     * period before attempting a delete again.
+     * 
+ */ + public com.google.protobuf.Empty deleteLocalInventory( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteLocalInventoryMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * LocalInventoryService. + * + *
+   * Service to manage local inventory for products
+   * 
+ */ + public static final class LocalInventoryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private LocalInventoryServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LocalInventoryServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LocalInventoryServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the `LocalInventory` resources for the given product in your merchant
+     * account. The response might contain fewer items than specified by
+     * `pageSize`. If `pageToken` was returned in previous request, it can be used
+     * to obtain additional results.
+     * `LocalInventory` resources are listed per product for a given account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse> + listLocalInventories( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLocalInventoriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Inserts a `LocalInventory` resource to a product in your merchant
+     * account.
+     * Replaces the full `LocalInventory` resource if an entry with the same
+     * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code]
+     * already exists for the product.
+     * It might take up to 30 minutes for the new or updated `LocalInventory`
+     * resource to appear in products.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.inventories.v1beta.LocalInventory> + insertLocalInventory( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertLocalInventoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified `LocalInventory` from the given product in your
+     * merchant account. It might take a up to an hour for the
+     * `LocalInventory` to be deleted from the specific product.
+     * Once you have received a successful delete response, wait for that
+     * period before attempting a delete again.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteLocalInventory( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteLocalInventoryMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_LOCAL_INVENTORIES = 0; + private static final int METHODID_INSERT_LOCAL_INVENTORY = 1; + private static final int METHODID_DELETE_LOCAL_INVENTORY = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_LOCAL_INVENTORIES: + serviceImpl.listLocalInventories( + (com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse>) + responseObserver); + break; + case METHODID_INSERT_LOCAL_INVENTORY: + serviceImpl.insertLocalInventory( + (com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.LocalInventory>) + responseObserver); + break; + case METHODID_DELETE_LOCAL_INVENTORY: + serviceImpl.deleteLocalInventory( + (com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListLocalInventoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest, + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse>( + service, METHODID_LIST_LOCAL_INVENTORIES))) + .addMethod( + getInsertLocalInventoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest, + com.google.shopping.merchant.inventories.v1beta.LocalInventory>( + service, METHODID_INSERT_LOCAL_INVENTORY))) + .addMethod( + getDeleteLocalInventoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_LOCAL_INVENTORY))) + .build(); + } + + private abstract static class LocalInventoryServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + LocalInventoryServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("LocalInventoryService"); + } + } + + private static final class LocalInventoryServiceFileDescriptorSupplier + extends LocalInventoryServiceBaseDescriptorSupplier { + LocalInventoryServiceFileDescriptorSupplier() {} + } + + private static final class LocalInventoryServiceMethodDescriptorSupplier + extends LocalInventoryServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + LocalInventoryServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (LocalInventoryServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new LocalInventoryServiceFileDescriptorSupplier()) + .addMethod(getListLocalInventoriesMethod()) + .addMethod(getInsertLocalInventoryMethod()) + .addMethod(getDeleteLocalInventoryMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceGrpc.java b/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceGrpc.java new file mode 100644 index 000000000000..f7fd4d453c18 --- /dev/null +++ b/java-merchantapi/grpc-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryServiceGrpc.java @@ -0,0 +1,728 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.shopping.merchant.inventories.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to manage regional inventory for products. There is also separate
+ * `regions` resource and API to manage regions definitions.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class RegionalInventoryServiceGrpc { + + private RegionalInventoryServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.shopping.merchant.inventories.v1beta.RegionalInventoryService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest, + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse> + getListRegionalInventoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRegionalInventories", + requestType = + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest.class, + responseType = + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest, + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse> + getListRegionalInventoriesMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest, + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse> + getListRegionalInventoriesMethod; + if ((getListRegionalInventoriesMethod = + RegionalInventoryServiceGrpc.getListRegionalInventoriesMethod) + == null) { + synchronized (RegionalInventoryServiceGrpc.class) { + if ((getListRegionalInventoriesMethod = + RegionalInventoryServiceGrpc.getListRegionalInventoriesMethod) + == null) { + RegionalInventoryServiceGrpc.getListRegionalInventoriesMethod = + getListRegionalInventoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListRegionalInventories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta + .ListRegionalInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta + .ListRegionalInventoriesResponse.getDefaultInstance())) + .setSchemaDescriptor( + new RegionalInventoryServiceMethodDescriptorSupplier( + "ListRegionalInventories")) + .build(); + } + } + } + return getListRegionalInventoriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory> + getInsertRegionalInventoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InsertRegionalInventory", + requestType = + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest.class, + responseType = com.google.shopping.merchant.inventories.v1beta.RegionalInventory.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory> + getInsertRegionalInventoryMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory> + getInsertRegionalInventoryMethod; + if ((getInsertRegionalInventoryMethod = + RegionalInventoryServiceGrpc.getInsertRegionalInventoryMethod) + == null) { + synchronized (RegionalInventoryServiceGrpc.class) { + if ((getInsertRegionalInventoryMethod = + RegionalInventoryServiceGrpc.getInsertRegionalInventoryMethod) + == null) { + RegionalInventoryServiceGrpc.getInsertRegionalInventoryMethod = + getInsertRegionalInventoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "InsertRegionalInventory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta + .InsertRegionalInventoryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory + .getDefaultInstance())) + .setSchemaDescriptor( + new RegionalInventoryServiceMethodDescriptorSupplier( + "InsertRegionalInventory")) + .build(); + } + } + } + return getInsertRegionalInventoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest, + com.google.protobuf.Empty> + getDeleteRegionalInventoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteRegionalInventory", + requestType = + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest, + com.google.protobuf.Empty> + getDeleteRegionalInventoryMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest, + com.google.protobuf.Empty> + getDeleteRegionalInventoryMethod; + if ((getDeleteRegionalInventoryMethod = + RegionalInventoryServiceGrpc.getDeleteRegionalInventoryMethod) + == null) { + synchronized (RegionalInventoryServiceGrpc.class) { + if ((getDeleteRegionalInventoryMethod = + RegionalInventoryServiceGrpc.getDeleteRegionalInventoryMethod) + == null) { + RegionalInventoryServiceGrpc.getDeleteRegionalInventoryMethod = + getDeleteRegionalInventoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteRegionalInventory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.inventories.v1beta + .DeleteRegionalInventoryRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new RegionalInventoryServiceMethodDescriptorSupplier( + "DeleteRegionalInventory")) + .build(); + } + } + } + return getDeleteRegionalInventoryMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RegionalInventoryServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RegionalInventoryServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegionalInventoryServiceStub(channel, callOptions); + } + }; + return RegionalInventoryServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RegionalInventoryServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RegionalInventoryServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegionalInventoryServiceBlockingStub(channel, callOptions); + } + }; + return RegionalInventoryServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RegionalInventoryServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RegionalInventoryServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegionalInventoryServiceFutureStub(channel, callOptions); + } + }; + return RegionalInventoryServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to manage regional inventory for products. There is also separate
+   * `regions` resource and API to manage regions definitions.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists the `RegionalInventory` resources for the given product in your
+     * merchant account. The response might contain fewer items than specified by
+     * `pageSize`.  If `pageToken` was returned in previous request, it can be
+     * used to obtain additional results.
+     * `RegionalInventory` resources are listed per product for a given account.
+     * 
+ */ + default void listRegionalInventories( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRegionalInventoriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Inserts a `RegionalInventory` to a given product in your
+     * merchant account.
+     * Replaces the full `RegionalInventory` resource if an entry with the same
+     * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region]
+     * already exists for the product.
+     * It might take up to 30 minutes for the new or updated `RegionalInventory`
+     * resource to appear in products.
+     * 
+ */ + default void insertRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getInsertRegionalInventoryMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified `RegionalInventory` resource from the given product
+     * in your merchant account.  It might take up to an hour for the
+     * `RegionalInventory` to be deleted from the specific product.
+     * Once you have received a successful delete response, wait for that
+     * period before attempting a delete again.
+     * 
+ */ + default void deleteRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteRegionalInventoryMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service RegionalInventoryService. + * + *
+   * Service to manage regional inventory for products. There is also separate
+   * `regions` resource and API to manage regions definitions.
+   * 
+ */ + public abstract static class RegionalInventoryServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return RegionalInventoryServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service RegionalInventoryService. + * + *
+   * Service to manage regional inventory for products. There is also separate
+   * `regions` resource and API to manage regions definitions.
+   * 
+ */ + public static final class RegionalInventoryServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private RegionalInventoryServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RegionalInventoryServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegionalInventoryServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the `RegionalInventory` resources for the given product in your
+     * merchant account. The response might contain fewer items than specified by
+     * `pageSize`.  If `pageToken` was returned in previous request, it can be
+     * used to obtain additional results.
+     * `RegionalInventory` resources are listed per product for a given account.
+     * 
+ */ + public void listRegionalInventories( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRegionalInventoriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Inserts a `RegionalInventory` to a given product in your
+     * merchant account.
+     * Replaces the full `RegionalInventory` resource if an entry with the same
+     * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region]
+     * already exists for the product.
+     * It might take up to 30 minutes for the new or updated `RegionalInventory`
+     * resource to appear in products.
+     * 
+ */ + public void insertRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getInsertRegionalInventoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified `RegionalInventory` resource from the given product
+     * in your merchant account.  It might take up to an hour for the
+     * `RegionalInventory` to be deleted from the specific product.
+     * Once you have received a successful delete response, wait for that
+     * period before attempting a delete again.
+     * 
+ */ + public void deleteRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteRegionalInventoryMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service RegionalInventoryService. + * + *
+   * Service to manage regional inventory for products. There is also separate
+   * `regions` resource and API to manage regions definitions.
+   * 
+ */ + public static final class RegionalInventoryServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private RegionalInventoryServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RegionalInventoryServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegionalInventoryServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the `RegionalInventory` resources for the given product in your
+     * merchant account. The response might contain fewer items than specified by
+     * `pageSize`.  If `pageToken` was returned in previous request, it can be
+     * used to obtain additional results.
+     * `RegionalInventory` resources are listed per product for a given account.
+     * 
+ */ + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + listRegionalInventories( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRegionalInventoriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Inserts a `RegionalInventory` to a given product in your
+     * merchant account.
+     * Replaces the full `RegionalInventory` resource if an entry with the same
+     * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region]
+     * already exists for the product.
+     * It might take up to 30 minutes for the new or updated `RegionalInventory`
+     * resource to appear in products.
+     * 
+ */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory + insertRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getInsertRegionalInventoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified `RegionalInventory` resource from the given product
+     * in your merchant account.  It might take up to an hour for the
+     * `RegionalInventory` to be deleted from the specific product.
+     * Once you have received a successful delete response, wait for that
+     * period before attempting a delete again.
+     * 
+ */ + public com.google.protobuf.Empty deleteRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRegionalInventoryMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * RegionalInventoryService. + * + *
+   * Service to manage regional inventory for products. There is also separate
+   * `regions` resource and API to manage regions definitions.
+   * 
+ */ + public static final class RegionalInventoryServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private RegionalInventoryServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RegionalInventoryServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RegionalInventoryServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the `RegionalInventory` resources for the given product in your
+     * merchant account. The response might contain fewer items than specified by
+     * `pageSize`.  If `pageToken` was returned in previous request, it can be
+     * used to obtain additional results.
+     * `RegionalInventory` resources are listed per product for a given account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse> + listRegionalInventories( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRegionalInventoriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Inserts a `RegionalInventory` to a given product in your
+     * merchant account.
+     * Replaces the full `RegionalInventory` resource if an entry with the same
+     * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region]
+     * already exists for the product.
+     * It might take up to 30 minutes for the new or updated `RegionalInventory`
+     * resource to appear in products.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory> + insertRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getInsertRegionalInventoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified `RegionalInventory` resource from the given product
+     * in your merchant account.  It might take up to an hour for the
+     * `RegionalInventory` to be deleted from the specific product.
+     * Once you have received a successful delete response, wait for that
+     * period before attempting a delete again.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteRegionalInventoryMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_REGIONAL_INVENTORIES = 0; + private static final int METHODID_INSERT_REGIONAL_INVENTORY = 1; + private static final int METHODID_DELETE_REGIONAL_INVENTORY = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_REGIONAL_INVENTORIES: + serviceImpl.listRegionalInventories( + (com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta + .ListRegionalInventoriesResponse>) + responseObserver); + break; + case METHODID_INSERT_REGIONAL_INVENTORY: + serviceImpl.insertRegionalInventory( + (com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory>) + responseObserver); + break; + case METHODID_DELETE_REGIONAL_INVENTORY: + serviceImpl.deleteRegionalInventory( + (com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) + request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListRegionalInventoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest, + com.google.shopping.merchant.inventories.v1beta + .ListRegionalInventoriesResponse>( + service, METHODID_LIST_REGIONAL_INVENTORIES))) + .addMethod( + getInsertRegionalInventoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory>( + service, METHODID_INSERT_REGIONAL_INVENTORY))) + .addMethod( + getDeleteRegionalInventoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest, + com.google.protobuf.Empty>(service, METHODID_DELETE_REGIONAL_INVENTORY))) + .build(); + } + + private abstract static class RegionalInventoryServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RegionalInventoryServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RegionalInventoryService"); + } + } + + private static final class RegionalInventoryServiceFileDescriptorSupplier + extends RegionalInventoryServiceBaseDescriptorSupplier { + RegionalInventoryServiceFileDescriptorSupplier() {} + } + + private static final class RegionalInventoryServiceMethodDescriptorSupplier + extends RegionalInventoryServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + RegionalInventoryServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (RegionalInventoryServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RegionalInventoryServiceFileDescriptorSupplier()) + .addMethod(getListRegionalInventoriesMethod()) + .addMethod(getInsertRegionalInventoryMethod()) + .addMethod(getDeleteRegionalInventoryMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-merchantapi/owlbot.py b/java-merchantapi/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-merchantapi/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-merchantapi/pom.xml b/java-merchantapi/pom.xml new file mode 100644 index 000000000000..b29280f96f6a --- /dev/null +++ b/java-merchantapi/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-inventories-parent + pom + 0.0.1-SNAPSHOT + Google Merchant API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.19.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-shopping-merchant-inventories-parent + + + + + + com.google.shopping + google-shopping-merchant-inventories + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-inventories-v1beta + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-inventories-v1beta + 0.0.1-SNAPSHOT + + + + + + google-shopping-merchant-inventories + grpc-google-shopping-merchant-inventories-v1beta + proto-google-shopping-merchant-inventories-v1beta + google-shopping-merchant-inventories-bom + + + diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/clirr-ignored-differences.xml b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..d11b3221afec --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,33 @@ + + + + + 7012 + com/google/shopping/merchant/inventories/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/merchant/inventories/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/merchant/inventories/v1beta/*OrBuilder + boolean has*(*) + + 7012 + com/google/shopping/type/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/type/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/type/*OrBuilder + boolean has*(*) + + diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/pom.xml b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/pom.xml new file mode 100644 index 000000000000..7d6bd03ee184 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.shopping.api.grpc + proto-google-shopping-merchant-inventories-v1beta + 0.0.1-SNAPSHOT + proto-google-shopping-merchant-inventories-v1beta + Proto library for google-shopping-merchant-inventories + + com.google.shopping + google-shopping-merchant-inventories-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api + api-common + + + com.google.guava + guava + + + diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteLocalInventoryRequest.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteLocalInventoryRequest.java new file mode 100644 index 000000000000..694d9061f376 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteLocalInventoryRequest.java @@ -0,0 +1,676 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Request message for the `DeleteLocalInventory` method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest} + */ +public final class DeleteLocalInventoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) + DeleteLocalInventoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteLocalInventoryRequest.newBuilder() to construct. + private DeleteLocalInventoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteLocalInventoryRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteLocalInventoryRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest.class, + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest.Builder + .class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the local inventory for the given product to delete.
+   * Format:
+   * `accounts/{account}/products/{product}/localInventories/{store_code}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the local inventory for the given product to delete.
+   * Format:
+   * `accounts/{account}/products/{product}/localInventories/{store_code}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest other = + (com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `DeleteLocalInventory` method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest.class, + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest build() { + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + buildPartial() { + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest result = + new com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) { + return mergeFrom( + (com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the local inventory for the given product to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the local inventory for the given product to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the local inventory for the given product to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the local inventory for the given product to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the local inventory for the given product to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) + private static final com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest(); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteLocalInventoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteLocalInventoryRequestOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteLocalInventoryRequestOrBuilder.java new file mode 100644 index 000000000000..debcfec144ba --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteLocalInventoryRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface DeleteLocalInventoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the local inventory for the given product to delete.
+   * Format:
+   * `accounts/{account}/products/{product}/localInventories/{store_code}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the local inventory for the given product to delete.
+   * Format:
+   * `accounts/{account}/products/{product}/localInventories/{store_code}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteRegionalInventoryRequest.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteRegionalInventoryRequest.java new file mode 100644 index 000000000000..e6420c95aee0 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteRegionalInventoryRequest.java @@ -0,0 +1,681 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Request message for the `DeleteRegionalInventory` method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest} + */ +public final class DeleteRegionalInventoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) + DeleteRegionalInventoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteRegionalInventoryRequest.newBuilder() to construct. + private DeleteRegionalInventoryRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteRegionalInventoryRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteRegionalInventoryRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest.class, + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest.Builder + .class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the `RegionalInventory` resource to delete.
+   * Format:
+   * `accounts/{account}/products/{product}/regionalInventories/{region}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the `RegionalInventory` resource to delete.
+   * Format:
+   * `accounts/{account}/products/{product}/regionalInventories/{region}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest other = + (com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `DeleteRegionalInventory` method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest.class, + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest build() { + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + buildPartial() { + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest result = + new com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) { + return mergeFrom( + (com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the `RegionalInventory` resource to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the `RegionalInventory` resource to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the `RegionalInventory` resource to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the `RegionalInventory` resource to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the `RegionalInventory` resource to delete.
+     * Format:
+     * `accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) + private static final com.google.shopping.merchant.inventories.v1beta + .DeleteRegionalInventoryRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest(); + } + + public static com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteRegionalInventoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteRegionalInventoryRequestOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteRegionalInventoryRequestOrBuilder.java new file mode 100644 index 000000000000..3e0a16717e9f --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/DeleteRegionalInventoryRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface DeleteRegionalInventoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the `RegionalInventory` resource to delete.
+   * Format:
+   * `accounts/{account}/products/{product}/regionalInventories/{region}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the `RegionalInventory` resource to delete.
+   * Format:
+   * `accounts/{account}/products/{product}/regionalInventories/{region}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertLocalInventoryRequest.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertLocalInventoryRequest.java new file mode 100644 index 000000000000..ac2b3bfee675 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertLocalInventoryRequest.java @@ -0,0 +1,976 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Request message for the `InsertLocalInventory` method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest} + */ +public final class InsertLocalInventoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) + InsertLocalInventoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use InsertLocalInventoryRequest.newBuilder() to construct. + private InsertLocalInventoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InsertLocalInventoryRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InsertLocalInventoryRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest.class, + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The account and product where this inventory will be inserted.
+   * Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The account and product where this inventory will be inserted.
+   * Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCAL_INVENTORY_FIELD_NUMBER = 2; + private com.google.shopping.merchant.inventories.v1beta.LocalInventory localInventory_; + /** + * + * + *
+   * Required. Local inventory information of the product. If the product
+   * already has a `LocalInventory` resource for the same `storeCode`, full
+   * replacement of the `LocalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the localInventory field is set. + */ + @java.lang.Override + public boolean hasLocalInventory() { + return localInventory_ != null; + } + /** + * + * + *
+   * Required. Local inventory information of the product. If the product
+   * already has a `LocalInventory` resource for the same `storeCode`, full
+   * replacement of the `LocalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The localInventory. + */ + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.LocalInventory getLocalInventory() { + return localInventory_ == null + ? com.google.shopping.merchant.inventories.v1beta.LocalInventory.getDefaultInstance() + : localInventory_; + } + /** + * + * + *
+   * Required. Local inventory information of the product. If the product
+   * already has a `LocalInventory` resource for the same `storeCode`, full
+   * replacement of the `LocalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder + getLocalInventoryOrBuilder() { + return localInventory_ == null + ? com.google.shopping.merchant.inventories.v1beta.LocalInventory.getDefaultInstance() + : localInventory_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (localInventory_ != null) { + output.writeMessage(2, getLocalInventory()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (localInventory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLocalInventory()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest other = + (com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasLocalInventory() != other.hasLocalInventory()) return false; + if (hasLocalInventory()) { + if (!getLocalInventory().equals(other.getLocalInventory())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasLocalInventory()) { + hash = (37 * hash) + LOCAL_INVENTORY_FIELD_NUMBER; + hash = (53 * hash) + getLocalInventory().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `InsertLocalInventory` method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest.class, + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + localInventory_ = null; + if (localInventoryBuilder_ != null) { + localInventoryBuilder_.dispose(); + localInventoryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest build() { + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + buildPartial() { + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest result = + new com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.localInventory_ = + localInventoryBuilder_ == null ? localInventory_ : localInventoryBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) { + return mergeFrom( + (com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasLocalInventory()) { + mergeLocalInventory(other.getLocalInventory()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getLocalInventoryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.shopping.merchant.inventories.v1beta.LocalInventory localInventory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.LocalInventory, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder> + localInventoryBuilder_; + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the localInventory field is set. + */ + public boolean hasLocalInventory() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The localInventory. + */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventory getLocalInventory() { + if (localInventoryBuilder_ == null) { + return localInventory_ == null + ? com.google.shopping.merchant.inventories.v1beta.LocalInventory.getDefaultInstance() + : localInventory_; + } else { + return localInventoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLocalInventory( + com.google.shopping.merchant.inventories.v1beta.LocalInventory value) { + if (localInventoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + localInventory_ = value; + } else { + localInventoryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setLocalInventory( + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder builderForValue) { + if (localInventoryBuilder_ == null) { + localInventory_ = builderForValue.build(); + } else { + localInventoryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeLocalInventory( + com.google.shopping.merchant.inventories.v1beta.LocalInventory value) { + if (localInventoryBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && localInventory_ != null + && localInventory_ + != com.google.shopping.merchant.inventories.v1beta.LocalInventory + .getDefaultInstance()) { + getLocalInventoryBuilder().mergeFrom(value); + } else { + localInventory_ = value; + } + } else { + localInventoryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearLocalInventory() { + bitField0_ = (bitField0_ & ~0x00000002); + localInventory_ = null; + if (localInventoryBuilder_ != null) { + localInventoryBuilder_.dispose(); + localInventoryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder + getLocalInventoryBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getLocalInventoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder + getLocalInventoryOrBuilder() { + if (localInventoryBuilder_ != null) { + return localInventoryBuilder_.getMessageOrBuilder(); + } else { + return localInventory_ == null + ? com.google.shopping.merchant.inventories.v1beta.LocalInventory.getDefaultInstance() + : localInventory_; + } + } + /** + * + * + *
+     * Required. Local inventory information of the product. If the product
+     * already has a `LocalInventory` resource for the same `storeCode`, full
+     * replacement of the `LocalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.LocalInventory, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder> + getLocalInventoryFieldBuilder() { + if (localInventoryBuilder_ == null) { + localInventoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.LocalInventory, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder>( + getLocalInventory(), getParentForChildren(), isClean()); + localInventory_ = null; + } + return localInventoryBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) + private static final com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest(); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InsertLocalInventoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertLocalInventoryRequestOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertLocalInventoryRequestOrBuilder.java new file mode 100644 index 000000000000..4ed6335c2344 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertLocalInventoryRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface InsertLocalInventoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The account and product where this inventory will be inserted.
+   * Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The account and product where this inventory will be inserted.
+   * Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Local inventory information of the product. If the product
+   * already has a `LocalInventory` resource for the same `storeCode`, full
+   * replacement of the `LocalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the localInventory field is set. + */ + boolean hasLocalInventory(); + /** + * + * + *
+   * Required. Local inventory information of the product. If the product
+   * already has a `LocalInventory` resource for the same `storeCode`, full
+   * replacement of the `LocalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The localInventory. + */ + com.google.shopping.merchant.inventories.v1beta.LocalInventory getLocalInventory(); + /** + * + * + *
+   * Required. Local inventory information of the product. If the product
+   * already has a `LocalInventory` resource for the same `storeCode`, full
+   * replacement of the `LocalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder + getLocalInventoryOrBuilder(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertRegionalInventoryRequest.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertRegionalInventoryRequest.java new file mode 100644 index 000000000000..7dc001dfac3a --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertRegionalInventoryRequest.java @@ -0,0 +1,985 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Request message for the `InsertRegionalInventory` method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest} + */ +public final class InsertRegionalInventoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) + InsertRegionalInventoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use InsertRegionalInventoryRequest.newBuilder() to construct. + private InsertRegionalInventoryRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InsertRegionalInventoryRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InsertRegionalInventoryRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest.class, + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The account and product where this inventory will be inserted.
+   * Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The account and product where this inventory will be inserted.
+   * Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REGIONAL_INVENTORY_FIELD_NUMBER = 2; + private com.google.shopping.merchant.inventories.v1beta.RegionalInventory regionalInventory_; + /** + * + * + *
+   * Required. Regional inventory information to add to the product. If the
+   * product already has a `RegionalInventory` resource for the same `region`,
+   * full replacement of the `RegionalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the regionalInventory field is set. + */ + @java.lang.Override + public boolean hasRegionalInventory() { + return regionalInventory_ != null; + } + /** + * + * + *
+   * Required. Regional inventory information to add to the product. If the
+   * product already has a `RegionalInventory` resource for the same `region`,
+   * full replacement of the `RegionalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The regionalInventory. + */ + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory getRegionalInventory() { + return regionalInventory_ == null + ? com.google.shopping.merchant.inventories.v1beta.RegionalInventory.getDefaultInstance() + : regionalInventory_; + } + /** + * + * + *
+   * Required. Regional inventory information to add to the product. If the
+   * product already has a `RegionalInventory` resource for the same `region`,
+   * full replacement of the `RegionalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder + getRegionalInventoryOrBuilder() { + return regionalInventory_ == null + ? com.google.shopping.merchant.inventories.v1beta.RegionalInventory.getDefaultInstance() + : regionalInventory_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (regionalInventory_ != null) { + output.writeMessage(2, getRegionalInventory()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (regionalInventory_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRegionalInventory()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest other = + (com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasRegionalInventory() != other.hasRegionalInventory()) return false; + if (hasRegionalInventory()) { + if (!getRegionalInventory().equals(other.getRegionalInventory())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasRegionalInventory()) { + hash = (37 * hash) + REGIONAL_INVENTORY_FIELD_NUMBER; + hash = (53 * hash) + getRegionalInventory().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `InsertRegionalInventory` method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest.class, + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + regionalInventory_ = null; + if (regionalInventoryBuilder_ != null) { + regionalInventoryBuilder_.dispose(); + regionalInventoryBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest build() { + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + buildPartial() { + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest result = + new com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.regionalInventory_ = + regionalInventoryBuilder_ == null + ? regionalInventory_ + : regionalInventoryBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) { + return mergeFrom( + (com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasRegionalInventory()) { + mergeRegionalInventory(other.getRegionalInventory()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getRegionalInventoryFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The account and product where this inventory will be inserted.
+     * Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.shopping.merchant.inventories.v1beta.RegionalInventory regionalInventory_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder> + regionalInventoryBuilder_; + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the regionalInventory field is set. + */ + public boolean hasRegionalInventory() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The regionalInventory. + */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory + getRegionalInventory() { + if (regionalInventoryBuilder_ == null) { + return regionalInventory_ == null + ? com.google.shopping.merchant.inventories.v1beta.RegionalInventory.getDefaultInstance() + : regionalInventory_; + } else { + return regionalInventoryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory value) { + if (regionalInventoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + regionalInventory_ = value; + } else { + regionalInventoryBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder builderForValue) { + if (regionalInventoryBuilder_ == null) { + regionalInventory_ = builderForValue.build(); + } else { + regionalInventoryBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeRegionalInventory( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory value) { + if (regionalInventoryBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && regionalInventory_ != null + && regionalInventory_ + != com.google.shopping.merchant.inventories.v1beta.RegionalInventory + .getDefaultInstance()) { + getRegionalInventoryBuilder().mergeFrom(value); + } else { + regionalInventory_ = value; + } + } else { + regionalInventoryBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearRegionalInventory() { + bitField0_ = (bitField0_ & ~0x00000002); + regionalInventory_ = null; + if (regionalInventoryBuilder_ != null) { + regionalInventoryBuilder_.dispose(); + regionalInventoryBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder + getRegionalInventoryBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRegionalInventoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder + getRegionalInventoryOrBuilder() { + if (regionalInventoryBuilder_ != null) { + return regionalInventoryBuilder_.getMessageOrBuilder(); + } else { + return regionalInventory_ == null + ? com.google.shopping.merchant.inventories.v1beta.RegionalInventory.getDefaultInstance() + : regionalInventory_; + } + } + /** + * + * + *
+     * Required. Regional inventory information to add to the product. If the
+     * product already has a `RegionalInventory` resource for the same `region`,
+     * full replacement of the `RegionalInventory` resource is performed.
+     * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder> + getRegionalInventoryFieldBuilder() { + if (regionalInventoryBuilder_ == null) { + regionalInventoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder>( + getRegionalInventory(), getParentForChildren(), isClean()); + regionalInventory_ = null; + } + return regionalInventoryBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) + private static final com.google.shopping.merchant.inventories.v1beta + .InsertRegionalInventoryRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest(); + } + + public static com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InsertRegionalInventoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertRegionalInventoryRequestOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertRegionalInventoryRequestOrBuilder.java new file mode 100644 index 000000000000..1c219667a60e --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/InsertRegionalInventoryRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface InsertRegionalInventoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The account and product where this inventory will be inserted.
+   * Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The account and product where this inventory will be inserted.
+   * Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Regional inventory information to add to the product. If the
+   * product already has a `RegionalInventory` resource for the same `region`,
+   * full replacement of the `RegionalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the regionalInventory field is set. + */ + boolean hasRegionalInventory(); + /** + * + * + *
+   * Required. Regional inventory information to add to the product. If the
+   * product already has a `RegionalInventory` resource for the same `region`,
+   * full replacement of the `RegionalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The regionalInventory. + */ + com.google.shopping.merchant.inventories.v1beta.RegionalInventory getRegionalInventory(); + /** + * + * + *
+   * Required. Regional inventory information to add to the product. If the
+   * product already has a `RegionalInventory` resource for the same `region`,
+   * full replacement of the `RegionalInventory` resource is performed.
+   * 
+ * + * + * .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventory = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder + getRegionalInventoryOrBuilder(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesRequest.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesRequest.java new file mode 100644 index 000000000000..c7418ceecd49 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesRequest.java @@ -0,0 +1,995 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Request message for the `ListLocalInventories` method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest} + */ +public final class ListLocalInventoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) + ListLocalInventoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLocalInventoriesRequest.newBuilder() to construct. + private ListLocalInventoriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLocalInventoriesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLocalInventoriesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest.class, + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The `name` of the parent product to list local inventories for.
+   * Format:
+   * `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The `name` of the parent product to list local inventories for.
+   * Format:
+   * `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * The maximum number of `LocalInventory` resources for the given
+   * product to return. The service returns fewer than this value if the number
+   * of inventories for the given product is less that than the `pageSize`. The
+   * default value is 25000. The maximum value is 25000; If a value higher than
+   * the maximum is specified, then the `pageSize` will default to the maximum
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListLocalInventories` call.
+   * Provide the page token to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListLocalInventories`
+   * must match the call that provided the page token. The token returned as
+   * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+   * in the response to the previous request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListLocalInventories` call.
+   * Provide the page token to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListLocalInventories`
+   * must match the call that provided the page token. The token returned as
+   * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+   * in the response to the previous request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest other = + (com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ListLocalInventories` method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest.class, + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest build() { + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + buildPartial() { + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest result = + new com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) { + return mergeFrom( + (com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The `name` of the parent product to list local inventories for.
+     * Format:
+     * `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The `name` of the parent product to list local inventories for.
+     * Format:
+     * `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The `name` of the parent product to list local inventories for.
+     * Format:
+     * `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The `name` of the parent product to list local inventories for.
+     * Format:
+     * `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The `name` of the parent product to list local inventories for.
+     * Format:
+     * `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of `LocalInventory` resources for the given
+     * product to return. The service returns fewer than this value if the number
+     * of inventories for the given product is less that than the `pageSize`. The
+     * default value is 25000. The maximum value is 25000; If a value higher than
+     * the maximum is specified, then the `pageSize` will default to the maximum
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of `LocalInventory` resources for the given
+     * product to return. The service returns fewer than this value if the number
+     * of inventories for the given product is less that than the `pageSize`. The
+     * default value is 25000. The maximum value is 25000; If a value higher than
+     * the maximum is specified, then the `pageSize` will default to the maximum
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of `LocalInventory` resources for the given
+     * product to return. The service returns fewer than this value if the number
+     * of inventories for the given product is less that than the `pageSize`. The
+     * default value is 25000. The maximum value is 25000; If a value higher than
+     * the maximum is specified, then the `pageSize` will default to the maximum
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListLocalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLocalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListLocalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLocalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListLocalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLocalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListLocalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLocalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListLocalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListLocalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) + private static final com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest(); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLocalInventoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesRequestOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesRequestOrBuilder.java new file mode 100644 index 000000000000..690647509c74 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesRequestOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface ListLocalInventoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The `name` of the parent product to list local inventories for.
+   * Format:
+   * `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The `name` of the parent product to list local inventories for.
+   * Format:
+   * `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of `LocalInventory` resources for the given
+   * product to return. The service returns fewer than this value if the number
+   * of inventories for the given product is less that than the `pageSize`. The
+   * default value is 25000. The maximum value is 25000; If a value higher than
+   * the maximum is specified, then the `pageSize` will default to the maximum
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListLocalInventories` call.
+   * Provide the page token to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListLocalInventories`
+   * must match the call that provided the page token. The token returned as
+   * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+   * in the response to the previous request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListLocalInventories` call.
+   * Provide the page token to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListLocalInventories`
+   * must match the call that provided the page token. The token returned as
+   * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token]
+   * in the response to the previous request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesResponse.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesResponse.java new file mode 100644 index 000000000000..f0636f836bda --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesResponse.java @@ -0,0 +1,1245 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Response message for the `ListLocalInventories` method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse} + */ +public final class ListLocalInventoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse) + ListLocalInventoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListLocalInventoriesResponse.newBuilder() to construct. + private ListLocalInventoriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLocalInventoriesResponse() { + localInventories_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLocalInventoriesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.class, + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.Builder + .class); + } + + public static final int LOCAL_INVENTORIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + localInventories_; + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + @java.lang.Override + public java.util.List + getLocalInventoriesList() { + return localInventories_; + } + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder> + getLocalInventoriesOrBuilderList() { + return localInventories_; + } + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + @java.lang.Override + public int getLocalInventoriesCount() { + return localInventories_.size(); + } + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.LocalInventory getLocalInventories( + int index) { + return localInventories_.get(index); + } + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder + getLocalInventoriesOrBuilder(int index) { + return localInventories_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `pageToken` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `pageToken` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < localInventories_.size(); i++) { + output.writeMessage(1, localInventories_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < localInventories_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, localInventories_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse other = + (com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse) obj; + + if (!getLocalInventoriesList().equals(other.getLocalInventoriesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLocalInventoriesCount() > 0) { + hash = (37 * hash) + LOCAL_INVENTORIES_FIELD_NUMBER; + hash = (53 * hash) + getLocalInventoriesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the `ListLocalInventories` method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse) + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.class, + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (localInventoriesBuilder_ == null) { + localInventories_ = java.util.Collections.emptyList(); + } else { + localInventories_ = null; + localInventoriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse build() { + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + buildPartial() { + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse result = + new com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse result) { + if (localInventoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + localInventories_ = java.util.Collections.unmodifiableList(localInventories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.localInventories_ = localInventories_; + } else { + result.localInventories_ = localInventoriesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse) { + return mergeFrom( + (com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + .getDefaultInstance()) return this; + if (localInventoriesBuilder_ == null) { + if (!other.localInventories_.isEmpty()) { + if (localInventories_.isEmpty()) { + localInventories_ = other.localInventories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLocalInventoriesIsMutable(); + localInventories_.addAll(other.localInventories_); + } + onChanged(); + } + } else { + if (!other.localInventories_.isEmpty()) { + if (localInventoriesBuilder_.isEmpty()) { + localInventoriesBuilder_.dispose(); + localInventoriesBuilder_ = null; + localInventories_ = other.localInventories_; + bitField0_ = (bitField0_ & ~0x00000001); + localInventoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLocalInventoriesFieldBuilder() + : null; + } else { + localInventoriesBuilder_.addAllMessages(other.localInventories_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.shopping.merchant.inventories.v1beta.LocalInventory m = + input.readMessage( + com.google.shopping.merchant.inventories.v1beta.LocalInventory.parser(), + extensionRegistry); + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.add(m); + } else { + localInventoriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + localInventories_ = java.util.Collections.emptyList(); + + private void ensureLocalInventoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + localInventories_ = + new java.util.ArrayList( + localInventories_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.LocalInventory, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder> + localInventoriesBuilder_; + + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public java.util.List + getLocalInventoriesList() { + if (localInventoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(localInventories_); + } else { + return localInventoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public int getLocalInventoriesCount() { + if (localInventoriesBuilder_ == null) { + return localInventories_.size(); + } else { + return localInventoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventory getLocalInventories( + int index) { + if (localInventoriesBuilder_ == null) { + return localInventories_.get(index); + } else { + return localInventoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder setLocalInventories( + int index, com.google.shopping.merchant.inventories.v1beta.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.set(index, value); + onChanged(); + } else { + localInventoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder setLocalInventories( + int index, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.set(index, builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder addLocalInventories( + com.google.shopping.merchant.inventories.v1beta.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.add(value); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder addLocalInventories( + int index, com.google.shopping.merchant.inventories.v1beta.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.add(index, value); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder addLocalInventories( + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.add(builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder addLocalInventories( + int index, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.add(index, builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder addAllLocalInventories( + java.lang.Iterable + values) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, localInventories_); + onChanged(); + } else { + localInventoriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder clearLocalInventories() { + if (localInventoriesBuilder_ == null) { + localInventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + localInventoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public Builder removeLocalInventories(int index) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.remove(index); + onChanged(); + } else { + localInventoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder + getLocalInventoriesBuilder(int index) { + return getLocalInventoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder + getLocalInventoriesOrBuilder(int index) { + if (localInventoriesBuilder_ == null) { + return localInventories_.get(index); + } else { + return localInventoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder> + getLocalInventoriesOrBuilderList() { + if (localInventoriesBuilder_ != null) { + return localInventoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(localInventories_); + } + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder + addLocalInventoriesBuilder() { + return getLocalInventoriesFieldBuilder() + .addBuilder( + com.google.shopping.merchant.inventories.v1beta.LocalInventory.getDefaultInstance()); + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder + addLocalInventoriesBuilder(int index) { + return getLocalInventoriesFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.getDefaultInstance()); + } + /** + * + * + *
+     * The `LocalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + public java.util.List + getLocalInventoriesBuilderList() { + return getLocalInventoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.LocalInventory, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder> + getLocalInventoriesFieldBuilder() { + if (localInventoriesBuilder_ == null) { + localInventoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.LocalInventory, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder>( + localInventories_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + localInventories_ = null; + } + return localInventoriesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse) + private static final com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse(); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLocalInventoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesResponseOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesResponseOrBuilder.java new file mode 100644 index 000000000000..7a087bc55d59 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListLocalInventoriesResponseOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface ListLocalInventoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + java.util.List + getLocalInventoriesList(); + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + com.google.shopping.merchant.inventories.v1beta.LocalInventory getLocalInventories(int index); + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + int getLocalInventoriesCount(); + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + java.util.List + getLocalInventoriesOrBuilderList(); + /** + * + * + *
+   * The `LocalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.LocalInventory local_inventories = 1; + * + */ + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder + getLocalInventoriesOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `pageToken` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `pageToken` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesRequest.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesRequest.java new file mode 100644 index 000000000000..5e7b15efe468 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesRequest.java @@ -0,0 +1,993 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Request message for the `ListRegionalInventories` method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest} + */ +public final class ListRegionalInventoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) + ListRegionalInventoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRegionalInventoriesRequest.newBuilder() to construct. + private ListRegionalInventoriesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRegionalInventoriesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRegionalInventoriesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest.class, + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The `name` of the parent product to list `RegionalInventory`
+   * resources for. Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The `name` of the parent product to list `RegionalInventory`
+   * resources for. Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * The maximum number of `RegionalInventory` resources for the given product
+   * to return. The service returns fewer than this value if the number of
+   * inventories for the given product is less that than the `pageSize`. The
+   * default value is 25000. The maximum value is 100000; If a value higher than
+   * the maximum is specified, then the `pageSize` will default to the maximum.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListRegionalInventories` call.
+   * Provide the page token to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListRegionalInventories`
+   * must match the call that provided the page token. The token returned as
+   * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+   * in the response to the previous request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListRegionalInventories` call.
+   * Provide the page token to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListRegionalInventories`
+   * must match the call that provided the page token. The token returned as
+   * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+   * in the response to the previous request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest other = + (com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ListRegionalInventories` method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest.class, + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest.Builder + .class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest build() { + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + buildPartial() { + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest result = + new com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) { + return mergeFrom( + (com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The `name` of the parent product to list `RegionalInventory`
+     * resources for. Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The `name` of the parent product to list `RegionalInventory`
+     * resources for. Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The `name` of the parent product to list `RegionalInventory`
+     * resources for. Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The `name` of the parent product to list `RegionalInventory`
+     * resources for. Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The `name` of the parent product to list `RegionalInventory`
+     * resources for. Format: `accounts/{account}/products/{product}`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of `RegionalInventory` resources for the given product
+     * to return. The service returns fewer than this value if the number of
+     * inventories for the given product is less that than the `pageSize`. The
+     * default value is 25000. The maximum value is 100000; If a value higher than
+     * the maximum is specified, then the `pageSize` will default to the maximum.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of `RegionalInventory` resources for the given product
+     * to return. The service returns fewer than this value if the number of
+     * inventories for the given product is less that than the `pageSize`. The
+     * default value is 25000. The maximum value is 100000; If a value higher than
+     * the maximum is specified, then the `pageSize` will default to the maximum.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of `RegionalInventory` resources for the given product
+     * to return. The service returns fewer than this value if the number of
+     * inventories for the given product is less that than the `pageSize`. The
+     * default value is 25000. The maximum value is 100000; If a value higher than
+     * the maximum is specified, then the `pageSize` will default to the maximum.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListRegionalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListRegionalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListRegionalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListRegionalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListRegionalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListRegionalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListRegionalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListRegionalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListRegionalInventories` call.
+     * Provide the page token to retrieve the subsequent page.
+     *
+     * When paginating, all other parameters provided to `ListRegionalInventories`
+     * must match the call that provided the page token. The token returned as
+     * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+     * in the response to the previous request.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) + private static final com.google.shopping.merchant.inventories.v1beta + .ListRegionalInventoriesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest(); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRegionalInventoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesRequestOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesRequestOrBuilder.java new file mode 100644 index 000000000000..39af77f9bac6 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesRequestOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface ListRegionalInventoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The `name` of the parent product to list `RegionalInventory`
+   * resources for. Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The `name` of the parent product to list `RegionalInventory`
+   * resources for. Format: `accounts/{account}/products/{product}`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of `RegionalInventory` resources for the given product
+   * to return. The service returns fewer than this value if the number of
+   * inventories for the given product is less that than the `pageSize`. The
+   * default value is 25000. The maximum value is 100000; If a value higher than
+   * the maximum is specified, then the `pageSize` will default to the maximum.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListRegionalInventories` call.
+   * Provide the page token to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListRegionalInventories`
+   * must match the call that provided the page token. The token returned as
+   * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+   * in the response to the previous request.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListRegionalInventories` call.
+   * Provide the page token to retrieve the subsequent page.
+   *
+   * When paginating, all other parameters provided to `ListRegionalInventories`
+   * must match the call that provided the page token. The token returned as
+   * [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token]
+   * in the response to the previous request.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesResponse.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesResponse.java new file mode 100644 index 000000000000..ac99fea8ba28 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesResponse.java @@ -0,0 +1,1256 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Response message for the `ListRegionalInventories` method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse} + */ +public final class ListRegionalInventoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse) + ListRegionalInventoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRegionalInventoriesResponse.newBuilder() to construct. + private ListRegionalInventoriesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRegionalInventoriesResponse() { + regionalInventories_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRegionalInventoriesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.class, + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.Builder + .class); + } + + public static final int REGIONAL_INVENTORIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + regionalInventories_; + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + @java.lang.Override + public java.util.List + getRegionalInventoriesList() { + return regionalInventories_; + } + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder> + getRegionalInventoriesOrBuilderList() { + return regionalInventories_; + } + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + @java.lang.Override + public int getRegionalInventoriesCount() { + return regionalInventories_.size(); + } + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory getRegionalInventories( + int index) { + return regionalInventories_.get(index); + } + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder + getRegionalInventoriesOrBuilder(int index) { + return regionalInventories_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `pageToken` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `pageToken` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < regionalInventories_.size(); i++) { + output.writeMessage(1, regionalInventories_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < regionalInventories_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, regionalInventories_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse other = + (com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse) obj; + + if (!getRegionalInventoriesList().equals(other.getRegionalInventoriesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRegionalInventoriesCount() > 0) { + hash = (37 * hash) + REGIONAL_INVENTORIES_FIELD_NUMBER; + hash = (53 * hash) + getRegionalInventoriesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for the `ListRegionalInventories` method.
+   * 
+ * + * Protobuf type {@code + * google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse) + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.class, + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + .Builder.class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (regionalInventoriesBuilder_ == null) { + regionalInventories_ = java.util.Collections.emptyList(); + } else { + regionalInventories_ = null; + regionalInventoriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse build() { + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + buildPartial() { + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse result = + new com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse result) { + if (regionalInventoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + regionalInventories_ = java.util.Collections.unmodifiableList(regionalInventories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.regionalInventories_ = regionalInventories_; + } else { + result.regionalInventories_ = regionalInventoriesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse) { + return mergeFrom( + (com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + .getDefaultInstance()) return this; + if (regionalInventoriesBuilder_ == null) { + if (!other.regionalInventories_.isEmpty()) { + if (regionalInventories_.isEmpty()) { + regionalInventories_ = other.regionalInventories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRegionalInventoriesIsMutable(); + regionalInventories_.addAll(other.regionalInventories_); + } + onChanged(); + } + } else { + if (!other.regionalInventories_.isEmpty()) { + if (regionalInventoriesBuilder_.isEmpty()) { + regionalInventoriesBuilder_.dispose(); + regionalInventoriesBuilder_ = null; + regionalInventories_ = other.regionalInventories_; + bitField0_ = (bitField0_ & ~0x00000001); + regionalInventoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRegionalInventoriesFieldBuilder() + : null; + } else { + regionalInventoriesBuilder_.addAllMessages(other.regionalInventories_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.shopping.merchant.inventories.v1beta.RegionalInventory m = + input.readMessage( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.parser(), + extensionRegistry); + if (regionalInventoriesBuilder_ == null) { + ensureRegionalInventoriesIsMutable(); + regionalInventories_.add(m); + } else { + regionalInventoriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + regionalInventories_ = java.util.Collections.emptyList(); + + private void ensureRegionalInventoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + regionalInventories_ = + new java.util.ArrayList< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory>( + regionalInventories_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder> + regionalInventoriesBuilder_; + + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public java.util.List + getRegionalInventoriesList() { + if (regionalInventoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(regionalInventories_); + } else { + return regionalInventoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public int getRegionalInventoriesCount() { + if (regionalInventoriesBuilder_ == null) { + return regionalInventories_.size(); + } else { + return regionalInventoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory getRegionalInventories( + int index) { + if (regionalInventoriesBuilder_ == null) { + return regionalInventories_.get(index); + } else { + return regionalInventoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder setRegionalInventories( + int index, com.google.shopping.merchant.inventories.v1beta.RegionalInventory value) { + if (regionalInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionalInventoriesIsMutable(); + regionalInventories_.set(index, value); + onChanged(); + } else { + regionalInventoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder setRegionalInventories( + int index, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder builderForValue) { + if (regionalInventoriesBuilder_ == null) { + ensureRegionalInventoriesIsMutable(); + regionalInventories_.set(index, builderForValue.build()); + onChanged(); + } else { + regionalInventoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder addRegionalInventories( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory value) { + if (regionalInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionalInventoriesIsMutable(); + regionalInventories_.add(value); + onChanged(); + } else { + regionalInventoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder addRegionalInventories( + int index, com.google.shopping.merchant.inventories.v1beta.RegionalInventory value) { + if (regionalInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRegionalInventoriesIsMutable(); + regionalInventories_.add(index, value); + onChanged(); + } else { + regionalInventoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder addRegionalInventories( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder builderForValue) { + if (regionalInventoriesBuilder_ == null) { + ensureRegionalInventoriesIsMutable(); + regionalInventories_.add(builderForValue.build()); + onChanged(); + } else { + regionalInventoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder addRegionalInventories( + int index, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder builderForValue) { + if (regionalInventoriesBuilder_ == null) { + ensureRegionalInventoriesIsMutable(); + regionalInventories_.add(index, builderForValue.build()); + onChanged(); + } else { + regionalInventoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder addAllRegionalInventories( + java.lang.Iterable< + ? extends com.google.shopping.merchant.inventories.v1beta.RegionalInventory> + values) { + if (regionalInventoriesBuilder_ == null) { + ensureRegionalInventoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, regionalInventories_); + onChanged(); + } else { + regionalInventoriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder clearRegionalInventories() { + if (regionalInventoriesBuilder_ == null) { + regionalInventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + regionalInventoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public Builder removeRegionalInventories(int index) { + if (regionalInventoriesBuilder_ == null) { + ensureRegionalInventoriesIsMutable(); + regionalInventories_.remove(index); + onChanged(); + } else { + regionalInventoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder + getRegionalInventoriesBuilder(int index) { + return getRegionalInventoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder + getRegionalInventoriesOrBuilder(int index) { + if (regionalInventoriesBuilder_ == null) { + return regionalInventories_.get(index); + } else { + return regionalInventoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder> + getRegionalInventoriesOrBuilderList() { + if (regionalInventoriesBuilder_ != null) { + return regionalInventoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(regionalInventories_); + } + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder + addRegionalInventoriesBuilder() { + return getRegionalInventoriesFieldBuilder() + .addBuilder( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory + .getDefaultInstance()); + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder + addRegionalInventoriesBuilder(int index) { + return getRegionalInventoriesFieldBuilder() + .addBuilder( + index, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory + .getDefaultInstance()); + } + /** + * + * + *
+     * The `RegionalInventory` resources for the given product from the specified
+     * account.
+     * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + public java.util.List + getRegionalInventoriesBuilderList() { + return getRegionalInventoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder> + getRegionalInventoriesFieldBuilder() { + if (regionalInventoriesBuilder_ == null) { + regionalInventoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.inventories.v1beta.RegionalInventory, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder, + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder>( + regionalInventories_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + regionalInventories_ = null; + } + return regionalInventoriesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `pageToken` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse) + private static final com.google.shopping.merchant.inventories.v1beta + .ListRegionalInventoriesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse(); + } + + public static com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRegionalInventoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesResponseOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesResponseOrBuilder.java new file mode 100644 index 000000000000..d8e11bf1617c --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/ListRegionalInventoriesResponseOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface ListRegionalInventoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + java.util.List + getRegionalInventoriesList(); + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + com.google.shopping.merchant.inventories.v1beta.RegionalInventory getRegionalInventories( + int index); + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + int getRegionalInventoriesCount(); + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + java.util.List< + ? extends com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder> + getRegionalInventoriesOrBuilderList(); + /** + * + * + *
+   * The `RegionalInventory` resources for the given product from the specified
+   * account.
+   * 
+ * + * + * repeated .google.shopping.merchant.inventories.v1beta.RegionalInventory regional_inventories = 1; + * + */ + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder + getRegionalInventoriesOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `pageToken` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `pageToken` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventory.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventory.java new file mode 100644 index 000000000000..d9e58b84d1e5 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventory.java @@ -0,0 +1,3416 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Local inventory information for the product. Represents in-store information
+ * for a specific product at the store specified by
+ * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code].
+ * For a list of all accepted attribute values, see the [local product inventory
+ * feed specification](https://support.google.com/merchants/answer/3061342).
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.LocalInventory} + */ +public final class LocalInventory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.LocalInventory) + LocalInventoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use LocalInventory.newBuilder() to construct. + private LocalInventory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocalInventory() { + name_ = ""; + storeCode_ = ""; + availability_ = ""; + pickupMethod_ = ""; + pickupSla_ = ""; + instoreProductLocation_ = ""; + customAttributes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocalInventory(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.LocalInventory.class, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the `LocalInventory` resource.
+   * Format:
+   * `accounts/{account}/products/{product}/localInventories/{store_code}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the `LocalInventory` resource.
+   * Format:
+   * `accounts/{account}/products/{product}/localInventories/{store_code}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCOUNT_FIELD_NUMBER = 2; + private long account_ = 0L; + /** + * + * + *
+   * Output only. The account that owns the product. This field will be ignored
+   * if set by the client.
+   * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The account. + */ + @java.lang.Override + public long getAccount() { + return account_; + } + + public static final int STORE_CODE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object storeCode_ = ""; + /** + * + * + *
+   * Required. Store code (the store ID from your Business Profile) of the
+   * physical store the product is sold in. See the [Local product inventory
+   * feed specification](https://support.google.com/merchants/answer/3061342)
+   * for more information.
+   * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The storeCode. + */ + @java.lang.Override + public java.lang.String getStoreCode() { + java.lang.Object ref = storeCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeCode_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Store code (the store ID from your Business Profile) of the
+   * physical store the product is sold in. See the [Local product inventory
+   * feed specification](https://support.google.com/merchants/answer/3061342)
+   * for more information.
+   * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for storeCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStoreCodeBytes() { + java.lang.Object ref = storeCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + storeCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_FIELD_NUMBER = 4; + private com.google.shopping.type.Price price_; + /** + * + * + *
+   * Price of the product at this store.
+   * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return Whether the price field is set. + */ + @java.lang.Override + public boolean hasPrice() { + return price_ != null; + } + /** + * + * + *
+   * Price of the product at this store.
+   * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return The price. + */ + @java.lang.Override + public com.google.shopping.type.Price getPrice() { + return price_ == null ? com.google.shopping.type.Price.getDefaultInstance() : price_; + } + /** + * + * + *
+   * Price of the product at this store.
+   * 
+ * + * .google.shopping.type.Price price = 4; + */ + @java.lang.Override + public com.google.shopping.type.PriceOrBuilder getPriceOrBuilder() { + return price_ == null ? com.google.shopping.type.Price.getDefaultInstance() : price_; + } + + public static final int SALE_PRICE_FIELD_NUMBER = 5; + private com.google.shopping.type.Price salePrice_; + /** + * + * + *
+   * Sale price of the product at this store. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return Whether the salePrice field is set. + */ + @java.lang.Override + public boolean hasSalePrice() { + return salePrice_ != null; + } + /** + * + * + *
+   * Sale price of the product at this store. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return The salePrice. + */ + @java.lang.Override + public com.google.shopping.type.Price getSalePrice() { + return salePrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : salePrice_; + } + /** + * + * + *
+   * Sale price of the product at this store. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + @java.lang.Override + public com.google.shopping.type.PriceOrBuilder getSalePriceOrBuilder() { + return salePrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : salePrice_; + } + + public static final int SALE_PRICE_EFFECTIVE_DATE_FIELD_NUMBER = 6; + private com.google.type.Interval salePriceEffectiveDate_; + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale at this store.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return Whether the salePriceEffectiveDate field is set. + */ + @java.lang.Override + public boolean hasSalePriceEffectiveDate() { + return salePriceEffectiveDate_ != null; + } + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale at this store.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return The salePriceEffectiveDate. + */ + @java.lang.Override + public com.google.type.Interval getSalePriceEffectiveDate() { + return salePriceEffectiveDate_ == null + ? com.google.type.Interval.getDefaultInstance() + : salePriceEffectiveDate_; + } + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale at this store.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getSalePriceEffectiveDateOrBuilder() { + return salePriceEffectiveDate_ == null + ? com.google.type.Interval.getDefaultInstance() + : salePriceEffectiveDate_; + } + + public static final int AVAILABILITY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object availability_ = ""; + /** + * + * + *
+   * Availability of the product at this store.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return Whether the availability field is set. + */ + @java.lang.Override + public boolean hasAvailability() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Availability of the product at this store.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return The availability. + */ + @java.lang.Override + public java.lang.String getAvailability() { + java.lang.Object ref = availability_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availability_ = s; + return s; + } + } + /** + * + * + *
+   * Availability of the product at this store.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return The bytes for availability. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAvailabilityBytes() { + java.lang.Object ref = availability_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availability_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUANTITY_FIELD_NUMBER = 8; + private long quantity_ = 0L; + /** + * + * + *
+   * Quantity of the product available at this store. Must be greater than or
+   * equal to zero.
+   * 
+ * + * optional int64 quantity = 8; + * + * @return Whether the quantity field is set. + */ + @java.lang.Override + public boolean hasQuantity() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Quantity of the product available at this store. Must be greater than or
+   * equal to zero.
+   * 
+ * + * optional int64 quantity = 8; + * + * @return The quantity. + */ + @java.lang.Override + public long getQuantity() { + return quantity_; + } + + public static final int PICKUP_METHOD_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object pickupMethod_ = ""; + /** + * + * + *
+   * Supported pickup method for this product. Unless the value is `"not
+   * supported"`, this field must be submitted together with
+   * `pickupSla`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_method = 9; + * + * @return Whether the pickupMethod field is set. + */ + @java.lang.Override + public boolean hasPickupMethod() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Supported pickup method for this product. Unless the value is `"not
+   * supported"`, this field must be submitted together with
+   * `pickupSla`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_method = 9; + * + * @return The pickupMethod. + */ + @java.lang.Override + public java.lang.String getPickupMethod() { + java.lang.Object ref = pickupMethod_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pickupMethod_ = s; + return s; + } + } + /** + * + * + *
+   * Supported pickup method for this product. Unless the value is `"not
+   * supported"`, this field must be submitted together with
+   * `pickupSla`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_method = 9; + * + * @return The bytes for pickupMethod. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPickupMethodBytes() { + java.lang.Object ref = pickupMethod_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pickupMethod_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PICKUP_SLA_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object pickupSla_ = ""; + /** + * + * + *
+   * Relative time period from the order date for an order for this product,
+   * from this store, to be ready for pickup. Must be submitted with
+   * `pickupMethod`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_sla = 10; + * + * @return Whether the pickupSla field is set. + */ + @java.lang.Override + public boolean hasPickupSla() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Relative time period from the order date for an order for this product,
+   * from this store, to be ready for pickup. Must be submitted with
+   * `pickupMethod`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_sla = 10; + * + * @return The pickupSla. + */ + @java.lang.Override + public java.lang.String getPickupSla() { + java.lang.Object ref = pickupSla_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pickupSla_ = s; + return s; + } + } + /** + * + * + *
+   * Relative time period from the order date for an order for this product,
+   * from this store, to be ready for pickup. Must be submitted with
+   * `pickupMethod`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_sla = 10; + * + * @return The bytes for pickupSla. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPickupSlaBytes() { + java.lang.Object ref = pickupSla_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pickupSla_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTORE_PRODUCT_LOCATION_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object instoreProductLocation_ = ""; + /** + * + * + *
+   * Location of the product inside the store. Maximum length is 20 bytes.
+   * 
+ * + * optional string instore_product_location = 11; + * + * @return Whether the instoreProductLocation field is set. + */ + @java.lang.Override + public boolean hasInstoreProductLocation() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Location of the product inside the store. Maximum length is 20 bytes.
+   * 
+ * + * optional string instore_product_location = 11; + * + * @return The instoreProductLocation. + */ + @java.lang.Override + public java.lang.String getInstoreProductLocation() { + java.lang.Object ref = instoreProductLocation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instoreProductLocation_ = s; + return s; + } + } + /** + * + * + *
+   * Location of the product inside the store. Maximum length is 20 bytes.
+   * 
+ * + * optional string instore_product_location = 11; + * + * @return The bytes for instoreProductLocation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstoreProductLocationBytes() { + java.lang.Object ref = instoreProductLocation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instoreProductLocation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private java.util.List customAttributes_; + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + @java.lang.Override + public java.util.List getCustomAttributesList() { + return customAttributes_; + } + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + @java.lang.Override + public java.util.List + getCustomAttributesOrBuilderList() { + return customAttributes_; + } + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + @java.lang.Override + public int getCustomAttributesCount() { + return customAttributes_.size(); + } + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) { + return customAttributes_.get(index); + } + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index) { + return customAttributes_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (account_ != 0L) { + output.writeInt64(2, account_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storeCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, storeCode_); + } + if (price_ != null) { + output.writeMessage(4, getPrice()); + } + if (salePrice_ != null) { + output.writeMessage(5, getSalePrice()); + } + if (salePriceEffectiveDate_ != null) { + output.writeMessage(6, getSalePriceEffectiveDate()); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, availability_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(8, quantity_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, pickupMethod_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, pickupSla_); + } + if (((bitField0_ & 0x00000010) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, instoreProductLocation_); + } + for (int i = 0; i < customAttributes_.size(); i++) { + output.writeMessage(12, customAttributes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (account_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, account_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storeCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, storeCode_); + } + if (price_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPrice()); + } + if (salePrice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getSalePrice()); + } + if (salePriceEffectiveDate_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getSalePriceEffectiveDate()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, availability_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, quantity_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, pickupMethod_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, pickupSla_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, instoreProductLocation_); + } + for (int i = 0; i < customAttributes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(12, customAttributes_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.merchant.inventories.v1beta.LocalInventory)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.LocalInventory other = + (com.google.shopping.merchant.inventories.v1beta.LocalInventory) obj; + + if (!getName().equals(other.getName())) return false; + if (getAccount() != other.getAccount()) return false; + if (!getStoreCode().equals(other.getStoreCode())) return false; + if (hasPrice() != other.hasPrice()) return false; + if (hasPrice()) { + if (!getPrice().equals(other.getPrice())) return false; + } + if (hasSalePrice() != other.hasSalePrice()) return false; + if (hasSalePrice()) { + if (!getSalePrice().equals(other.getSalePrice())) return false; + } + if (hasSalePriceEffectiveDate() != other.hasSalePriceEffectiveDate()) return false; + if (hasSalePriceEffectiveDate()) { + if (!getSalePriceEffectiveDate().equals(other.getSalePriceEffectiveDate())) return false; + } + if (hasAvailability() != other.hasAvailability()) return false; + if (hasAvailability()) { + if (!getAvailability().equals(other.getAvailability())) return false; + } + if (hasQuantity() != other.hasQuantity()) return false; + if (hasQuantity()) { + if (getQuantity() != other.getQuantity()) return false; + } + if (hasPickupMethod() != other.hasPickupMethod()) return false; + if (hasPickupMethod()) { + if (!getPickupMethod().equals(other.getPickupMethod())) return false; + } + if (hasPickupSla() != other.hasPickupSla()) return false; + if (hasPickupSla()) { + if (!getPickupSla().equals(other.getPickupSla())) return false; + } + if (hasInstoreProductLocation() != other.hasInstoreProductLocation()) return false; + if (hasInstoreProductLocation()) { + if (!getInstoreProductLocation().equals(other.getInstoreProductLocation())) return false; + } + if (!getCustomAttributesList().equals(other.getCustomAttributesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAccount()); + hash = (37 * hash) + STORE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getStoreCode().hashCode(); + if (hasPrice()) { + hash = (37 * hash) + PRICE_FIELD_NUMBER; + hash = (53 * hash) + getPrice().hashCode(); + } + if (hasSalePrice()) { + hash = (37 * hash) + SALE_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getSalePrice().hashCode(); + } + if (hasSalePriceEffectiveDate()) { + hash = (37 * hash) + SALE_PRICE_EFFECTIVE_DATE_FIELD_NUMBER; + hash = (53 * hash) + getSalePriceEffectiveDate().hashCode(); + } + if (hasAvailability()) { + hash = (37 * hash) + AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + getAvailability().hashCode(); + } + if (hasQuantity()) { + hash = (37 * hash) + QUANTITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getQuantity()); + } + if (hasPickupMethod()) { + hash = (37 * hash) + PICKUP_METHOD_FIELD_NUMBER; + hash = (53 * hash) + getPickupMethod().hashCode(); + } + if (hasPickupSla()) { + hash = (37 * hash) + PICKUP_SLA_FIELD_NUMBER; + hash = (53 * hash) + getPickupSla().hashCode(); + } + if (hasInstoreProductLocation()) { + hash = (37 * hash) + INSTORE_PRODUCT_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getInstoreProductLocation().hashCode(); + } + if (getCustomAttributesCount() > 0) { + hash = (37 * hash) + CUSTOM_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getCustomAttributesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.LocalInventory prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Local inventory information for the product. Represents in-store information
+   * for a specific product at the store specified by
+   * [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code].
+   * For a list of all accepted attribute values, see the [local product inventory
+   * feed specification](https://support.google.com/merchants/answer/3061342).
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.LocalInventory} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.LocalInventory) + com.google.shopping.merchant.inventories.v1beta.LocalInventoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.LocalInventory.class, + com.google.shopping.merchant.inventories.v1beta.LocalInventory.Builder.class); + } + + // Construct using com.google.shopping.merchant.inventories.v1beta.LocalInventory.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + account_ = 0L; + storeCode_ = ""; + price_ = null; + if (priceBuilder_ != null) { + priceBuilder_.dispose(); + priceBuilder_ = null; + } + salePrice_ = null; + if (salePriceBuilder_ != null) { + salePriceBuilder_.dispose(); + salePriceBuilder_ = null; + } + salePriceEffectiveDate_ = null; + if (salePriceEffectiveDateBuilder_ != null) { + salePriceEffectiveDateBuilder_.dispose(); + salePriceEffectiveDateBuilder_ = null; + } + availability_ = ""; + quantity_ = 0L; + pickupMethod_ = ""; + pickupSla_ = ""; + instoreProductLocation_ = ""; + if (customAttributesBuilder_ == null) { + customAttributes_ = java.util.Collections.emptyList(); + } else { + customAttributes_ = null; + customAttributesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.LocalInventory + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.LocalInventory.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.LocalInventory build() { + com.google.shopping.merchant.inventories.v1beta.LocalInventory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.LocalInventory buildPartial() { + com.google.shopping.merchant.inventories.v1beta.LocalInventory result = + new com.google.shopping.merchant.inventories.v1beta.LocalInventory(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.inventories.v1beta.LocalInventory result) { + if (customAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + customAttributes_ = java.util.Collections.unmodifiableList(customAttributes_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.customAttributes_ = customAttributes_; + } else { + result.customAttributes_ = customAttributesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.LocalInventory result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.account_ = account_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.storeCode_ = storeCode_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.price_ = priceBuilder_ == null ? price_ : priceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.salePrice_ = salePriceBuilder_ == null ? salePrice_ : salePriceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.salePriceEffectiveDate_ = + salePriceEffectiveDateBuilder_ == null + ? salePriceEffectiveDate_ + : salePriceEffectiveDateBuilder_.build(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.availability_ = availability_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.quantity_ = quantity_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.pickupMethod_ = pickupMethod_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.pickupSla_ = pickupSla_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.instoreProductLocation_ = instoreProductLocation_; + to_bitField0_ |= 0x00000010; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.merchant.inventories.v1beta.LocalInventory) { + return mergeFrom((com.google.shopping.merchant.inventories.v1beta.LocalInventory) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.merchant.inventories.v1beta.LocalInventory other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.LocalInventory.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getAccount() != 0L) { + setAccount(other.getAccount()); + } + if (!other.getStoreCode().isEmpty()) { + storeCode_ = other.storeCode_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasPrice()) { + mergePrice(other.getPrice()); + } + if (other.hasSalePrice()) { + mergeSalePrice(other.getSalePrice()); + } + if (other.hasSalePriceEffectiveDate()) { + mergeSalePriceEffectiveDate(other.getSalePriceEffectiveDate()); + } + if (other.hasAvailability()) { + availability_ = other.availability_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasQuantity()) { + setQuantity(other.getQuantity()); + } + if (other.hasPickupMethod()) { + pickupMethod_ = other.pickupMethod_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasPickupSla()) { + pickupSla_ = other.pickupSla_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (other.hasInstoreProductLocation()) { + instoreProductLocation_ = other.instoreProductLocation_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (customAttributesBuilder_ == null) { + if (!other.customAttributes_.isEmpty()) { + if (customAttributes_.isEmpty()) { + customAttributes_ = other.customAttributes_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureCustomAttributesIsMutable(); + customAttributes_.addAll(other.customAttributes_); + } + onChanged(); + } + } else { + if (!other.customAttributes_.isEmpty()) { + if (customAttributesBuilder_.isEmpty()) { + customAttributesBuilder_.dispose(); + customAttributesBuilder_ = null; + customAttributes_ = other.customAttributes_; + bitField0_ = (bitField0_ & ~0x00000800); + customAttributesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCustomAttributesFieldBuilder() + : null; + } else { + customAttributesBuilder_.addAllMessages(other.customAttributes_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + account_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + storeCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getPriceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getSalePriceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + getSalePriceEffectiveDateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + availability_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + quantity_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 74: + { + pickupMethod_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + pickupSla_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + instoreProductLocation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + com.google.shopping.type.CustomAttribute m = + input.readMessage( + com.google.shopping.type.CustomAttribute.parser(), extensionRegistry); + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(m); + } else { + customAttributesBuilder_.addMessage(m); + } + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The name of the `LocalInventory` resource.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the `LocalInventory` resource.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the `LocalInventory` resource.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the `LocalInventory` resource.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the `LocalInventory` resource.
+     * Format:
+     * `accounts/{account}/products/{product}/localInventories/{store_code}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long account_; + /** + * + * + *
+     * Output only. The account that owns the product. This field will be ignored
+     * if set by the client.
+     * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The account. + */ + @java.lang.Override + public long getAccount() { + return account_; + } + /** + * + * + *
+     * Output only. The account that owns the product. This field will be ignored
+     * if set by the client.
+     * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The account to set. + * @return This builder for chaining. + */ + public Builder setAccount(long value) { + + account_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The account that owns the product. This field will be ignored
+     * if set by the client.
+     * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAccount() { + bitField0_ = (bitField0_ & ~0x00000002); + account_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object storeCode_ = ""; + /** + * + * + *
+     * Required. Store code (the store ID from your Business Profile) of the
+     * physical store the product is sold in. See the [Local product inventory
+     * feed specification](https://support.google.com/merchants/answer/3061342)
+     * for more information.
+     * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The storeCode. + */ + public java.lang.String getStoreCode() { + java.lang.Object ref = storeCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Store code (the store ID from your Business Profile) of the
+     * physical store the product is sold in. See the [Local product inventory
+     * feed specification](https://support.google.com/merchants/answer/3061342)
+     * for more information.
+     * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for storeCode. + */ + public com.google.protobuf.ByteString getStoreCodeBytes() { + java.lang.Object ref = storeCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + storeCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Store code (the store ID from your Business Profile) of the
+     * physical store the product is sold in. See the [Local product inventory
+     * feed specification](https://support.google.com/merchants/answer/3061342)
+     * for more information.
+     * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The storeCode to set. + * @return This builder for chaining. + */ + public Builder setStoreCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + storeCode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Store code (the store ID from your Business Profile) of the
+     * physical store the product is sold in. See the [Local product inventory
+     * feed specification](https://support.google.com/merchants/answer/3061342)
+     * for more information.
+     * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearStoreCode() { + storeCode_ = getDefaultInstance().getStoreCode(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Store code (the store ID from your Business Profile) of the
+     * physical store the product is sold in. See the [Local product inventory
+     * feed specification](https://support.google.com/merchants/answer/3061342)
+     * for more information.
+     * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for storeCode to set. + * @return This builder for chaining. + */ + public Builder setStoreCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + storeCode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.shopping.type.Price price_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + priceBuilder_; + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return Whether the price field is set. + */ + public boolean hasPrice() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return The price. + */ + public com.google.shopping.type.Price getPrice() { + if (priceBuilder_ == null) { + return price_ == null ? com.google.shopping.type.Price.getDefaultInstance() : price_; + } else { + return priceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public Builder setPrice(com.google.shopping.type.Price value) { + if (priceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + price_ = value; + } else { + priceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public Builder setPrice(com.google.shopping.type.Price.Builder builderForValue) { + if (priceBuilder_ == null) { + price_ = builderForValue.build(); + } else { + priceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public Builder mergePrice(com.google.shopping.type.Price value) { + if (priceBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && price_ != null + && price_ != com.google.shopping.type.Price.getDefaultInstance()) { + getPriceBuilder().mergeFrom(value); + } else { + price_ = value; + } + } else { + priceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public Builder clearPrice() { + bitField0_ = (bitField0_ & ~0x00000008); + price_ = null; + if (priceBuilder_ != null) { + priceBuilder_.dispose(); + priceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public com.google.shopping.type.Price.Builder getPriceBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public com.google.shopping.type.PriceOrBuilder getPriceOrBuilder() { + if (priceBuilder_ != null) { + return priceBuilder_.getMessageOrBuilder(); + } else { + return price_ == null ? com.google.shopping.type.Price.getDefaultInstance() : price_; + } + } + /** + * + * + *
+     * Price of the product at this store.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + getPriceFieldBuilder() { + if (priceBuilder_ == null) { + priceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder>( + getPrice(), getParentForChildren(), isClean()); + price_ = null; + } + return priceBuilder_; + } + + private com.google.shopping.type.Price salePrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + salePriceBuilder_; + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return Whether the salePrice field is set. + */ + public boolean hasSalePrice() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return The salePrice. + */ + public com.google.shopping.type.Price getSalePrice() { + if (salePriceBuilder_ == null) { + return salePrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : salePrice_; + } else { + return salePriceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public Builder setSalePrice(com.google.shopping.type.Price value) { + if (salePriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + salePrice_ = value; + } else { + salePriceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public Builder setSalePrice(com.google.shopping.type.Price.Builder builderForValue) { + if (salePriceBuilder_ == null) { + salePrice_ = builderForValue.build(); + } else { + salePriceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public Builder mergeSalePrice(com.google.shopping.type.Price value) { + if (salePriceBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && salePrice_ != null + && salePrice_ != com.google.shopping.type.Price.getDefaultInstance()) { + getSalePriceBuilder().mergeFrom(value); + } else { + salePrice_ = value; + } + } else { + salePriceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public Builder clearSalePrice() { + bitField0_ = (bitField0_ & ~0x00000010); + salePrice_ = null; + if (salePriceBuilder_ != null) { + salePriceBuilder_.dispose(); + salePriceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public com.google.shopping.type.Price.Builder getSalePriceBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getSalePriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public com.google.shopping.type.PriceOrBuilder getSalePriceOrBuilder() { + if (salePriceBuilder_ != null) { + return salePriceBuilder_.getMessageOrBuilder(); + } else { + return salePrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : salePrice_; + } + } + /** + * + * + *
+     * Sale price of the product at this store. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + getSalePriceFieldBuilder() { + if (salePriceBuilder_ == null) { + salePriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder>( + getSalePrice(), getParentForChildren(), isClean()); + salePrice_ = null; + } + return salePriceBuilder_; + } + + private com.google.type.Interval salePriceEffectiveDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + salePriceEffectiveDateBuilder_; + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return Whether the salePriceEffectiveDate field is set. + */ + public boolean hasSalePriceEffectiveDate() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return The salePriceEffectiveDate. + */ + public com.google.type.Interval getSalePriceEffectiveDate() { + if (salePriceEffectiveDateBuilder_ == null) { + return salePriceEffectiveDate_ == null + ? com.google.type.Interval.getDefaultInstance() + : salePriceEffectiveDate_; + } else { + return salePriceEffectiveDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public Builder setSalePriceEffectiveDate(com.google.type.Interval value) { + if (salePriceEffectiveDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + salePriceEffectiveDate_ = value; + } else { + salePriceEffectiveDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public Builder setSalePriceEffectiveDate(com.google.type.Interval.Builder builderForValue) { + if (salePriceEffectiveDateBuilder_ == null) { + salePriceEffectiveDate_ = builderForValue.build(); + } else { + salePriceEffectiveDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public Builder mergeSalePriceEffectiveDate(com.google.type.Interval value) { + if (salePriceEffectiveDateBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && salePriceEffectiveDate_ != null + && salePriceEffectiveDate_ != com.google.type.Interval.getDefaultInstance()) { + getSalePriceEffectiveDateBuilder().mergeFrom(value); + } else { + salePriceEffectiveDate_ = value; + } + } else { + salePriceEffectiveDateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public Builder clearSalePriceEffectiveDate() { + bitField0_ = (bitField0_ & ~0x00000020); + salePriceEffectiveDate_ = null; + if (salePriceEffectiveDateBuilder_ != null) { + salePriceEffectiveDateBuilder_.dispose(); + salePriceEffectiveDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public com.google.type.Interval.Builder getSalePriceEffectiveDateBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSalePriceEffectiveDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public com.google.type.IntervalOrBuilder getSalePriceEffectiveDateOrBuilder() { + if (salePriceEffectiveDateBuilder_ != null) { + return salePriceEffectiveDateBuilder_.getMessageOrBuilder(); + } else { + return salePriceEffectiveDate_ == null + ? com.google.type.Interval.getDefaultInstance() + : salePriceEffectiveDate_; + } + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale at this store.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + getSalePriceEffectiveDateFieldBuilder() { + if (salePriceEffectiveDateBuilder_ == null) { + salePriceEffectiveDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder>( + getSalePriceEffectiveDate(), getParentForChildren(), isClean()); + salePriceEffectiveDate_ = null; + } + return salePriceEffectiveDateBuilder_; + } + + private java.lang.Object availability_ = ""; + /** + * + * + *
+     * Availability of the product at this store.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @return Whether the availability field is set. + */ + public boolean hasAvailability() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Availability of the product at this store.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @return The availability. + */ + public java.lang.String getAvailability() { + java.lang.Object ref = availability_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availability_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Availability of the product at this store.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @return The bytes for availability. + */ + public com.google.protobuf.ByteString getAvailabilityBytes() { + java.lang.Object ref = availability_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availability_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Availability of the product at this store.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @param value The availability to set. + * @return This builder for chaining. + */ + public Builder setAvailability(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + availability_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Availability of the product at this store.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @return This builder for chaining. + */ + public Builder clearAvailability() { + availability_ = getDefaultInstance().getAvailability(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Availability of the product at this store.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @param value The bytes for availability to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + availability_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private long quantity_; + /** + * + * + *
+     * Quantity of the product available at this store. Must be greater than or
+     * equal to zero.
+     * 
+ * + * optional int64 quantity = 8; + * + * @return Whether the quantity field is set. + */ + @java.lang.Override + public boolean hasQuantity() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Quantity of the product available at this store. Must be greater than or
+     * equal to zero.
+     * 
+ * + * optional int64 quantity = 8; + * + * @return The quantity. + */ + @java.lang.Override + public long getQuantity() { + return quantity_; + } + /** + * + * + *
+     * Quantity of the product available at this store. Must be greater than or
+     * equal to zero.
+     * 
+ * + * optional int64 quantity = 8; + * + * @param value The quantity to set. + * @return This builder for chaining. + */ + public Builder setQuantity(long value) { + + quantity_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Quantity of the product available at this store. Must be greater than or
+     * equal to zero.
+     * 
+ * + * optional int64 quantity = 8; + * + * @return This builder for chaining. + */ + public Builder clearQuantity() { + bitField0_ = (bitField0_ & ~0x00000080); + quantity_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object pickupMethod_ = ""; + /** + * + * + *
+     * Supported pickup method for this product. Unless the value is `"not
+     * supported"`, this field must be submitted together with
+     * `pickupSla`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_method = 9; + * + * @return Whether the pickupMethod field is set. + */ + public boolean hasPickupMethod() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Supported pickup method for this product. Unless the value is `"not
+     * supported"`, this field must be submitted together with
+     * `pickupSla`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_method = 9; + * + * @return The pickupMethod. + */ + public java.lang.String getPickupMethod() { + java.lang.Object ref = pickupMethod_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pickupMethod_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Supported pickup method for this product. Unless the value is `"not
+     * supported"`, this field must be submitted together with
+     * `pickupSla`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_method = 9; + * + * @return The bytes for pickupMethod. + */ + public com.google.protobuf.ByteString getPickupMethodBytes() { + java.lang.Object ref = pickupMethod_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pickupMethod_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Supported pickup method for this product. Unless the value is `"not
+     * supported"`, this field must be submitted together with
+     * `pickupSla`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_method = 9; + * + * @param value The pickupMethod to set. + * @return This builder for chaining. + */ + public Builder setPickupMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pickupMethod_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Supported pickup method for this product. Unless the value is `"not
+     * supported"`, this field must be submitted together with
+     * `pickupSla`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_method = 9; + * + * @return This builder for chaining. + */ + public Builder clearPickupMethod() { + pickupMethod_ = getDefaultInstance().getPickupMethod(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * Supported pickup method for this product. Unless the value is `"not
+     * supported"`, this field must be submitted together with
+     * `pickupSla`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_method = 9; + * + * @param value The bytes for pickupMethod to set. + * @return This builder for chaining. + */ + public Builder setPickupMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pickupMethod_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object pickupSla_ = ""; + /** + * + * + *
+     * Relative time period from the order date for an order for this product,
+     * from this store, to be ready for pickup. Must be submitted with
+     * `pickupMethod`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_sla = 10; + * + * @return Whether the pickupSla field is set. + */ + public boolean hasPickupSla() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Relative time period from the order date for an order for this product,
+     * from this store, to be ready for pickup. Must be submitted with
+     * `pickupMethod`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_sla = 10; + * + * @return The pickupSla. + */ + public java.lang.String getPickupSla() { + java.lang.Object ref = pickupSla_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pickupSla_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Relative time period from the order date for an order for this product,
+     * from this store, to be ready for pickup. Must be submitted with
+     * `pickupMethod`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_sla = 10; + * + * @return The bytes for pickupSla. + */ + public com.google.protobuf.ByteString getPickupSlaBytes() { + java.lang.Object ref = pickupSla_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pickupSla_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Relative time period from the order date for an order for this product,
+     * from this store, to be ready for pickup. Must be submitted with
+     * `pickupMethod`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_sla = 10; + * + * @param value The pickupSla to set. + * @return This builder for chaining. + */ + public Builder setPickupSla(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pickupSla_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Relative time period from the order date for an order for this product,
+     * from this store, to be ready for pickup. Must be submitted with
+     * `pickupMethod`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_sla = 10; + * + * @return This builder for chaining. + */ + public Builder clearPickupSla() { + pickupSla_ = getDefaultInstance().getPickupSla(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * Relative time period from the order date for an order for this product,
+     * from this store, to be ready for pickup. Must be submitted with
+     * `pickupMethod`.
+     * For accepted attribute values, see the [local product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string pickup_sla = 10; + * + * @param value The bytes for pickupSla to set. + * @return This builder for chaining. + */ + public Builder setPickupSlaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pickupSla_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object instoreProductLocation_ = ""; + /** + * + * + *
+     * Location of the product inside the store. Maximum length is 20 bytes.
+     * 
+ * + * optional string instore_product_location = 11; + * + * @return Whether the instoreProductLocation field is set. + */ + public boolean hasInstoreProductLocation() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * + * + *
+     * Location of the product inside the store. Maximum length is 20 bytes.
+     * 
+ * + * optional string instore_product_location = 11; + * + * @return The instoreProductLocation. + */ + public java.lang.String getInstoreProductLocation() { + java.lang.Object ref = instoreProductLocation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instoreProductLocation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Location of the product inside the store. Maximum length is 20 bytes.
+     * 
+ * + * optional string instore_product_location = 11; + * + * @return The bytes for instoreProductLocation. + */ + public com.google.protobuf.ByteString getInstoreProductLocationBytes() { + java.lang.Object ref = instoreProductLocation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instoreProductLocation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Location of the product inside the store. Maximum length is 20 bytes.
+     * 
+ * + * optional string instore_product_location = 11; + * + * @param value The instoreProductLocation to set. + * @return This builder for chaining. + */ + public Builder setInstoreProductLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instoreProductLocation_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the product inside the store. Maximum length is 20 bytes.
+     * 
+ * + * optional string instore_product_location = 11; + * + * @return This builder for chaining. + */ + public Builder clearInstoreProductLocation() { + instoreProductLocation_ = getDefaultInstance().getInstoreProductLocation(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Location of the product inside the store. Maximum length is 20 bytes.
+     * 
+ * + * optional string instore_product_location = 11; + * + * @param value The bytes for instoreProductLocation to set. + * @return This builder for chaining. + */ + public Builder setInstoreProductLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instoreProductLocation_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.util.List customAttributes_ = + java.util.Collections.emptyList(); + + private void ensureCustomAttributesIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + customAttributes_ = + new java.util.ArrayList(customAttributes_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + customAttributesBuilder_; + + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public java.util.List getCustomAttributesList() { + if (customAttributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customAttributes_); + } else { + return customAttributesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public int getCustomAttributesCount() { + if (customAttributesBuilder_ == null) { + return customAttributes_.size(); + } else { + return customAttributesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) { + if (customAttributesBuilder_ == null) { + return customAttributes_.get(index); + } else { + return customAttributesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder setCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.set(index, value); + onChanged(); + } else { + customAttributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder setCustomAttributes( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.set(index, builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder addCustomAttributes(com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.add(value); + onChanged(); + } else { + customAttributesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder addCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.add(index, value); + onChanged(); + } else { + customAttributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder addCustomAttributes( + com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder addCustomAttributes( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(index, builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder addAllCustomAttributes( + java.lang.Iterable values) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customAttributes_); + onChanged(); + } else { + customAttributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder clearCustomAttributes() { + if (customAttributesBuilder_ == null) { + customAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + customAttributesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public Builder removeCustomAttributes(int index) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.remove(index); + onChanged(); + } else { + customAttributesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public com.google.shopping.type.CustomAttribute.Builder getCustomAttributesBuilder(int index) { + return getCustomAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder( + int index) { + if (customAttributesBuilder_ == null) { + return customAttributes_.get(index); + } else { + return customAttributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public java.util.List + getCustomAttributesOrBuilderList() { + if (customAttributesBuilder_ != null) { + return customAttributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customAttributes_); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder() { + return getCustomAttributesFieldBuilder() + .addBuilder(com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder(int index) { + return getCustomAttributesFieldBuilder() + .addBuilder(index, com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + public java.util.List + getCustomAttributesBuilderList() { + return getCustomAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + getCustomAttributesFieldBuilder() { + if (customAttributesBuilder_ == null) { + customAttributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder>( + customAttributes_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + customAttributes_ = null; + } + return customAttributesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.LocalInventory) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.LocalInventory) + private static final com.google.shopping.merchant.inventories.v1beta.LocalInventory + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.inventories.v1beta.LocalInventory(); + } + + public static com.google.shopping.merchant.inventories.v1beta.LocalInventory + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocalInventory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.LocalInventory + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryName.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryName.java new file mode 100644 index 000000000000..70673fc089f0 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocalInventoryName implements ResourceName { + private static final PathTemplate ACCOUNT_PRODUCT_STORE_CODE = + PathTemplate.createWithoutUrlEncoding( + "accounts/{account}/products/{product}/localInventories/{store_code}"); + private volatile Map fieldValuesMap; + private final String account; + private final String product; + private final String storeCode; + + @Deprecated + protected LocalInventoryName() { + account = null; + product = null; + storeCode = null; + } + + private LocalInventoryName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + product = Preconditions.checkNotNull(builder.getProduct()); + storeCode = Preconditions.checkNotNull(builder.getStoreCode()); + } + + public String getAccount() { + return account; + } + + public String getProduct() { + return product; + } + + public String getStoreCode() { + return storeCode; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocalInventoryName of(String account, String product, String storeCode) { + return newBuilder().setAccount(account).setProduct(product).setStoreCode(storeCode).build(); + } + + public static String format(String account, String product, String storeCode) { + return newBuilder() + .setAccount(account) + .setProduct(product) + .setStoreCode(storeCode) + .build() + .toString(); + } + + public static LocalInventoryName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_PRODUCT_STORE_CODE.validatedMatch( + formattedString, "LocalInventoryName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("product"), matchMap.get("store_code")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocalInventoryName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_PRODUCT_STORE_CODE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (account != null) { + fieldMapBuilder.put("account", account); + } + if (product != null) { + fieldMapBuilder.put("product", product); + } + if (storeCode != null) { + fieldMapBuilder.put("store_code", storeCode); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_PRODUCT_STORE_CODE.instantiate( + "account", account, "product", product, "store_code", storeCode); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocalInventoryName that = ((LocalInventoryName) o); + return Objects.equals(this.account, that.account) + && Objects.equals(this.product, that.product) + && Objects.equals(this.storeCode, that.storeCode); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(product); + h *= 1000003; + h ^= Objects.hashCode(storeCode); + return h; + } + + /** Builder for accounts/{account}/products/{product}/localInventories/{store_code}. */ + public static class Builder { + private String account; + private String product; + private String storeCode; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getProduct() { + return product; + } + + public String getStoreCode() { + return storeCode; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + public Builder setStoreCode(String storeCode) { + this.storeCode = storeCode; + return this; + } + + private Builder(LocalInventoryName localInventoryName) { + this.account = localInventoryName.account; + this.product = localInventoryName.product; + this.storeCode = localInventoryName.storeCode; + } + + public LocalInventoryName build() { + return new LocalInventoryName(this); + } + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryOrBuilder.java new file mode 100644 index 000000000000..b2b43234a82e --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryOrBuilder.java @@ -0,0 +1,480 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface LocalInventoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.LocalInventory) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the `LocalInventory` resource.
+   * Format:
+   * `accounts/{account}/products/{product}/localInventories/{store_code}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the `LocalInventory` resource.
+   * Format:
+   * `accounts/{account}/products/{product}/localInventories/{store_code}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The account that owns the product. This field will be ignored
+   * if set by the client.
+   * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The account. + */ + long getAccount(); + + /** + * + * + *
+   * Required. Store code (the store ID from your Business Profile) of the
+   * physical store the product is sold in. See the [Local product inventory
+   * feed specification](https://support.google.com/merchants/answer/3061342)
+   * for more information.
+   * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The storeCode. + */ + java.lang.String getStoreCode(); + /** + * + * + *
+   * Required. Store code (the store ID from your Business Profile) of the
+   * physical store the product is sold in. See the [Local product inventory
+   * feed specification](https://support.google.com/merchants/answer/3061342)
+   * for more information.
+   * 
+ * + * string store_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for storeCode. + */ + com.google.protobuf.ByteString getStoreCodeBytes(); + + /** + * + * + *
+   * Price of the product at this store.
+   * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return Whether the price field is set. + */ + boolean hasPrice(); + /** + * + * + *
+   * Price of the product at this store.
+   * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return The price. + */ + com.google.shopping.type.Price getPrice(); + /** + * + * + *
+   * Price of the product at this store.
+   * 
+ * + * .google.shopping.type.Price price = 4; + */ + com.google.shopping.type.PriceOrBuilder getPriceOrBuilder(); + + /** + * + * + *
+   * Sale price of the product at this store. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return Whether the salePrice field is set. + */ + boolean hasSalePrice(); + /** + * + * + *
+   * Sale price of the product at this store. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return The salePrice. + */ + com.google.shopping.type.Price getSalePrice(); + /** + * + * + *
+   * Sale price of the product at this store. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + com.google.shopping.type.PriceOrBuilder getSalePriceOrBuilder(); + + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale at this store.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return Whether the salePriceEffectiveDate field is set. + */ + boolean hasSalePriceEffectiveDate(); + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale at this store.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return The salePriceEffectiveDate. + */ + com.google.type.Interval getSalePriceEffectiveDate(); + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale at this store.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + com.google.type.IntervalOrBuilder getSalePriceEffectiveDateOrBuilder(); + + /** + * + * + *
+   * Availability of the product at this store.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return Whether the availability field is set. + */ + boolean hasAvailability(); + /** + * + * + *
+   * Availability of the product at this store.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return The availability. + */ + java.lang.String getAvailability(); + /** + * + * + *
+   * Availability of the product at this store.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return The bytes for availability. + */ + com.google.protobuf.ByteString getAvailabilityBytes(); + + /** + * + * + *
+   * Quantity of the product available at this store. Must be greater than or
+   * equal to zero.
+   * 
+ * + * optional int64 quantity = 8; + * + * @return Whether the quantity field is set. + */ + boolean hasQuantity(); + /** + * + * + *
+   * Quantity of the product available at this store. Must be greater than or
+   * equal to zero.
+   * 
+ * + * optional int64 quantity = 8; + * + * @return The quantity. + */ + long getQuantity(); + + /** + * + * + *
+   * Supported pickup method for this product. Unless the value is `"not
+   * supported"`, this field must be submitted together with
+   * `pickupSla`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_method = 9; + * + * @return Whether the pickupMethod field is set. + */ + boolean hasPickupMethod(); + /** + * + * + *
+   * Supported pickup method for this product. Unless the value is `"not
+   * supported"`, this field must be submitted together with
+   * `pickupSla`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_method = 9; + * + * @return The pickupMethod. + */ + java.lang.String getPickupMethod(); + /** + * + * + *
+   * Supported pickup method for this product. Unless the value is `"not
+   * supported"`, this field must be submitted together with
+   * `pickupSla`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_method = 9; + * + * @return The bytes for pickupMethod. + */ + com.google.protobuf.ByteString getPickupMethodBytes(); + + /** + * + * + *
+   * Relative time period from the order date for an order for this product,
+   * from this store, to be ready for pickup. Must be submitted with
+   * `pickupMethod`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_sla = 10; + * + * @return Whether the pickupSla field is set. + */ + boolean hasPickupSla(); + /** + * + * + *
+   * Relative time period from the order date for an order for this product,
+   * from this store, to be ready for pickup. Must be submitted with
+   * `pickupMethod`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_sla = 10; + * + * @return The pickupSla. + */ + java.lang.String getPickupSla(); + /** + * + * + *
+   * Relative time period from the order date for an order for this product,
+   * from this store, to be ready for pickup. Must be submitted with
+   * `pickupMethod`.
+   * For accepted attribute values, see the [local product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string pickup_sla = 10; + * + * @return The bytes for pickupSla. + */ + com.google.protobuf.ByteString getPickupSlaBytes(); + + /** + * + * + *
+   * Location of the product inside the store. Maximum length is 20 bytes.
+   * 
+ * + * optional string instore_product_location = 11; + * + * @return Whether the instoreProductLocation field is set. + */ + boolean hasInstoreProductLocation(); + /** + * + * + *
+   * Location of the product inside the store. Maximum length is 20 bytes.
+   * 
+ * + * optional string instore_product_location = 11; + * + * @return The instoreProductLocation. + */ + java.lang.String getInstoreProductLocation(); + /** + * + * + *
+   * Location of the product inside the store. Maximum length is 20 bytes.
+   * 
+ * + * optional string instore_product_location = 11; + * + * @return The bytes for instoreProductLocation. + */ + com.google.protobuf.ByteString getInstoreProductLocationBytes(); + + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + java.util.List getCustomAttributesList(); + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + com.google.shopping.type.CustomAttribute getCustomAttributes(int index); + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + int getCustomAttributesCount(); + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + java.util.List + getCustomAttributesOrBuilderList(); + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 12; + */ + com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryProto.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryProto.java new file mode 100644 index 000000000000..1a5429a29c87 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/LocalInventoryProto.java @@ -0,0 +1,211 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/localinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public final class LocalInventoryProto { + private LocalInventoryProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n@google/shopping/merchant/inventories/v" + + "1beta/localinventory.proto\022+google.shopp" + + "ing.merchant.inventories.v1beta\032\034google/" + + "api/annotations.proto\032\027google/api/client" + + ".proto\032\037google/api/field_behavior.proto\032" + + "\031google/api/resource.proto\032\033google/proto" + + "buf/empty.proto\032 google/shopping/type/ty" + + "pes.proto\032\032google/type/interval.proto\"\215\005" + + "\n\016LocalInventory\022\022\n\004name\030\001 \001(\tB\004\342A\001\003\022\025\n\007" + + "account\030\002 \001(\003B\004\342A\001\003\022\030\n\nstore_code\030\003 \001(\tB" + + "\004\342A\001\002\022*\n\005price\030\004 \001(\0132\033.google.shopping.t" + + "ype.Price\022/\n\nsale_price\030\005 \001(\0132\033.google.s" + + "hopping.type.Price\0228\n\031sale_price_effecti" + + "ve_date\030\006 \001(\0132\025.google.type.Interval\022\031\n\014" + + "availability\030\007 \001(\tH\000\210\001\001\022\025\n\010quantity\030\010 \001(" + + "\003H\001\210\001\001\022\032\n\rpickup_method\030\t \001(\tH\002\210\001\001\022\027\n\npi" + + "ckup_sla\030\n \001(\tH\003\210\001\001\022%\n\030instore_product_l" + + "ocation\030\013 \001(\tH\004\210\001\001\022@\n\021custom_attributes\030" + + "\014 \003(\0132%.google.shopping.type.CustomAttri" + + "bute:s\352Ap\n)merchantapi.googleapis.com/Lo" + + "calInventory\022Caccounts/{account}/product" + + "s/{product}/localInventories/{store_code" + + "}B\017\n\r_availabilityB\013\n\t_quantityB\020\n\016_pick" + + "up_methodB\r\n\013_pickup_slaB\033\n\031_instore_pro" + + "duct_location\"Z\n\033ListLocalInventoriesReq" + + "uest\022\024\n\006parent\030\001 \001(\tB\004\342A\001\002\022\021\n\tpage_size\030" + + "\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"\217\001\n\034ListLocalI" + + "nventoriesResponse\022V\n\021local_inventories\030" + + "\001 \003(\0132;.google.shopping.merchant.invento" + + "ries.v1beta.LocalInventory\022\027\n\017next_page_" + + "token\030\002 \001(\t\"\217\001\n\033InsertLocalInventoryRequ" + + "est\022\024\n\006parent\030\001 \001(\tB\004\342A\001\002\022Z\n\017local_inven" + + "tory\030\002 \001(\0132;.google.shopping.merchant.in" + + "ventories.v1beta.LocalInventoryB\004\342A\001\002\"_\n" + + "\033DeleteLocalInventoryRequest\022@\n\004name\030\001 \001" + + "(\tB2\342A\001\002\372A+\n)merchantapi.googleapis.com/" + + "LocalInventory2\270\006\n\025LocalInventoryService" + + "\022\201\002\n\024ListLocalInventories\022H.google.shopp" + + "ing.merchant.inventories.v1beta.ListLoca" + + "lInventoriesRequest\032I.google.shopping.me" + + "rchant.inventories.v1beta.ListLocalInven" + + "toriesResponse\"T\332A\006parent\202\323\344\223\002E\022C/invent" + + "ories/v1beta/{parent=accounts/*/products" + + "/*}/localInventories\022\202\002\n\024InsertLocalInve" + + "ntory\022H.google.shopping.merchant.invento" + + "ries.v1beta.InsertLocalInventoryRequest\032" + + ";.google.shopping.merchant.inventories.v" + + "1beta.LocalInventory\"c\202\323\344\223\002]\"J/inventori" + + "es/v1beta/{parent=accounts/*/products/*}" + + "/localInventories:insert:\017local_inventor" + + "y\022\314\001\n\024DeleteLocalInventory\022H.google.shop" + + "ping.merchant.inventories.v1beta.DeleteL" + + "ocalInventoryRequest\032\026.google.protobuf.E" + + "mpty\"R\332A\004name\202\323\344\223\002E*C/inventories/v1beta" + + "/{name=accounts/*/products/*/localInvent" + + "ories/*}\032G\312A\032merchantapi.googleapis.com\322" + + "A\'https://www.googleapis.com/auth/conten" + + "tB\240\001\n/com.google.shopping.merchant.inven" + + "tories.v1betaB\023LocalInventoryProtoP\001ZVgo" + + "ogle.golang.org/genproto/googleapis/shop" + + "ping/merchant/inventories/v1beta;invento" + + "riesb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.shopping.type.TypesProto.getDescriptor(), + com.google.type.IntervalProto.getDescriptor(), + }); + internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_LocalInventory_descriptor, + new java.lang.String[] { + "Name", + "Account", + "StoreCode", + "Price", + "SalePrice", + "SalePriceEffectiveDate", + "Availability", + "Quantity", + "PickupMethod", + "PickupSla", + "InstoreProductLocation", + "CustomAttributes", + "Availability", + "Quantity", + "PickupMethod", + "PickupSla", + "InstoreProductLocation", + }); + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_ListLocalInventoriesResponse_descriptor, + new java.lang.String[] { + "LocalInventories", "NextPageToken", + }); + internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_InsertLocalInventoryRequest_descriptor, + new java.lang.String[] { + "Parent", "LocalInventory", + }); + internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_DeleteLocalInventoryRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.shopping.type.TypesProto.getDescriptor(); + com.google.type.IntervalProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventory.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventory.java new file mode 100644 index 000000000000..ed69dccf4152 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventory.java @@ -0,0 +1,2562 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +/** + * + * + *
+ * Regional inventory information for the product. Represents specific
+ * information like price and availability for a given product in a specific
+ * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region].
+ * For a list of all accepted attribute values, see the [regional product
+ * inventory feed
+ * specification](https://support.google.com/merchants/answer/9698880).
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.RegionalInventory} + */ +public final class RegionalInventory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.inventories.v1beta.RegionalInventory) + RegionalInventoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use RegionalInventory.newBuilder() to construct. + private RegionalInventory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RegionalInventory() { + name_ = ""; + region_ = ""; + availability_ = ""; + customAttributes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RegionalInventory(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.class, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the `RegionalInventory` resource.
+   * Format:
+   * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the `RegionalInventory` resource.
+   * Format:
+   * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACCOUNT_FIELD_NUMBER = 2; + private long account_ = 0L; + /** + * + * + *
+   * Output only. The account that owns the product. This field will be ignored
+   * if set by the client.
+   * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The account. + */ + @java.lang.Override + public long getAccount() { + return account_; + } + + public static final int REGION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object region_ = ""; + /** + * + * + *
+   * Required. ID of the region for this
+   * `RegionalInventory` resource. See the [Regional availability and
+   * pricing](https://support.google.com/merchants/answer/9698880) for more
+   * details.
+   * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The region. + */ + @java.lang.Override + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the region for this
+   * `RegionalInventory` resource. See the [Regional availability and
+   * pricing](https://support.google.com/merchants/answer/9698880) for more
+   * details.
+   * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for region. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PRICE_FIELD_NUMBER = 4; + private com.google.shopping.type.Price price_; + /** + * + * + *
+   * Price of the product in this region.
+   * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return Whether the price field is set. + */ + @java.lang.Override + public boolean hasPrice() { + return price_ != null; + } + /** + * + * + *
+   * Price of the product in this region.
+   * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return The price. + */ + @java.lang.Override + public com.google.shopping.type.Price getPrice() { + return price_ == null ? com.google.shopping.type.Price.getDefaultInstance() : price_; + } + /** + * + * + *
+   * Price of the product in this region.
+   * 
+ * + * .google.shopping.type.Price price = 4; + */ + @java.lang.Override + public com.google.shopping.type.PriceOrBuilder getPriceOrBuilder() { + return price_ == null ? com.google.shopping.type.Price.getDefaultInstance() : price_; + } + + public static final int SALE_PRICE_FIELD_NUMBER = 5; + private com.google.shopping.type.Price salePrice_; + /** + * + * + *
+   * Sale price of the product in this region. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return Whether the salePrice field is set. + */ + @java.lang.Override + public boolean hasSalePrice() { + return salePrice_ != null; + } + /** + * + * + *
+   * Sale price of the product in this region. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return The salePrice. + */ + @java.lang.Override + public com.google.shopping.type.Price getSalePrice() { + return salePrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : salePrice_; + } + /** + * + * + *
+   * Sale price of the product in this region. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + @java.lang.Override + public com.google.shopping.type.PriceOrBuilder getSalePriceOrBuilder() { + return salePrice_ == null ? com.google.shopping.type.Price.getDefaultInstance() : salePrice_; + } + + public static final int SALE_PRICE_EFFECTIVE_DATE_FIELD_NUMBER = 6; + private com.google.type.Interval salePriceEffectiveDate_; + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale price in this region.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return Whether the salePriceEffectiveDate field is set. + */ + @java.lang.Override + public boolean hasSalePriceEffectiveDate() { + return salePriceEffectiveDate_ != null; + } + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale price in this region.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return The salePriceEffectiveDate. + */ + @java.lang.Override + public com.google.type.Interval getSalePriceEffectiveDate() { + return salePriceEffectiveDate_ == null + ? com.google.type.Interval.getDefaultInstance() + : salePriceEffectiveDate_; + } + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale price in this region.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getSalePriceEffectiveDateOrBuilder() { + return salePriceEffectiveDate_ == null + ? com.google.type.Interval.getDefaultInstance() + : salePriceEffectiveDate_; + } + + public static final int AVAILABILITY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object availability_ = ""; + /** + * + * + *
+   * Availability of the product in this region.
+   * For accepted attribute values, see the [regional product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return Whether the availability field is set. + */ + @java.lang.Override + public boolean hasAvailability() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Availability of the product in this region.
+   * For accepted attribute values, see the [regional product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return The availability. + */ + @java.lang.Override + public java.lang.String getAvailability() { + java.lang.Object ref = availability_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availability_ = s; + return s; + } + } + /** + * + * + *
+   * Availability of the product in this region.
+   * For accepted attribute values, see the [regional product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return The bytes for availability. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAvailabilityBytes() { + java.lang.Object ref = availability_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availability_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private java.util.List customAttributes_; + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public java.util.List getCustomAttributesList() { + return customAttributes_; + } + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public java.util.List + getCustomAttributesOrBuilderList() { + return customAttributes_; + } + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public int getCustomAttributesCount() { + return customAttributes_.size(); + } + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) { + return customAttributes_.get(index); + } + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index) { + return customAttributes_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (account_ != 0L) { + output.writeInt64(2, account_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(region_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, region_); + } + if (price_ != null) { + output.writeMessage(4, getPrice()); + } + if (salePrice_ != null) { + output.writeMessage(5, getSalePrice()); + } + if (salePriceEffectiveDate_ != null) { + output.writeMessage(6, getSalePriceEffectiveDate()); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, availability_); + } + for (int i = 0; i < customAttributes_.size(); i++) { + output.writeMessage(8, customAttributes_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (account_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, account_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(region_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, region_); + } + if (price_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPrice()); + } + if (salePrice_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getSalePrice()); + } + if (salePriceEffectiveDate_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(6, getSalePriceEffectiveDate()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, availability_); + } + for (int i = 0; i < customAttributes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, customAttributes_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.merchant.inventories.v1beta.RegionalInventory)) { + return super.equals(obj); + } + com.google.shopping.merchant.inventories.v1beta.RegionalInventory other = + (com.google.shopping.merchant.inventories.v1beta.RegionalInventory) obj; + + if (!getName().equals(other.getName())) return false; + if (getAccount() != other.getAccount()) return false; + if (!getRegion().equals(other.getRegion())) return false; + if (hasPrice() != other.hasPrice()) return false; + if (hasPrice()) { + if (!getPrice().equals(other.getPrice())) return false; + } + if (hasSalePrice() != other.hasSalePrice()) return false; + if (hasSalePrice()) { + if (!getSalePrice().equals(other.getSalePrice())) return false; + } + if (hasSalePriceEffectiveDate() != other.hasSalePriceEffectiveDate()) return false; + if (hasSalePriceEffectiveDate()) { + if (!getSalePriceEffectiveDate().equals(other.getSalePriceEffectiveDate())) return false; + } + if (hasAvailability() != other.hasAvailability()) return false; + if (hasAvailability()) { + if (!getAvailability().equals(other.getAvailability())) return false; + } + if (!getCustomAttributesList().equals(other.getCustomAttributesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAccount()); + hash = (37 * hash) + REGION_FIELD_NUMBER; + hash = (53 * hash) + getRegion().hashCode(); + if (hasPrice()) { + hash = (37 * hash) + PRICE_FIELD_NUMBER; + hash = (53 * hash) + getPrice().hashCode(); + } + if (hasSalePrice()) { + hash = (37 * hash) + SALE_PRICE_FIELD_NUMBER; + hash = (53 * hash) + getSalePrice().hashCode(); + } + if (hasSalePriceEffectiveDate()) { + hash = (37 * hash) + SALE_PRICE_EFFECTIVE_DATE_FIELD_NUMBER; + hash = (53 * hash) + getSalePriceEffectiveDate().hashCode(); + } + if (hasAvailability()) { + hash = (37 * hash) + AVAILABILITY_FIELD_NUMBER; + hash = (53 * hash) + getAvailability().hashCode(); + } + if (getCustomAttributesCount() > 0) { + hash = (37 * hash) + CUSTOM_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getCustomAttributesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Regional inventory information for the product. Represents specific
+   * information like price and availability for a given product in a specific
+   * [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region].
+   * For a list of all accepted attribute values, see the [regional product
+   * inventory feed
+   * specification](https://support.google.com/merchants/answer/9698880).
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.inventories.v1beta.RegionalInventory} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.inventories.v1beta.RegionalInventory) + com.google.shopping.merchant.inventories.v1beta.RegionalInventoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.class, + com.google.shopping.merchant.inventories.v1beta.RegionalInventory.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.inventories.v1beta.RegionalInventory.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + account_ = 0L; + region_ = ""; + price_ = null; + if (priceBuilder_ != null) { + priceBuilder_.dispose(); + priceBuilder_ = null; + } + salePrice_ = null; + if (salePriceBuilder_ != null) { + salePriceBuilder_.dispose(); + salePriceBuilder_ = null; + } + salePriceEffectiveDate_ = null; + if (salePriceEffectiveDateBuilder_ != null) { + salePriceEffectiveDateBuilder_.dispose(); + salePriceEffectiveDateBuilder_ = null; + } + availability_ = ""; + if (customAttributesBuilder_ == null) { + customAttributes_ = java.util.Collections.emptyList(); + } else { + customAttributes_ = null; + customAttributesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000080); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventoryProto + .internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory + getDefaultInstanceForType() { + return com.google.shopping.merchant.inventories.v1beta.RegionalInventory.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory build() { + com.google.shopping.merchant.inventories.v1beta.RegionalInventory result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory buildPartial() { + com.google.shopping.merchant.inventories.v1beta.RegionalInventory result = + new com.google.shopping.merchant.inventories.v1beta.RegionalInventory(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory result) { + if (customAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0)) { + customAttributes_ = java.util.Collections.unmodifiableList(customAttributes_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.customAttributes_ = customAttributes_; + } else { + result.customAttributes_ = customAttributesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.account_ = account_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.region_ = region_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.price_ = priceBuilder_ == null ? price_ : priceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.salePrice_ = salePriceBuilder_ == null ? salePrice_ : salePriceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.salePriceEffectiveDate_ = + salePriceEffectiveDateBuilder_ == null + ? salePriceEffectiveDate_ + : salePriceEffectiveDateBuilder_.build(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.availability_ = availability_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.merchant.inventories.v1beta.RegionalInventory) { + return mergeFrom((com.google.shopping.merchant.inventories.v1beta.RegionalInventory) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.inventories.v1beta.RegionalInventory other) { + if (other + == com.google.shopping.merchant.inventories.v1beta.RegionalInventory.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getAccount() != 0L) { + setAccount(other.getAccount()); + } + if (!other.getRegion().isEmpty()) { + region_ = other.region_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasPrice()) { + mergePrice(other.getPrice()); + } + if (other.hasSalePrice()) { + mergeSalePrice(other.getSalePrice()); + } + if (other.hasSalePriceEffectiveDate()) { + mergeSalePriceEffectiveDate(other.getSalePriceEffectiveDate()); + } + if (other.hasAvailability()) { + availability_ = other.availability_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (customAttributesBuilder_ == null) { + if (!other.customAttributes_.isEmpty()) { + if (customAttributes_.isEmpty()) { + customAttributes_ = other.customAttributes_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureCustomAttributesIsMutable(); + customAttributes_.addAll(other.customAttributes_); + } + onChanged(); + } + } else { + if (!other.customAttributes_.isEmpty()) { + if (customAttributesBuilder_.isEmpty()) { + customAttributesBuilder_.dispose(); + customAttributesBuilder_ = null; + customAttributes_ = other.customAttributes_; + bitField0_ = (bitField0_ & ~0x00000080); + customAttributesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCustomAttributesFieldBuilder() + : null; + } else { + customAttributesBuilder_.addAllMessages(other.customAttributes_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + account_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + region_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getPriceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getSalePriceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage( + getSalePriceEffectiveDateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + availability_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + com.google.shopping.type.CustomAttribute m = + input.readMessage( + com.google.shopping.type.CustomAttribute.parser(), extensionRegistry); + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(m); + } else { + customAttributesBuilder_.addMessage(m); + } + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The name of the `RegionalInventory` resource.
+     * Format:
+     * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the `RegionalInventory` resource.
+     * Format:
+     * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the `RegionalInventory` resource.
+     * Format:
+     * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the `RegionalInventory` resource.
+     * Format:
+     * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the `RegionalInventory` resource.
+     * Format:
+     * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long account_; + /** + * + * + *
+     * Output only. The account that owns the product. This field will be ignored
+     * if set by the client.
+     * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The account. + */ + @java.lang.Override + public long getAccount() { + return account_; + } + /** + * + * + *
+     * Output only. The account that owns the product. This field will be ignored
+     * if set by the client.
+     * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The account to set. + * @return This builder for chaining. + */ + public Builder setAccount(long value) { + + account_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The account that owns the product. This field will be ignored
+     * if set by the client.
+     * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAccount() { + bitField0_ = (bitField0_ & ~0x00000002); + account_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object region_ = ""; + /** + * + * + *
+     * Required. ID of the region for this
+     * `RegionalInventory` resource. See the [Regional availability and
+     * pricing](https://support.google.com/merchants/answer/9698880) for more
+     * details.
+     * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The region. + */ + public java.lang.String getRegion() { + java.lang.Object ref = region_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + region_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the region for this
+     * `RegionalInventory` resource. See the [Regional availability and
+     * pricing](https://support.google.com/merchants/answer/9698880) for more
+     * details.
+     * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for region. + */ + public com.google.protobuf.ByteString getRegionBytes() { + java.lang.Object ref = region_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + region_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the region for this
+     * `RegionalInventory` resource. See the [Regional availability and
+     * pricing](https://support.google.com/merchants/answer/9698880) for more
+     * details.
+     * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The region to set. + * @return This builder for chaining. + */ + public Builder setRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + region_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the region for this
+     * `RegionalInventory` resource. See the [Regional availability and
+     * pricing](https://support.google.com/merchants/answer/9698880) for more
+     * details.
+     * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRegion() { + region_ = getDefaultInstance().getRegion(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the region for this
+     * `RegionalInventory` resource. See the [Regional availability and
+     * pricing](https://support.google.com/merchants/answer/9698880) for more
+     * details.
+     * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for region to set. + * @return This builder for chaining. + */ + public Builder setRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + region_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.shopping.type.Price price_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + priceBuilder_; + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return Whether the price field is set. + */ + public boolean hasPrice() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return The price. + */ + public com.google.shopping.type.Price getPrice() { + if (priceBuilder_ == null) { + return price_ == null ? com.google.shopping.type.Price.getDefaultInstance() : price_; + } else { + return priceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public Builder setPrice(com.google.shopping.type.Price value) { + if (priceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + price_ = value; + } else { + priceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public Builder setPrice(com.google.shopping.type.Price.Builder builderForValue) { + if (priceBuilder_ == null) { + price_ = builderForValue.build(); + } else { + priceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public Builder mergePrice(com.google.shopping.type.Price value) { + if (priceBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && price_ != null + && price_ != com.google.shopping.type.Price.getDefaultInstance()) { + getPriceBuilder().mergeFrom(value); + } else { + price_ = value; + } + } else { + priceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public Builder clearPrice() { + bitField0_ = (bitField0_ & ~0x00000008); + price_ = null; + if (priceBuilder_ != null) { + priceBuilder_.dispose(); + priceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public com.google.shopping.type.Price.Builder getPriceBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getPriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + public com.google.shopping.type.PriceOrBuilder getPriceOrBuilder() { + if (priceBuilder_ != null) { + return priceBuilder_.getMessageOrBuilder(); + } else { + return price_ == null ? com.google.shopping.type.Price.getDefaultInstance() : price_; + } + } + /** + * + * + *
+     * Price of the product in this region.
+     * 
+ * + * .google.shopping.type.Price price = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + getPriceFieldBuilder() { + if (priceBuilder_ == null) { + priceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder>( + getPrice(), getParentForChildren(), isClean()); + price_ = null; + } + return priceBuilder_; + } + + private com.google.shopping.type.Price salePrice_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + salePriceBuilder_; + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return Whether the salePrice field is set. + */ + public boolean hasSalePrice() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return The salePrice. + */ + public com.google.shopping.type.Price getSalePrice() { + if (salePriceBuilder_ == null) { + return salePrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : salePrice_; + } else { + return salePriceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public Builder setSalePrice(com.google.shopping.type.Price value) { + if (salePriceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + salePrice_ = value; + } else { + salePriceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public Builder setSalePrice(com.google.shopping.type.Price.Builder builderForValue) { + if (salePriceBuilder_ == null) { + salePrice_ = builderForValue.build(); + } else { + salePriceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public Builder mergeSalePrice(com.google.shopping.type.Price value) { + if (salePriceBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && salePrice_ != null + && salePrice_ != com.google.shopping.type.Price.getDefaultInstance()) { + getSalePriceBuilder().mergeFrom(value); + } else { + salePrice_ = value; + } + } else { + salePriceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public Builder clearSalePrice() { + bitField0_ = (bitField0_ & ~0x00000010); + salePrice_ = null; + if (salePriceBuilder_ != null) { + salePriceBuilder_.dispose(); + salePriceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public com.google.shopping.type.Price.Builder getSalePriceBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getSalePriceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + public com.google.shopping.type.PriceOrBuilder getSalePriceOrBuilder() { + if (salePriceBuilder_ != null) { + return salePriceBuilder_.getMessageOrBuilder(); + } else { + return salePrice_ == null + ? com.google.shopping.type.Price.getDefaultInstance() + : salePrice_; + } + } + /** + * + * + *
+     * Sale price of the product in this region. Mandatory if
+     * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+     * is defined.
+     * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder> + getSalePriceFieldBuilder() { + if (salePriceBuilder_ == null) { + salePriceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.shopping.type.Price, + com.google.shopping.type.Price.Builder, + com.google.shopping.type.PriceOrBuilder>( + getSalePrice(), getParentForChildren(), isClean()); + salePrice_ = null; + } + return salePriceBuilder_; + } + + private com.google.type.Interval salePriceEffectiveDate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + salePriceEffectiveDateBuilder_; + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return Whether the salePriceEffectiveDate field is set. + */ + public boolean hasSalePriceEffectiveDate() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return The salePriceEffectiveDate. + */ + public com.google.type.Interval getSalePriceEffectiveDate() { + if (salePriceEffectiveDateBuilder_ == null) { + return salePriceEffectiveDate_ == null + ? com.google.type.Interval.getDefaultInstance() + : salePriceEffectiveDate_; + } else { + return salePriceEffectiveDateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public Builder setSalePriceEffectiveDate(com.google.type.Interval value) { + if (salePriceEffectiveDateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + salePriceEffectiveDate_ = value; + } else { + salePriceEffectiveDateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public Builder setSalePriceEffectiveDate(com.google.type.Interval.Builder builderForValue) { + if (salePriceEffectiveDateBuilder_ == null) { + salePriceEffectiveDate_ = builderForValue.build(); + } else { + salePriceEffectiveDateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public Builder mergeSalePriceEffectiveDate(com.google.type.Interval value) { + if (salePriceEffectiveDateBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && salePriceEffectiveDate_ != null + && salePriceEffectiveDate_ != com.google.type.Interval.getDefaultInstance()) { + getSalePriceEffectiveDateBuilder().mergeFrom(value); + } else { + salePriceEffectiveDate_ = value; + } + } else { + salePriceEffectiveDateBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public Builder clearSalePriceEffectiveDate() { + bitField0_ = (bitField0_ & ~0x00000020); + salePriceEffectiveDate_ = null; + if (salePriceEffectiveDateBuilder_ != null) { + salePriceEffectiveDateBuilder_.dispose(); + salePriceEffectiveDateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public com.google.type.Interval.Builder getSalePriceEffectiveDateBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getSalePriceEffectiveDateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + public com.google.type.IntervalOrBuilder getSalePriceEffectiveDateOrBuilder() { + if (salePriceEffectiveDateBuilder_ != null) { + return salePriceEffectiveDateBuilder_.getMessageOrBuilder(); + } else { + return salePriceEffectiveDate_ == null + ? com.google.type.Interval.getDefaultInstance() + : salePriceEffectiveDate_; + } + } + /** + * + * + *
+     * The `TimePeriod` of the
+     * sale price in this region.
+     * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + getSalePriceEffectiveDateFieldBuilder() { + if (salePriceEffectiveDateBuilder_ == null) { + salePriceEffectiveDateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder>( + getSalePriceEffectiveDate(), getParentForChildren(), isClean()); + salePriceEffectiveDate_ = null; + } + return salePriceEffectiveDateBuilder_; + } + + private java.lang.Object availability_ = ""; + /** + * + * + *
+     * Availability of the product in this region.
+     * For accepted attribute values, see the [regional product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @return Whether the availability field is set. + */ + public boolean hasAvailability() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Availability of the product in this region.
+     * For accepted attribute values, see the [regional product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @return The availability. + */ + public java.lang.String getAvailability() { + java.lang.Object ref = availability_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availability_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Availability of the product in this region.
+     * For accepted attribute values, see the [regional product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @return The bytes for availability. + */ + public com.google.protobuf.ByteString getAvailabilityBytes() { + java.lang.Object ref = availability_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availability_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Availability of the product in this region.
+     * For accepted attribute values, see the [regional product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @param value The availability to set. + * @return This builder for chaining. + */ + public Builder setAvailability(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + availability_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Availability of the product in this region.
+     * For accepted attribute values, see the [regional product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @return This builder for chaining. + */ + public Builder clearAvailability() { + availability_ = getDefaultInstance().getAvailability(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Availability of the product in this region.
+     * For accepted attribute values, see the [regional product inventory feed
+     * specification](https://support.google.com/merchants/answer/3061342)
+     * 
+ * + * optional string availability = 7; + * + * @param value The bytes for availability to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + availability_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.util.List customAttributes_ = + java.util.Collections.emptyList(); + + private void ensureCustomAttributesIsMutable() { + if (!((bitField0_ & 0x00000080) != 0)) { + customAttributes_ = + new java.util.ArrayList(customAttributes_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + customAttributesBuilder_; + + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public java.util.List getCustomAttributesList() { + if (customAttributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customAttributes_); + } else { + return customAttributesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public int getCustomAttributesCount() { + if (customAttributesBuilder_ == null) { + return customAttributes_.size(); + } else { + return customAttributesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttribute getCustomAttributes(int index) { + if (customAttributesBuilder_ == null) { + return customAttributes_.get(index); + } else { + return customAttributesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder setCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.set(index, value); + onChanged(); + } else { + customAttributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder setCustomAttributes( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.set(index, builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addCustomAttributes(com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.add(value); + onChanged(); + } else { + customAttributesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addCustomAttributes(int index, com.google.shopping.type.CustomAttribute value) { + if (customAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomAttributesIsMutable(); + customAttributes_.add(index, value); + onChanged(); + } else { + customAttributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addCustomAttributes( + com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addCustomAttributes( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.add(index, builderForValue.build()); + onChanged(); + } else { + customAttributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder addAllCustomAttributes( + java.lang.Iterable values) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customAttributes_); + onChanged(); + } else { + customAttributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder clearCustomAttributes() { + if (customAttributesBuilder_ == null) { + customAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + customAttributesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public Builder removeCustomAttributes(int index) { + if (customAttributesBuilder_ == null) { + ensureCustomAttributesIsMutable(); + customAttributes_.remove(index); + onChanged(); + } else { + customAttributesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttribute.Builder getCustomAttributesBuilder(int index) { + return getCustomAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder( + int index) { + if (customAttributesBuilder_ == null) { + return customAttributes_.get(index); + } else { + return customAttributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public java.util.List + getCustomAttributesOrBuilderList() { + if (customAttributesBuilder_ != null) { + return customAttributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customAttributes_); + } + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder() { + return getCustomAttributesFieldBuilder() + .addBuilder(com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public com.google.shopping.type.CustomAttribute.Builder addCustomAttributesBuilder(int index) { + return getCustomAttributesFieldBuilder() + .addBuilder(index, com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * A list of custom (merchant-provided) attributes. You can also use
+     * `CustomAttribute` to submit any attribute of the feed specification in its
+     * generic form.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + public java.util.List + getCustomAttributesBuilderList() { + return getCustomAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + getCustomAttributesFieldBuilder() { + if (customAttributesBuilder_ == null) { + customAttributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder>( + customAttributes_, + ((bitField0_ & 0x00000080) != 0), + getParentForChildren(), + isClean()); + customAttributes_ = null; + } + return customAttributesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.merchant.inventories.v1beta.RegionalInventory) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.inventories.v1beta.RegionalInventory) + private static final com.google.shopping.merchant.inventories.v1beta.RegionalInventory + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.inventories.v1beta.RegionalInventory(); + } + + public static com.google.shopping.merchant.inventories.v1beta.RegionalInventory + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RegionalInventory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.merchant.inventories.v1beta.RegionalInventory + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryName.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryName.java new file mode 100644 index 000000000000..4035296a81cc --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class RegionalInventoryName implements ResourceName { + private static final PathTemplate ACCOUNT_PRODUCT_REGION = + PathTemplate.createWithoutUrlEncoding( + "accounts/{account}/products/{product}/regionalInventories/{region}"); + private volatile Map fieldValuesMap; + private final String account; + private final String product; + private final String region; + + @Deprecated + protected RegionalInventoryName() { + account = null; + product = null; + region = null; + } + + private RegionalInventoryName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + product = Preconditions.checkNotNull(builder.getProduct()); + region = Preconditions.checkNotNull(builder.getRegion()); + } + + public String getAccount() { + return account; + } + + public String getProduct() { + return product; + } + + public String getRegion() { + return region; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static RegionalInventoryName of(String account, String product, String region) { + return newBuilder().setAccount(account).setProduct(product).setRegion(region).build(); + } + + public static String format(String account, String product, String region) { + return newBuilder() + .setAccount(account) + .setProduct(product) + .setRegion(region) + .build() + .toString(); + } + + public static RegionalInventoryName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_PRODUCT_REGION.validatedMatch( + formattedString, "RegionalInventoryName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("product"), matchMap.get("region")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (RegionalInventoryName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_PRODUCT_REGION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (account != null) { + fieldMapBuilder.put("account", account); + } + if (product != null) { + fieldMapBuilder.put("product", product); + } + if (region != null) { + fieldMapBuilder.put("region", region); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_PRODUCT_REGION.instantiate( + "account", account, "product", product, "region", region); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + RegionalInventoryName that = ((RegionalInventoryName) o); + return Objects.equals(this.account, that.account) + && Objects.equals(this.product, that.product) + && Objects.equals(this.region, that.region); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(product); + h *= 1000003; + h ^= Objects.hashCode(region); + return h; + } + + /** Builder for accounts/{account}/products/{product}/regionalInventories/{region}. */ + public static class Builder { + private String account; + private String product; + private String region; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getProduct() { + return product; + } + + public String getRegion() { + return region; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setProduct(String product) { + this.product = product; + return this; + } + + public Builder setRegion(String region) { + this.region = region; + return this; + } + + private Builder(RegionalInventoryName regionalInventoryName) { + this.account = regionalInventoryName.account; + this.product = regionalInventoryName.product; + this.region = regionalInventoryName.region; + } + + public RegionalInventoryName build() { + return new RegionalInventoryName(this); + } + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryOrBuilder.java new file mode 100644 index 000000000000..77e1d8c854d3 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryOrBuilder.java @@ -0,0 +1,318 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public interface RegionalInventoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.inventories.v1beta.RegionalInventory) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the `RegionalInventory` resource.
+   * Format:
+   * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the `RegionalInventory` resource.
+   * Format:
+   * `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The account that owns the product. This field will be ignored
+   * if set by the client.
+   * 
+ * + * int64 account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The account. + */ + long getAccount(); + + /** + * + * + *
+   * Required. ID of the region for this
+   * `RegionalInventory` resource. See the [Regional availability and
+   * pricing](https://support.google.com/merchants/answer/9698880) for more
+   * details.
+   * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The region. + */ + java.lang.String getRegion(); + /** + * + * + *
+   * Required. ID of the region for this
+   * `RegionalInventory` resource. See the [Regional availability and
+   * pricing](https://support.google.com/merchants/answer/9698880) for more
+   * details.
+   * 
+ * + * string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for region. + */ + com.google.protobuf.ByteString getRegionBytes(); + + /** + * + * + *
+   * Price of the product in this region.
+   * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return Whether the price field is set. + */ + boolean hasPrice(); + /** + * + * + *
+   * Price of the product in this region.
+   * 
+ * + * .google.shopping.type.Price price = 4; + * + * @return The price. + */ + com.google.shopping.type.Price getPrice(); + /** + * + * + *
+   * Price of the product in this region.
+   * 
+ * + * .google.shopping.type.Price price = 4; + */ + com.google.shopping.type.PriceOrBuilder getPriceOrBuilder(); + + /** + * + * + *
+   * Sale price of the product in this region. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return Whether the salePrice field is set. + */ + boolean hasSalePrice(); + /** + * + * + *
+   * Sale price of the product in this region. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + * + * @return The salePrice. + */ + com.google.shopping.type.Price getSalePrice(); + /** + * + * + *
+   * Sale price of the product in this region. Mandatory if
+   * [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date]
+   * is defined.
+   * 
+ * + * .google.shopping.type.Price sale_price = 5; + */ + com.google.shopping.type.PriceOrBuilder getSalePriceOrBuilder(); + + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale price in this region.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return Whether the salePriceEffectiveDate field is set. + */ + boolean hasSalePriceEffectiveDate(); + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale price in this region.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + * + * @return The salePriceEffectiveDate. + */ + com.google.type.Interval getSalePriceEffectiveDate(); + /** + * + * + *
+   * The `TimePeriod` of the
+   * sale price in this region.
+   * 
+ * + * .google.type.Interval sale_price_effective_date = 6; + */ + com.google.type.IntervalOrBuilder getSalePriceEffectiveDateOrBuilder(); + + /** + * + * + *
+   * Availability of the product in this region.
+   * For accepted attribute values, see the [regional product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return Whether the availability field is set. + */ + boolean hasAvailability(); + /** + * + * + *
+   * Availability of the product in this region.
+   * For accepted attribute values, see the [regional product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return The availability. + */ + java.lang.String getAvailability(); + /** + * + * + *
+   * Availability of the product in this region.
+   * For accepted attribute values, see the [regional product inventory feed
+   * specification](https://support.google.com/merchants/answer/3061342)
+   * 
+ * + * optional string availability = 7; + * + * @return The bytes for availability. + */ + com.google.protobuf.ByteString getAvailabilityBytes(); + + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + java.util.List getCustomAttributesList(); + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + com.google.shopping.type.CustomAttribute getCustomAttributes(int index); + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + int getCustomAttributesCount(); + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + java.util.List + getCustomAttributesOrBuilderList(); + /** + * + * + *
+   * A list of custom (merchant-provided) attributes. You can also use
+   * `CustomAttribute` to submit any attribute of the feed specification in its
+   * generic form.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute custom_attributes = 8; + */ + com.google.shopping.type.CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryProto.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryProto.java new file mode 100644 index 000000000000..50c2cc1a9461 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/merchant/inventories/v1beta/RegionalInventoryProto.java @@ -0,0 +1,200 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/merchant/inventories/v1beta/regionalinventory.proto + +package com.google.shopping.merchant.inventories.v1beta; + +public final class RegionalInventoryProto { + private RegionalInventoryProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nCgoogle/shopping/merchant/inventories/v" + + "1beta/regionalinventory.proto\022+google.sh" + + "opping.merchant.inventories.v1beta\032\034goog" + + "le/api/annotations.proto\032\027google/api/cli" + + "ent.proto\032\037google/api/field_behavior.pro" + + "to\032\031google/api/resource.proto\032\033google/pr" + + "otobuf/empty.proto\032 google/shopping/type" + + "/types.proto\032\032google/type/interval.proto" + + "\"\320\003\n\021RegionalInventory\022\022\n\004name\030\001 \001(\tB\004\342A" + + "\001\003\022\025\n\007account\030\002 \001(\003B\004\342A\001\003\022\024\n\006region\030\003 \001(" + + "\tB\004\342A\001\002\022*\n\005price\030\004 \001(\0132\033.google.shopping" + + ".type.Price\022/\n\nsale_price\030\005 \001(\0132\033.google" + + ".shopping.type.Price\0228\n\031sale_price_effec" + + "tive_date\030\006 \001(\0132\025.google.type.Interval\022\031" + + "\n\014availability\030\007 \001(\tH\000\210\001\001\022@\n\021custom_attr" + + "ibutes\030\010 \003(\0132%.google.shopping.type.Cust" + + "omAttribute:u\352Ar\n,merchantapi.googleapis" + + ".com/RegionalInventory\022Baccounts/{accoun" + + "t}/products/{product}/regionalInventorie" + + "s/{region}B\017\n\r_availability\"]\n\036ListRegio" + + "nalInventoriesRequest\022\024\n\006parent\030\001 \001(\tB\004\342" + + "A\001\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001" + + "(\t\"\230\001\n\037ListRegionalInventoriesResponse\022\\" + + "\n\024regional_inventories\030\001 \003(\0132>.google.sh" + + "opping.merchant.inventories.v1beta.Regio" + + "nalInventory\022\027\n\017next_page_token\030\002 \001(\t\"\230\001" + + "\n\036InsertRegionalInventoryRequest\022\024\n\006pare" + + "nt\030\001 \001(\tB\004\342A\001\002\022`\n\022regional_inventory\030\002 \001" + + "(\0132>.google.shopping.merchant.inventorie" + + "s.v1beta.RegionalInventoryB\004\342A\001\002\"e\n\036Dele" + + "teRegionalInventoryRequest\022C\n\004name\030\001 \001(\t" + + "B5\342A\001\002\372A.\n,merchantapi.googleapis.com/Re" + + "gionalInventory2\337\006\n\030RegionalInventorySer" + + "vice\022\215\002\n\027ListRegionalInventories\022K.googl" + + "e.shopping.merchant.inventories.v1beta.L" + + "istRegionalInventoriesRequest\032L.google.s" + + "hopping.merchant.inventories.v1beta.List" + + "RegionalInventoriesResponse\"W\332A\006parent\202\323" + + "\344\223\002H\022F/inventories/v1beta/{parent=accoun" + + "ts/*/products/*}/regionalInventories\022\221\002\n" + + "\027InsertRegionalInventory\022K.google.shoppi" + + "ng.merchant.inventories.v1beta.InsertReg" + + "ionalInventoryRequest\032>.google.shopping." + + "merchant.inventories.v1beta.RegionalInve" + + "ntory\"i\202\323\344\223\002c\"M/inventories/v1beta/{pare" + + "nt=accounts/*/products/*}/regionalInvent" + + "ories:insert:\022regional_inventory\022\325\001\n\027Del" + + "eteRegionalInventory\022K.google.shopping.m" + + "erchant.inventories.v1beta.DeleteRegiona" + + "lInventoryRequest\032\026.google.protobuf.Empt" + + "y\"U\332A\004name\202\323\344\223\002H*F/inventories/v1beta/{n" + + "ame=accounts/*/products/*/regionalInvent" + + "ories/*}\032G\312A\032merchantapi.googleapis.com\322" + + "A\'https://www.googleapis.com/auth/conten" + + "tB\243\001\n/com.google.shopping.merchant.inven" + + "tories.v1betaB\026RegionalInventoryProtoP\001Z" + + "Vgoogle.golang.org/genproto/googleapis/s" + + "hopping/merchant/inventories/v1beta;inve" + + "ntoriesb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.shopping.type.TypesProto.getDescriptor(), + com.google.type.IntervalProto.getDescriptor(), + }); + internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_RegionalInventory_descriptor, + new java.lang.String[] { + "Name", + "Account", + "Region", + "Price", + "SalePrice", + "SalePriceEffectiveDate", + "Availability", + "CustomAttributes", + "Availability", + }); + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_ListRegionalInventoriesResponse_descriptor, + new java.lang.String[] { + "RegionalInventories", "NextPageToken", + }); + internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_InsertRegionalInventoryRequest_descriptor, + new java.lang.String[] { + "Parent", "RegionalInventory", + }); + internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_inventories_v1beta_DeleteRegionalInventoryRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.shopping.type.TypesProto.getDescriptor(); + com.google.type.IntervalProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/CustomAttribute.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/CustomAttribute.java new file mode 100644 index 000000000000..bd71ca66a62b --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/CustomAttribute.java @@ -0,0 +1,1405 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/type/types.proto + +package com.google.shopping.type; + +/** + * + * + *
+ * A message that represents custom attributes. Exactly one of `value` or
+ * `group_values` must not be empty.
+ * 
+ * + * Protobuf type {@code google.shopping.type.CustomAttribute} + */ +public final class CustomAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.CustomAttribute) + CustomAttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomAttribute.newBuilder() to construct. + private CustomAttribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomAttribute() { + name_ = ""; + value_ = ""; + groupValues_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomAttribute(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.CustomAttribute.class, + com.google.shopping.type.CustomAttribute.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + @java.lang.Override + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object value_ = ""; + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + @java.lang.Override + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_VALUES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List groupValues_; + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public java.util.List getGroupValuesList() { + return groupValues_; + } + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public java.util.List + getGroupValuesOrBuilderList() { + return groupValues_; + } + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public int getGroupValuesCount() { + return groupValues_.size(); + } + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttribute getGroupValues(int index) { + return groupValues_.get(index); + } + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + @java.lang.Override + public com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index) { + return groupValues_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + for (int i = 0; i < groupValues_.size(); i++) { + output.writeMessage(3, groupValues_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + for (int i = 0; i < groupValues_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, groupValues_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.type.CustomAttribute)) { + return super.equals(obj); + } + com.google.shopping.type.CustomAttribute other = (com.google.shopping.type.CustomAttribute) obj; + + if (hasName() != other.hasName()) return false; + if (hasName()) { + if (!getName().equals(other.getName())) return false; + } + if (hasValue() != other.hasValue()) return false; + if (hasValue()) { + if (!getValue().equals(other.getValue())) return false; + } + if (!getGroupValuesList().equals(other.getGroupValuesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasName()) { + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + } + if (hasValue()) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + } + if (getGroupValuesCount() > 0) { + hash = (37 * hash) + GROUP_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getGroupValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.type.CustomAttribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.CustomAttribute parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.shopping.type.CustomAttribute prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A message that represents custom attributes. Exactly one of `value` or
+   * `group_values` must not be empty.
+   * 
+ * + * Protobuf type {@code google.shopping.type.CustomAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.CustomAttribute) + com.google.shopping.type.CustomAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.CustomAttribute.class, + com.google.shopping.type.CustomAttribute.Builder.class); + } + + // Construct using com.google.shopping.type.CustomAttribute.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + value_ = ""; + if (groupValuesBuilder_ == null) { + groupValues_ = java.util.Collections.emptyList(); + } else { + groupValues_ = null; + groupValuesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_CustomAttribute_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute getDefaultInstanceForType() { + return com.google.shopping.type.CustomAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute build() { + com.google.shopping.type.CustomAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute buildPartial() { + com.google.shopping.type.CustomAttribute result = + new com.google.shopping.type.CustomAttribute(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.shopping.type.CustomAttribute result) { + if (groupValuesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + groupValues_ = java.util.Collections.unmodifiableList(groupValues_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.groupValues_ = groupValues_; + } else { + result.groupValues_ = groupValuesBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.type.CustomAttribute result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.type.CustomAttribute) { + return mergeFrom((com.google.shopping.type.CustomAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.CustomAttribute other) { + if (other == com.google.shopping.type.CustomAttribute.getDefaultInstance()) return this; + if (other.hasName()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasValue()) { + value_ = other.value_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (groupValuesBuilder_ == null) { + if (!other.groupValues_.isEmpty()) { + if (groupValues_.isEmpty()) { + groupValues_ = other.groupValues_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureGroupValuesIsMutable(); + groupValues_.addAll(other.groupValues_); + } + onChanged(); + } + } else { + if (!other.groupValues_.isEmpty()) { + if (groupValuesBuilder_.isEmpty()) { + groupValuesBuilder_.dispose(); + groupValuesBuilder_ = null; + groupValues_ = other.groupValues_; + bitField0_ = (bitField0_ & ~0x00000004); + groupValuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getGroupValuesFieldBuilder() + : null; + } else { + groupValuesBuilder_.addAllMessages(other.groupValues_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + value_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.shopping.type.CustomAttribute m = + input.readMessage( + com.google.shopping.type.CustomAttribute.parser(), extensionRegistry); + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(m); + } else { + groupValuesBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + public boolean hasName() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the attribute.
+     * 
+ * + * optional string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = getDefaultInstance().getValue(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The value of the attribute. If `value` is not empty, `group_values` must be
+     * empty.
+     * 
+ * + * optional string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + value_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List groupValues_ = + java.util.Collections.emptyList(); + + private void ensureGroupValuesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + groupValues_ = + new java.util.ArrayList(groupValues_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + groupValuesBuilder_; + + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List getGroupValuesList() { + if (groupValuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(groupValues_); + } else { + return groupValuesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public int getGroupValuesCount() { + if (groupValuesBuilder_ == null) { + return groupValues_.size(); + } else { + return groupValuesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute getGroupValues(int index) { + if (groupValuesBuilder_ == null) { + return groupValues_.get(index); + } else { + return groupValuesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder setGroupValues(int index, com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.set(index, value); + onChanged(); + } else { + groupValuesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder setGroupValues( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.set(index, builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues(com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.add(value); + onChanged(); + } else { + groupValuesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues(int index, com.google.shopping.type.CustomAttribute value) { + if (groupValuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureGroupValuesIsMutable(); + groupValues_.add(index, value); + onChanged(); + } else { + groupValuesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues( + com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addGroupValues( + int index, com.google.shopping.type.CustomAttribute.Builder builderForValue) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.add(index, builderForValue.build()); + onChanged(); + } else { + groupValuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder addAllGroupValues( + java.lang.Iterable values) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, groupValues_); + onChanged(); + } else { + groupValuesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder clearGroupValues() { + if (groupValuesBuilder_ == null) { + groupValues_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + groupValuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public Builder removeGroupValues(int index) { + if (groupValuesBuilder_ == null) { + ensureGroupValuesIsMutable(); + groupValues_.remove(index); + onChanged(); + } else { + groupValuesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder getGroupValuesBuilder(int index) { + return getGroupValuesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index) { + if (groupValuesBuilder_ == null) { + return groupValues_.get(index); + } else { + return groupValuesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List + getGroupValuesOrBuilderList() { + if (groupValuesBuilder_ != null) { + return groupValuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(groupValues_); + } + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder addGroupValuesBuilder() { + return getGroupValuesFieldBuilder() + .addBuilder(com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public com.google.shopping.type.CustomAttribute.Builder addGroupValuesBuilder(int index) { + return getGroupValuesFieldBuilder() + .addBuilder(index, com.google.shopping.type.CustomAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * Subattributes within this attribute group.  If
+     * `group_values` is not empty, `value` must be empty.
+     * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + public java.util.List + getGroupValuesBuilderList() { + return getGroupValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder> + getGroupValuesFieldBuilder() { + if (groupValuesBuilder_ == null) { + groupValuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.type.CustomAttribute, + com.google.shopping.type.CustomAttribute.Builder, + com.google.shopping.type.CustomAttributeOrBuilder>( + groupValues_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + groupValues_ = null; + } + return groupValuesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.type.CustomAttribute) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.CustomAttribute) + private static final com.google.shopping.type.CustomAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.CustomAttribute(); + } + + public static com.google.shopping.type.CustomAttribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomAttribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.type.CustomAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java new file mode 100644 index 000000000000..6e2f027973f6 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/CustomAttributeOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/type/types.proto + +package com.google.shopping.type; + +public interface CustomAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.CustomAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return Whether the name field is set. + */ + boolean hasName(); + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of the attribute.
+   * 
+ * + * optional string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return Whether the value field is set. + */ + boolean hasValue(); + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+   * The value of the attribute. If `value` is not empty, `group_values` must be
+   * empty.
+   * 
+ * + * optional string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + java.util.List getGroupValuesList(); + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + com.google.shopping.type.CustomAttribute getGroupValues(int index); + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + int getGroupValuesCount(); + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + java.util.List + getGroupValuesOrBuilderList(); + /** + * + * + *
+   * Subattributes within this attribute group.  If
+   * `group_values` is not empty, `value` must be empty.
+   * 
+ * + * repeated .google.shopping.type.CustomAttribute group_values = 3; + */ + com.google.shopping.type.CustomAttributeOrBuilder getGroupValuesOrBuilder(int index); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/Destination.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/Destination.java new file mode 100644 index 000000000000..555c9b9c713f --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/Destination.java @@ -0,0 +1,223 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/type/types.proto + +package com.google.shopping.type; + +/** + * + * + *
+ * Destinations available for a product.
+ *
+ * Destinations are used in Merchant Center to allow you to control where the
+ * products from your data feed should be displayed.
+ * 
+ * + * Protobuf enum {@code google.shopping.type.Destination} + */ +public enum Destination implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not specified.
+   * 
+ * + * DESTINATION_UNSPECIFIED = 0; + */ + DESTINATION_UNSPECIFIED(0), + /** + * + * + *
+   * Shopping ads.
+   * 
+ * + * SHOPPING_ADS = 1; + */ + SHOPPING_ADS(1), + /** + * + * + *
+   * Local inventory ads.
+   * 
+ * + * LOCAL_INVENTORY_ADS = 2; + */ + LOCAL_INVENTORY_ADS(2), + /** + * + * + *
+   * Free listings.
+   * 
+ * + * FREE_LISTINGS = 3; + */ + FREE_LISTINGS(3), + /** + * + * + *
+   * Free local product listings.
+   * 
+ * + * FREE_LOCAL_LISTINGS = 4; + */ + FREE_LOCAL_LISTINGS(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not specified.
+   * 
+ * + * DESTINATION_UNSPECIFIED = 0; + */ + public static final int DESTINATION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Shopping ads.
+   * 
+ * + * SHOPPING_ADS = 1; + */ + public static final int SHOPPING_ADS_VALUE = 1; + /** + * + * + *
+   * Local inventory ads.
+   * 
+ * + * LOCAL_INVENTORY_ADS = 2; + */ + public static final int LOCAL_INVENTORY_ADS_VALUE = 2; + /** + * + * + *
+   * Free listings.
+   * 
+ * + * FREE_LISTINGS = 3; + */ + public static final int FREE_LISTINGS_VALUE = 3; + /** + * + * + *
+   * Free local product listings.
+   * 
+ * + * FREE_LOCAL_LISTINGS = 4; + */ + public static final int FREE_LOCAL_LISTINGS_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Destination valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Destination forNumber(int value) { + switch (value) { + case 0: + return DESTINATION_UNSPECIFIED; + case 1: + return SHOPPING_ADS; + case 2: + return LOCAL_INVENTORY_ADS; + case 3: + return FREE_LISTINGS; + case 4: + return FREE_LOCAL_LISTINGS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Destination findValueByNumber(int number) { + return Destination.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.shopping.type.TypesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Destination[] VALUES = values(); + + public static Destination valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Destination(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.Destination) +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/Price.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/Price.java new file mode 100644 index 000000000000..64a582473d71 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/Price.java @@ -0,0 +1,806 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/type/types.proto + +package com.google.shopping.type; + +/** + * + * + *
+ * The price represented as a number and currency.
+ * 
+ * + * Protobuf type {@code google.shopping.type.Price} + */ +public final class Price extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.Price) + PriceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Price.newBuilder() to construct. + private Price(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Price() { + currencyCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Price(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Price.class, com.google.shopping.type.Price.Builder.class); + } + + private int bitField0_; + public static final int AMOUNT_MICROS_FIELD_NUMBER = 1; + private long amountMicros_ = 0L; + /** + * + * + *
+   * The price represented as a number in micros (1 million micros is an
+   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+   * micros).
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The price represented as a number in micros (1 million micros is an
+   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+   * micros).
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + + public static final int CURRENCY_CODE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object currencyCode_ = ""; + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + @java.lang.Override + public boolean hasCurrencyCode() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + @java.lang.Override + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } + } + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(1, amountMicros_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, currencyCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, amountMicros_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, currencyCode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.shopping.type.Price)) { + return super.equals(obj); + } + com.google.shopping.type.Price other = (com.google.shopping.type.Price) obj; + + if (hasAmountMicros() != other.hasAmountMicros()) return false; + if (hasAmountMicros()) { + if (getAmountMicros() != other.getAmountMicros()) return false; + } + if (hasCurrencyCode() != other.hasCurrencyCode()) return false; + if (hasCurrencyCode()) { + if (!getCurrencyCode().equals(other.getCurrencyCode())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAmountMicros()) { + hash = (37 * hash) + AMOUNT_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAmountMicros()); + } + if (hasCurrencyCode()) { + hash = (37 * hash) + CURRENCY_CODE_FIELD_NUMBER; + hash = (53 * hash) + getCurrencyCode().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.type.Price parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Price parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Price parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Price parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Price parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Price parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.shopping.type.Price parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Price parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.shopping.type.Price prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The price represented as a number and currency.
+   * 
+ * + * Protobuf type {@code google.shopping.type.Price} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Price) + com.google.shopping.type.PriceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Price.class, com.google.shopping.type.Price.Builder.class); + } + + // Construct using com.google.shopping.type.Price.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + amountMicros_ = 0L; + currencyCode_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Price_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Price getDefaultInstanceForType() { + return com.google.shopping.type.Price.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Price build() { + com.google.shopping.type.Price result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Price buildPartial() { + com.google.shopping.type.Price result = new com.google.shopping.type.Price(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.type.Price result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.amountMicros_ = amountMicros_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.currencyCode_ = currencyCode_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.shopping.type.Price) { + return mergeFrom((com.google.shopping.type.Price) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Price other) { + if (other == com.google.shopping.type.Price.getDefaultInstance()) return this; + if (other.hasAmountMicros()) { + setAmountMicros(other.getAmountMicros()); + } + if (other.hasCurrencyCode()) { + currencyCode_ = other.currencyCode_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + amountMicros_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + currencyCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long amountMicros_; + /** + * + * + *
+     * The price represented as a number in micros (1 million micros is an
+     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+     * micros).
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * The price represented as a number in micros (1 million micros is an
+     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+     * micros).
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + /** + * + * + *
+     * The price represented as a number in micros (1 million micros is an
+     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+     * micros).
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @param value The amountMicros to set. + * @return This builder for chaining. + */ + public Builder setAmountMicros(long value) { + + amountMicros_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The price represented as a number in micros (1 million micros is an
+     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+     * micros).
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return This builder for chaining. + */ + public Builder clearAmountMicros() { + bitField0_ = (bitField0_ & ~0x00000001); + amountMicros_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object currencyCode_ = ""; + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + public boolean hasCurrencyCode() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + public java.lang.String getCurrencyCode() { + java.lang.Object ref = currencyCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currencyCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + public com.google.protobuf.ByteString getCurrencyCodeBytes() { + java.lang.Object ref = currencyCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + currencyCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @param value The currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + currencyCode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @return This builder for chaining. + */ + public Builder clearCurrencyCode() { + currencyCode_ = getDefaultInstance().getCurrencyCode(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The currency of the price using three-letter acronyms according to [ISO
+     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+     * 
+ * + * optional string currency_code = 2; + * + * @param value The bytes for currencyCode to set. + * @return This builder for chaining. + */ + public Builder setCurrencyCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + currencyCode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.shopping.type.Price) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Price) + private static final com.google.shopping.type.Price DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Price(); + } + + public static com.google.shopping.type.Price getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Price parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.shopping.type.Price getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/PriceOrBuilder.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/PriceOrBuilder.java new file mode 100644 index 000000000000..d071d52a528a --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/PriceOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/type/types.proto + +package com.google.shopping.type; + +public interface PriceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Price) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The price represented as a number in micros (1 million micros is an
+   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+   * micros).
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + boolean hasAmountMicros(); + /** + * + * + *
+   * The price represented as a number in micros (1 million micros is an
+   * equivalent to one's currency standard unit, for example, 1 USD = 1000000
+   * micros).
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + long getAmountMicros(); + + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return Whether the currencyCode field is set. + */ + boolean hasCurrencyCode(); + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return The currencyCode. + */ + java.lang.String getCurrencyCode(); + /** + * + * + *
+   * The currency of the price using three-letter acronyms according to [ISO
+   * 4217](http://en.wikipedia.org/wiki/ISO_4217).
+   * 
+ * + * optional string currency_code = 2; + * + * @return The bytes for currencyCode. + */ + com.google.protobuf.ByteString getCurrencyCodeBytes(); +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/TypesProto.java b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/TypesProto.java new file mode 100644 index 000000000000..c0d5a014193f --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/java/com/google/shopping/type/TypesProto.java @@ -0,0 +1,85 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/shopping/type/types.proto + +package com.google.shopping.type; + +public final class TypesProto { + private TypesProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_Price_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_type_Price_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_CustomAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n google/shopping/type/types.proto\022\024goog" + + "le.shopping.type\"c\n\005Price\022\032\n\ramount_micr" + + "os\030\001 \001(\003H\000\210\001\001\022\032\n\rcurrency_code\030\002 \001(\tH\001\210\001" + + "\001B\020\n\016_amount_microsB\020\n\016_currency_code\"\210\001" + + "\n\017CustomAttribute\022\021\n\004name\030\001 \001(\tH\000\210\001\001\022\022\n\005" + + "value\030\002 \001(\tH\001\210\001\001\022;\n\014group_values\030\003 \003(\0132%" + + ".google.shopping.type.CustomAttributeB\007\n" + + "\005_nameB\010\n\006_value*\201\001\n\013Destination\022\033\n\027DEST" + + "INATION_UNSPECIFIED\020\000\022\020\n\014SHOPPING_ADS\020\001\022" + + "\027\n\023LOCAL_INVENTORY_ADS\020\002\022\021\n\rFREE_LISTING" + + "S\020\003\022\027\n\023FREE_LOCAL_LISTINGS\020\004B\200\001\n\030com.goo" + + "gle.shopping.typeB\nTypesProtoP\001Z?google." + + "golang.org/genproto/googleapis/shopping/" + + "type/types;types\252\002\024Google.Shopping.Typeb" + + "\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_shopping_type_Price_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_type_Price_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_type_Price_descriptor, + new java.lang.String[] { + "AmountMicros", "CurrencyCode", "AmountMicros", "CurrencyCode", + }); + internal_static_google_shopping_type_CustomAttribute_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_type_CustomAttribute_descriptor, + new java.lang.String[] { + "Name", "Value", "GroupValues", "Name", "Value", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/proto/google/shopping/merchant/inventories/v1beta/localinventory.proto b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/proto/google/shopping/merchant/inventories/v1beta/localinventory.proto new file mode 100644 index 000000000000..2e35cb5a163c --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/proto/google/shopping/merchant/inventories/v1beta/localinventory.proto @@ -0,0 +1,210 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.shopping.merchant.inventories.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/shopping/type/types.proto"; +import "google/type/interval.proto"; + +option go_package = "google.golang.org/genproto/googleapis/shopping/merchant/inventories/v1beta;inventories"; +option java_multiple_files = true; +option java_outer_classname = "LocalInventoryProto"; +option java_package = "com.google.shopping.merchant.inventories.v1beta"; + +// Service to manage local inventory for products +service LocalInventoryService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Lists the `LocalInventory` resources for the given product in your merchant + // account. The response might contain fewer items than specified by + // `pageSize`. If `pageToken` was returned in previous request, it can be used + // to obtain additional results. + // + // `LocalInventory` resources are listed per product for a given account. + rpc ListLocalInventories(ListLocalInventoriesRequest) + returns (ListLocalInventoriesResponse) { + option (google.api.http) = { + get: "/inventories/v1beta/{parent=accounts/*/products/*}/localInventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Inserts a `LocalInventory` resource to a product in your merchant + // account. + // + // Replaces the full `LocalInventory` resource if an entry with the same + // [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code] + // already exists for the product. + // + // It might take up to 30 minutes for the new or updated `LocalInventory` + // resource to appear in products. + rpc InsertLocalInventory(InsertLocalInventoryRequest) + returns (LocalInventory) { + option (google.api.http) = { + post: "/inventories/v1beta/{parent=accounts/*/products/*}/localInventories:insert" + body: "local_inventory" + }; + } + + // Deletes the specified `LocalInventory` from the given product in your + // merchant account. It might take a up to an hour for the + // `LocalInventory` to be deleted from the specific product. + // Once you have received a successful delete response, wait for that + // period before attempting a delete again. + rpc DeleteLocalInventory(DeleteLocalInventoryRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/inventories/v1beta/{name=accounts/*/products/*/localInventories/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Local inventory information for the product. Represents in-store information +// for a specific product at the store specified by +// [`storeCode`][google.shopping.merchant.inventories.v1beta.LocalInventory.store_code]. +// For a list of all accepted attribute values, see the [local product inventory +// feed specification](https://support.google.com/merchants/answer/3061342). +message LocalInventory { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/LocalInventory" + pattern: "accounts/{account}/products/{product}/localInventories/{store_code}" + }; + + // Output only. The name of the `LocalInventory` resource. + // Format: + // `accounts/{account}/products/{product}/localInventories/{store_code}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The account that owns the product. This field will be ignored + // if set by the client. + int64 account = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Store code (the store ID from your Business Profile) of the + // physical store the product is sold in. See the [Local product inventory + // feed specification](https://support.google.com/merchants/answer/3061342) + // for more information. + string store_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // Price of the product at this store. + google.shopping.type.Price price = 4; + + // Sale price of the product at this store. Mandatory if + // [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.LocalInventory.sale_price_effective_date] + // is defined. + google.shopping.type.Price sale_price = 5; + + // The `TimePeriod` of the + // sale at this store. + google.type.Interval sale_price_effective_date = 6; + + // Availability of the product at this store. + // For accepted attribute values, see the [local product inventory feed + // specification](https://support.google.com/merchants/answer/3061342) + optional string availability = 7; + + // Quantity of the product available at this store. Must be greater than or + // equal to zero. + optional int64 quantity = 8; + + // Supported pickup method for this product. Unless the value is `"not + // supported"`, this field must be submitted together with + // `pickupSla`. + // For accepted attribute values, see the [local product inventory feed + // specification](https://support.google.com/merchants/answer/3061342) + optional string pickup_method = 9; + + // Relative time period from the order date for an order for this product, + // from this store, to be ready for pickup. Must be submitted with + // `pickupMethod`. + // For accepted attribute values, see the [local product inventory feed + // specification](https://support.google.com/merchants/answer/3061342) + optional string pickup_sla = 10; + + // Location of the product inside the store. Maximum length is 20 bytes. + optional string instore_product_location = 11; + + // A list of custom (merchant-provided) attributes. You can also use + // `CustomAttribute` to submit any attribute of the feed specification in its + // generic form. + repeated google.shopping.type.CustomAttribute custom_attributes = 12; +} + +// Request message for the `ListLocalInventories` method. +message ListLocalInventoriesRequest { + // Required. The `name` of the parent product to list local inventories for. + // Format: + // `accounts/{account}/products/{product}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of `LocalInventory` resources for the given + // product to return. The service returns fewer than this value if the number + // of inventories for the given product is less that than the `pageSize`. The + // default value is 25000. The maximum value is 25000; If a value higher than + // the maximum is specified, then the `pageSize` will default to the maximum + int32 page_size = 2; + + // A page token, received from a previous `ListLocalInventories` call. + // Provide the page token to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListLocalInventories` + // must match the call that provided the page token. The token returned as + // [nextPageToken][google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse.next_page_token] + // in the response to the previous request. + string page_token = 3; +} + +// Response message for the `ListLocalInventories` method. +message ListLocalInventoriesResponse { + // The `LocalInventory` resources for the given product from the specified + // account. + repeated LocalInventory local_inventories = 1; + + // A token, which can be sent as `pageToken` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for the `InsertLocalInventory` method. +message InsertLocalInventoryRequest { + // Required. The account and product where this inventory will be inserted. + // Format: `accounts/{account}/products/{product}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Local inventory information of the product. If the product + // already has a `LocalInventory` resource for the same `storeCode`, full + // replacement of the `LocalInventory` resource is performed. + LocalInventory local_inventory = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `DeleteLocalInventory` method. +message DeleteLocalInventoryRequest { + // Required. The name of the local inventory for the given product to delete. + // Format: + // `accounts/{account}/products/{product}/localInventories/{store_code}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/LocalInventory" + } + ]; +} diff --git a/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/proto/google/shopping/merchant/inventories/v1beta/regionalinventory.proto b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/proto/google/shopping/merchant/inventories/v1beta/regionalinventory.proto new file mode 100644 index 000000000000..7b3a76e5e103 --- /dev/null +++ b/java-merchantapi/proto-google-shopping-merchant-inventories-v1beta/src/main/proto/google/shopping/merchant/inventories/v1beta/regionalinventory.proto @@ -0,0 +1,191 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.shopping.merchant.inventories.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/shopping/type/types.proto"; +import "google/type/interval.proto"; + +option go_package = "google.golang.org/genproto/googleapis/shopping/merchant/inventories/v1beta;inventories"; +option java_multiple_files = true; +option java_outer_classname = "RegionalInventoryProto"; +option java_package = "com.google.shopping.merchant.inventories.v1beta"; + +// Service to manage regional inventory for products. There is also separate +// `regions` resource and API to manage regions definitions. +service RegionalInventoryService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Lists the `RegionalInventory` resources for the given product in your + // merchant account. The response might contain fewer items than specified by + // `pageSize`. If `pageToken` was returned in previous request, it can be + // used to obtain additional results. + // + // `RegionalInventory` resources are listed per product for a given account. + rpc ListRegionalInventories(ListRegionalInventoriesRequest) + returns (ListRegionalInventoriesResponse) { + option (google.api.http) = { + get: "/inventories/v1beta/{parent=accounts/*/products/*}/regionalInventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Inserts a `RegionalInventory` to a given product in your + // merchant account. + // + // Replaces the full `RegionalInventory` resource if an entry with the same + // [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region] + // already exists for the product. + // + // It might take up to 30 minutes for the new or updated `RegionalInventory` + // resource to appear in products. + rpc InsertRegionalInventory(InsertRegionalInventoryRequest) + returns (RegionalInventory) { + option (google.api.http) = { + post: "/inventories/v1beta/{parent=accounts/*/products/*}/regionalInventories:insert" + body: "regional_inventory" + }; + } + + // Deletes the specified `RegionalInventory` resource from the given product + // in your merchant account. It might take up to an hour for the + // `RegionalInventory` to be deleted from the specific product. + // Once you have received a successful delete response, wait for that + // period before attempting a delete again. + rpc DeleteRegionalInventory(DeleteRegionalInventoryRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/inventories/v1beta/{name=accounts/*/products/*/regionalInventories/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Regional inventory information for the product. Represents specific +// information like price and availability for a given product in a specific +// [`region`][google.shopping.merchant.inventories.v1beta.RegionalInventory.region]. +// For a list of all accepted attribute values, see the [regional product +// inventory feed +// specification](https://support.google.com/merchants/answer/9698880). +message RegionalInventory { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/RegionalInventory" + pattern: "accounts/{account}/products/{product}/regionalInventories/{region}" + }; + + // Output only. The name of the `RegionalInventory` resource. + // Format: + // `{regional_inventory.name=accounts/{account}/products/{product}/regionalInventories/{region}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The account that owns the product. This field will be ignored + // if set by the client. + int64 account = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. ID of the region for this + // `RegionalInventory` resource. See the [Regional availability and + // pricing](https://support.google.com/merchants/answer/9698880) for more + // details. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Price of the product in this region. + google.shopping.type.Price price = 4; + + // Sale price of the product in this region. Mandatory if + // [`salePriceEffectiveDate`][google.shopping.merchant.inventories.v1beta.RegionalInventory.sale_price_effective_date] + // is defined. + google.shopping.type.Price sale_price = 5; + + // The `TimePeriod` of the + // sale price in this region. + google.type.Interval sale_price_effective_date = 6; + + // Availability of the product in this region. + // For accepted attribute values, see the [regional product inventory feed + // specification](https://support.google.com/merchants/answer/3061342) + optional string availability = 7; + + // A list of custom (merchant-provided) attributes. You can also use + // `CustomAttribute` to submit any attribute of the feed specification in its + // generic form. + repeated google.shopping.type.CustomAttribute custom_attributes = 8; +} + +// Request message for the `ListRegionalInventories` method. +message ListRegionalInventoriesRequest { + // Required. The `name` of the parent product to list `RegionalInventory` + // resources for. Format: `accounts/{account}/products/{product}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of `RegionalInventory` resources for the given product + // to return. The service returns fewer than this value if the number of + // inventories for the given product is less that than the `pageSize`. The + // default value is 25000. The maximum value is 100000; If a value higher than + // the maximum is specified, then the `pageSize` will default to the maximum. + int32 page_size = 2; + + // A page token, received from a previous `ListRegionalInventories` call. + // Provide the page token to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListRegionalInventories` + // must match the call that provided the page token. The token returned as + // [nextPageToken][google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse.next_page_token] + // in the response to the previous request. + string page_token = 3; +} + +// Response message for the `ListRegionalInventories` method. +message ListRegionalInventoriesResponse { + // The `RegionalInventory` resources for the given product from the specified + // account. + repeated RegionalInventory regional_inventories = 1; + + // A token, which can be sent as `pageToken` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request message for the `InsertRegionalInventory` method. +message InsertRegionalInventoryRequest { + // Required. The account and product where this inventory will be inserted. + // Format: `accounts/{account}/products/{product}` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Regional inventory information to add to the product. If the + // product already has a `RegionalInventory` resource for the same `region`, + // full replacement of the `RegionalInventory` resource is performed. + RegionalInventory regional_inventory = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for the `DeleteRegionalInventory` method. +message DeleteRegionalInventoryRequest { + // Required. The name of the `RegionalInventory` resource to delete. + // Format: + // `accounts/{account}/products/{product}/regionalInventories/{region}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "merchantapi.googleapis.com/RegionalInventory" + } + ]; +} diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetCredentialsProvider.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..7c683f7eb672 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceSettings; +import com.google.shopping.merchant.inventories.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LocalInventoryServiceSettings localInventoryServiceSettings = + LocalInventoryServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create(localInventoryServiceSettings); + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_Create_SetCredentialsProvider_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetCredentialsProvider1.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..9ed8d0f31558 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LocalInventoryServiceSettings localInventoryServiceSettings = + LocalInventoryServiceSettings.newHttpJsonBuilder().build(); + LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create(localInventoryServiceSettings); + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_Create_SetCredentialsProvider1_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetEndpoint.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..ab798f526c16 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceSettings; +import com.google.shopping.merchant.inventories.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LocalInventoryServiceSettings localInventoryServiceSettings = + LocalInventoryServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create(localInventoryServiceSettings); + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_Create_SetEndpoint_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/AsyncDeleteLocalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/AsyncDeleteLocalInventory.java new file mode 100644 index 000000000000..5090cf0bbe7d --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/AsyncDeleteLocalInventory.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_DeleteLocalInventory_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryName; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class AsyncDeleteLocalInventory { + + public static void main(String[] args) throws Exception { + asyncDeleteLocalInventory(); + } + + public static void asyncDeleteLocalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + DeleteLocalInventoryRequest request = + DeleteLocalInventoryRequest.newBuilder() + .setName(LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]").toString()) + .build(); + ApiFuture future = + localInventoryServiceClient.deleteLocalInventoryCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_DeleteLocalInventory_async] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventory.java new file mode 100644 index 000000000000..20e2bd3f9a61 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventory.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_DeleteLocalInventory_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryName; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class SyncDeleteLocalInventory { + + public static void main(String[] args) throws Exception { + syncDeleteLocalInventory(); + } + + public static void syncDeleteLocalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + DeleteLocalInventoryRequest request = + DeleteLocalInventoryRequest.newBuilder() + .setName(LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]").toString()) + .build(); + localInventoryServiceClient.deleteLocalInventory(request); + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_DeleteLocalInventory_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventoryLocalinventoryname.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventoryLocalinventoryname.java new file mode 100644 index 000000000000..fa7c274ce78d --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventoryLocalinventoryname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_DeleteLocalInventory_Localinventoryname_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryName; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class SyncDeleteLocalInventoryLocalinventoryname { + + public static void main(String[] args) throws Exception { + syncDeleteLocalInventoryLocalinventoryname(); + } + + public static void syncDeleteLocalInventoryLocalinventoryname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + LocalInventoryName name = LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]"); + localInventoryServiceClient.deleteLocalInventory(name); + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_DeleteLocalInventory_Localinventoryname_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventoryString.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventoryString.java new file mode 100644 index 000000000000..19584c399829 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/deletelocalinventory/SyncDeleteLocalInventoryString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_DeleteLocalInventory_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryName; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class SyncDeleteLocalInventoryString { + + public static void main(String[] args) throws Exception { + syncDeleteLocalInventoryString(); + } + + public static void syncDeleteLocalInventoryString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + String name = LocalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[STORE_CODE]").toString(); + localInventoryServiceClient.deleteLocalInventory(name); + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_DeleteLocalInventory_String_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/insertlocalinventory/AsyncInsertLocalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/insertlocalinventory/AsyncInsertLocalInventory.java new file mode 100644 index 000000000000..c19bc2140a47 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/insertlocalinventory/AsyncInsertLocalInventory.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_InsertLocalInventory_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class AsyncInsertLocalInventory { + + public static void main(String[] args) throws Exception { + asyncInsertLocalInventory(); + } + + public static void asyncInsertLocalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + InsertLocalInventoryRequest request = + InsertLocalInventoryRequest.newBuilder() + .setParent("parent-995424086") + .setLocalInventory(LocalInventory.newBuilder().build()) + .build(); + ApiFuture future = + localInventoryServiceClient.insertLocalInventoryCallable().futureCall(request); + // Do something. + LocalInventory response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_InsertLocalInventory_async] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/insertlocalinventory/SyncInsertLocalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/insertlocalinventory/SyncInsertLocalInventory.java new file mode 100644 index 000000000000..decdc6628fac --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/insertlocalinventory/SyncInsertLocalInventory.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_InsertLocalInventory_sync] +import com.google.shopping.merchant.inventories.v1beta.InsertLocalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class SyncInsertLocalInventory { + + public static void main(String[] args) throws Exception { + syncInsertLocalInventory(); + } + + public static void syncInsertLocalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + InsertLocalInventoryRequest request = + InsertLocalInventoryRequest.newBuilder() + .setParent("parent-995424086") + .setLocalInventory(LocalInventory.newBuilder().build()) + .build(); + LocalInventory response = localInventoryServiceClient.insertLocalInventory(request); + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_InsertLocalInventory_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/AsyncListLocalInventories.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/AsyncListLocalInventories.java new file mode 100644 index 000000000000..d183e2941fb8 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/AsyncListLocalInventories.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_ListLocalInventories_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class AsyncListLocalInventories { + + public static void main(String[] args) throws Exception { + asyncListLocalInventories(); + } + + public static void asyncListLocalInventories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + ListLocalInventoriesRequest request = + ListLocalInventoriesRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + localInventoryServiceClient.listLocalInventoriesPagedCallable().futureCall(request); + // Do something. + for (LocalInventory element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_ListLocalInventories_async] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/AsyncListLocalInventoriesPaged.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/AsyncListLocalInventoriesPaged.java new file mode 100644 index 000000000000..8d813d3e537f --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/AsyncListLocalInventoriesPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_ListLocalInventories_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class AsyncListLocalInventoriesPaged { + + public static void main(String[] args) throws Exception { + asyncListLocalInventoriesPaged(); + } + + public static void asyncListLocalInventoriesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + ListLocalInventoriesRequest request = + ListLocalInventoriesRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocalInventoriesResponse response = + localInventoryServiceClient.listLocalInventoriesCallable().call(request); + for (LocalInventory element : response.getLocalInventoriesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_ListLocalInventories_Paged_async] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/SyncListLocalInventories.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/SyncListLocalInventories.java new file mode 100644 index 000000000000..fdeeb23ef220 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/SyncListLocalInventories.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_ListLocalInventories_sync] +import com.google.shopping.merchant.inventories.v1beta.ListLocalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class SyncListLocalInventories { + + public static void main(String[] args) throws Exception { + syncListLocalInventories(); + } + + public static void syncListLocalInventories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + ListLocalInventoriesRequest request = + ListLocalInventoriesRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (LocalInventory element : + localInventoryServiceClient.listLocalInventories(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_ListLocalInventories_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/SyncListLocalInventoriesString.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/SyncListLocalInventoriesString.java new file mode 100644 index 000000000000..2b69bda881bc --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservice/listlocalinventories/SyncListLocalInventoriesString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryService_ListLocalInventories_String_sync] +import com.google.shopping.merchant.inventories.v1beta.LocalInventory; +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceClient; + +public class SyncListLocalInventoriesString { + + public static void main(String[] args) throws Exception { + syncListLocalInventoriesString(); + } + + public static void syncListLocalInventoriesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LocalInventoryServiceClient localInventoryServiceClient = + LocalInventoryServiceClient.create()) { + String parent = "parent-995424086"; + for (LocalInventory element : + localInventoryServiceClient.listLocalInventories(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_LocalInventoryService_ListLocalInventories_String_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservicesettings/insertlocalinventory/SyncInsertLocalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservicesettings/insertlocalinventory/SyncInsertLocalInventory.java new file mode 100644 index 000000000000..3fc1c6e9bc54 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/localinventoryservicesettings/insertlocalinventory/SyncInsertLocalInventory.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryServiceSettings_InsertLocalInventory_sync] +import com.google.shopping.merchant.inventories.v1beta.LocalInventoryServiceSettings; +import java.time.Duration; + +public class SyncInsertLocalInventory { + + public static void main(String[] args) throws Exception { + syncInsertLocalInventory(); + } + + public static void syncInsertLocalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LocalInventoryServiceSettings.Builder localInventoryServiceSettingsBuilder = + LocalInventoryServiceSettings.newBuilder(); + localInventoryServiceSettingsBuilder + .insertLocalInventorySettings() + .setRetrySettings( + localInventoryServiceSettingsBuilder + .insertLocalInventorySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + LocalInventoryServiceSettings localInventoryServiceSettings = + localInventoryServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_LocalInventoryServiceSettings_InsertLocalInventory_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetCredentialsProvider.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..f3749aca7baa --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceSettings; +import com.google.shopping.merchant.inventories.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RegionalInventoryServiceSettings regionalInventoryServiceSettings = + RegionalInventoryServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create(regionalInventoryServiceSettings); + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_Create_SetCredentialsProvider_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetCredentialsProvider1.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..a9d923d32baf --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RegionalInventoryServiceSettings regionalInventoryServiceSettings = + RegionalInventoryServiceSettings.newHttpJsonBuilder().build(); + RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create(regionalInventoryServiceSettings); + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_Create_SetCredentialsProvider1_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetEndpoint.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..027cf975d38e --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceSettings; +import com.google.shopping.merchant.inventories.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RegionalInventoryServiceSettings regionalInventoryServiceSettings = + RegionalInventoryServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create(regionalInventoryServiceSettings); + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_Create_SetEndpoint_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/AsyncDeleteRegionalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/AsyncDeleteRegionalInventory.java new file mode 100644 index 000000000000..78c819c8cf5a --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/AsyncDeleteRegionalInventory.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_DeleteRegionalInventory_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryName; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class AsyncDeleteRegionalInventory { + + public static void main(String[] args) throws Exception { + asyncDeleteRegionalInventory(); + } + + public static void asyncDeleteRegionalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + DeleteRegionalInventoryRequest request = + DeleteRegionalInventoryRequest.newBuilder() + .setName(RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]").toString()) + .build(); + ApiFuture future = + regionalInventoryServiceClient.deleteRegionalInventoryCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_DeleteRegionalInventory_async] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventory.java new file mode 100644 index 000000000000..4822d88ee2a9 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventory.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_DeleteRegionalInventory_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.DeleteRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryName; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class SyncDeleteRegionalInventory { + + public static void main(String[] args) throws Exception { + syncDeleteRegionalInventory(); + } + + public static void syncDeleteRegionalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + DeleteRegionalInventoryRequest request = + DeleteRegionalInventoryRequest.newBuilder() + .setName(RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]").toString()) + .build(); + regionalInventoryServiceClient.deleteRegionalInventory(request); + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_DeleteRegionalInventory_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventoryRegionalinventoryname.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventoryRegionalinventoryname.java new file mode 100644 index 000000000000..6413419c53eb --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventoryRegionalinventoryname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_DeleteRegionalInventory_Regionalinventoryname_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryName; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class SyncDeleteRegionalInventoryRegionalinventoryname { + + public static void main(String[] args) throws Exception { + syncDeleteRegionalInventoryRegionalinventoryname(); + } + + public static void syncDeleteRegionalInventoryRegionalinventoryname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + RegionalInventoryName name = RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]"); + regionalInventoryServiceClient.deleteRegionalInventory(name); + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_DeleteRegionalInventory_Regionalinventoryname_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventoryString.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventoryString.java new file mode 100644 index 000000000000..6df5915a4bdc --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/deleteregionalinventory/SyncDeleteRegionalInventoryString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_DeleteRegionalInventory_String_sync] +import com.google.protobuf.Empty; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryName; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class SyncDeleteRegionalInventoryString { + + public static void main(String[] args) throws Exception { + syncDeleteRegionalInventoryString(); + } + + public static void syncDeleteRegionalInventoryString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + String name = RegionalInventoryName.of("[ACCOUNT]", "[PRODUCT]", "[REGION]").toString(); + regionalInventoryServiceClient.deleteRegionalInventory(name); + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_DeleteRegionalInventory_String_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/insertregionalinventory/AsyncInsertRegionalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/insertregionalinventory/AsyncInsertRegionalInventory.java new file mode 100644 index 000000000000..2fbb8f788742 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/insertregionalinventory/AsyncInsertRegionalInventory.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_InsertRegionalInventory_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class AsyncInsertRegionalInventory { + + public static void main(String[] args) throws Exception { + asyncInsertRegionalInventory(); + } + + public static void asyncInsertRegionalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + InsertRegionalInventoryRequest request = + InsertRegionalInventoryRequest.newBuilder() + .setParent("parent-995424086") + .setRegionalInventory(RegionalInventory.newBuilder().build()) + .build(); + ApiFuture future = + regionalInventoryServiceClient.insertRegionalInventoryCallable().futureCall(request); + // Do something. + RegionalInventory response = future.get(); + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_InsertRegionalInventory_async] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/insertregionalinventory/SyncInsertRegionalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/insertregionalinventory/SyncInsertRegionalInventory.java new file mode 100644 index 000000000000..5db8ae9be718 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/insertregionalinventory/SyncInsertRegionalInventory.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_InsertRegionalInventory_sync] +import com.google.shopping.merchant.inventories.v1beta.InsertRegionalInventoryRequest; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class SyncInsertRegionalInventory { + + public static void main(String[] args) throws Exception { + syncInsertRegionalInventory(); + } + + public static void syncInsertRegionalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + InsertRegionalInventoryRequest request = + InsertRegionalInventoryRequest.newBuilder() + .setParent("parent-995424086") + .setRegionalInventory(RegionalInventory.newBuilder().build()) + .build(); + RegionalInventory response = regionalInventoryServiceClient.insertRegionalInventory(request); + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_InsertRegionalInventory_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/AsyncListRegionalInventories.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/AsyncListRegionalInventories.java new file mode 100644 index 000000000000..ab4adf678769 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/AsyncListRegionalInventories.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_ListRegionalInventories_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class AsyncListRegionalInventories { + + public static void main(String[] args) throws Exception { + asyncListRegionalInventories(); + } + + public static void asyncListRegionalInventories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + ListRegionalInventoriesRequest request = + ListRegionalInventoriesRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + regionalInventoryServiceClient.listRegionalInventoriesPagedCallable().futureCall(request); + // Do something. + for (RegionalInventory element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_ListRegionalInventories_async] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/AsyncListRegionalInventoriesPaged.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/AsyncListRegionalInventoriesPaged.java new file mode 100644 index 000000000000..9c06d3ddaad8 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/AsyncListRegionalInventoriesPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_ListRegionalInventories_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesResponse; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class AsyncListRegionalInventoriesPaged { + + public static void main(String[] args) throws Exception { + asyncListRegionalInventoriesPaged(); + } + + public static void asyncListRegionalInventoriesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + ListRegionalInventoriesRequest request = + ListRegionalInventoriesRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListRegionalInventoriesResponse response = + regionalInventoryServiceClient.listRegionalInventoriesCallable().call(request); + for (RegionalInventory element : response.getRegionalInventoriesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_ListRegionalInventories_Paged_async] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/SyncListRegionalInventories.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/SyncListRegionalInventories.java new file mode 100644 index 000000000000..17a9e1a7e8b7 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/SyncListRegionalInventories.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_ListRegionalInventories_sync] +import com.google.shopping.merchant.inventories.v1beta.ListRegionalInventoriesRequest; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class SyncListRegionalInventories { + + public static void main(String[] args) throws Exception { + syncListRegionalInventories(); + } + + public static void syncListRegionalInventories() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + ListRegionalInventoriesRequest request = + ListRegionalInventoriesRequest.newBuilder() + .setParent("parent-995424086") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (RegionalInventory element : + regionalInventoryServiceClient.listRegionalInventories(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_ListRegionalInventories_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/SyncListRegionalInventoriesString.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/SyncListRegionalInventoriesString.java new file mode 100644 index 000000000000..ae710bfb00ef --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservice/listregionalinventories/SyncListRegionalInventoriesString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryService_ListRegionalInventories_String_sync] +import com.google.shopping.merchant.inventories.v1beta.RegionalInventory; +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceClient; + +public class SyncListRegionalInventoriesString { + + public static void main(String[] args) throws Exception { + syncListRegionalInventoriesString(); + } + + public static void syncListRegionalInventoriesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (RegionalInventoryServiceClient regionalInventoryServiceClient = + RegionalInventoryServiceClient.create()) { + String parent = "parent-995424086"; + for (RegionalInventory element : + regionalInventoryServiceClient.listRegionalInventories(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryService_ListRegionalInventories_String_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservicesettings/insertregionalinventory/SyncInsertRegionalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservicesettings/insertregionalinventory/SyncInsertRegionalInventory.java new file mode 100644 index 000000000000..5c78312cde7a --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/regionalinventoryservicesettings/insertregionalinventory/SyncInsertRegionalInventory.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryServiceSettings_InsertRegionalInventory_sync] +import com.google.shopping.merchant.inventories.v1beta.RegionalInventoryServiceSettings; +import java.time.Duration; + +public class SyncInsertRegionalInventory { + + public static void main(String[] args) throws Exception { + syncInsertRegionalInventory(); + } + + public static void syncInsertRegionalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RegionalInventoryServiceSettings.Builder regionalInventoryServiceSettingsBuilder = + RegionalInventoryServiceSettings.newBuilder(); + regionalInventoryServiceSettingsBuilder + .insertRegionalInventorySettings() + .setRetrySettings( + regionalInventoryServiceSettingsBuilder + .insertRegionalInventorySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RegionalInventoryServiceSettings regionalInventoryServiceSettings = + regionalInventoryServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryServiceSettings_InsertRegionalInventory_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/stub/localinventoryservicestubsettings/insertlocalinventory/SyncInsertLocalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/stub/localinventoryservicestubsettings/insertlocalinventory/SyncInsertLocalInventory.java new file mode 100644 index 000000000000..4ae76d7096ee --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/stub/localinventoryservicestubsettings/insertlocalinventory/SyncInsertLocalInventory.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub.samples; + +// [START merchantapi_v1beta_generated_LocalInventoryServiceStubSettings_InsertLocalInventory_sync] +import com.google.shopping.merchant.inventories.v1beta.stub.LocalInventoryServiceStubSettings; +import java.time.Duration; + +public class SyncInsertLocalInventory { + + public static void main(String[] args) throws Exception { + syncInsertLocalInventory(); + } + + public static void syncInsertLocalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LocalInventoryServiceStubSettings.Builder localInventoryServiceSettingsBuilder = + LocalInventoryServiceStubSettings.newBuilder(); + localInventoryServiceSettingsBuilder + .insertLocalInventorySettings() + .setRetrySettings( + localInventoryServiceSettingsBuilder + .insertLocalInventorySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + LocalInventoryServiceStubSettings localInventoryServiceSettings = + localInventoryServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_LocalInventoryServiceStubSettings_InsertLocalInventory_sync] diff --git a/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/stub/regionalinventoryservicestubsettings/insertregionalinventory/SyncInsertRegionalInventory.java b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/stub/regionalinventoryservicestubsettings/insertregionalinventory/SyncInsertRegionalInventory.java new file mode 100644 index 000000000000..53f66954f8e6 --- /dev/null +++ b/java-merchantapi/samples/snippets/generated/com/google/shopping/merchant/inventories/v1beta/stub/regionalinventoryservicestubsettings/insertregionalinventory/SyncInsertRegionalInventory.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.shopping.merchant.inventories.v1beta.stub.samples; + +// [START merchantapi_v1beta_generated_RegionalInventoryServiceStubSettings_InsertRegionalInventory_sync] +import com.google.shopping.merchant.inventories.v1beta.stub.RegionalInventoryServiceStubSettings; +import java.time.Duration; + +public class SyncInsertRegionalInventory { + + public static void main(String[] args) throws Exception { + syncInsertRegionalInventory(); + } + + public static void syncInsertRegionalInventory() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + RegionalInventoryServiceStubSettings.Builder regionalInventoryServiceSettingsBuilder = + RegionalInventoryServiceStubSettings.newBuilder(); + regionalInventoryServiceSettingsBuilder + .insertRegionalInventorySettings() + .setRetrySettings( + regionalInventoryServiceSettingsBuilder + .insertRegionalInventorySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RegionalInventoryServiceStubSettings regionalInventoryServiceSettings = + regionalInventoryServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_RegionalInventoryServiceStubSettings_InsertRegionalInventory_sync] diff --git a/pom.xml b/pom.xml index 097d2712bfaf..abf58631aef2 100644 --- a/pom.xml +++ b/pom.xml @@ -111,6 +111,7 @@ java-maps-routing java-mediatranslation java-memcache + java-merchantapi java-migrationcenter java-monitoring-dashboards java-monitoring-metricsscope diff --git a/versions.txt b/versions.txt index 65f6c4fccd0b..8c30dff1c196 100644 --- a/versions.txt +++ b/versions.txt @@ -675,3 +675,6 @@ grpc-google-cloud-infra-manager-v1:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-notebooks-v2:1.22.0:1.23.0-SNAPSHOT grpc-google-cloud-notebooks-v2:1.22.0:1.23.0-SNAPSHOT proto-google-cloud-alloydb-connectors-v1beta:0.2.0:0.3.0-SNAPSHOT +google-shopping-merchant-inventories:0.0.0:0.0.1-SNAPSHOT +proto-google-shopping-merchant-inventories-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-shopping-merchant-inventories-v1beta:0.0.0:0.0.1-SNAPSHOT