From 0dd7a94df8dc254b423104d4a2ce9f6a0687e31d Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:37:15 -0400 Subject: [PATCH] feat: [shopping-merchant-quota] new module for shopping-merchant-quota (#10575) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: [shopping-merchant-quota] new module for shopping-merchant-quota * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- generation_config.yaml | 33 +- java-shopping-merchant-quota/.OwlBot.yaml | 35 + .../.repo-metadata.json | 16 + java-shopping-merchant-quota/README.md | 225 +++ .../pom.xml | 43 + .../google-shopping-merchant-quota/pom.xml | 113 ++ .../quota/v1beta/QuotaServiceClient.java | 463 +++++ .../quota/v1beta/QuotaServiceSettings.java | 209 +++ .../merchant/quota/v1beta/gapic_metadata.json | 21 + .../merchant/quota/v1beta/package-info.java | 45 + .../stub/GrpcQuotaServiceCallableFactory.java | 115 ++ .../v1beta/stub/GrpcQuotaServiceStub.java | 179 ++ .../HttpJsonQuotaServiceCallableFactory.java | 103 ++ .../v1beta/stub/HttpJsonQuotaServiceStub.java | 217 +++ .../quota/v1beta/stub/QuotaServiceStub.java | 49 + .../v1beta/stub/QuotaServiceStubSettings.java | 420 +++++ .../reflect-config.json | 1199 +++++++++++++ .../quota/v1beta/MockQuotaService.java | 59 + .../quota/v1beta/MockQuotaServiceImpl.java | 81 + .../QuotaServiceClientHttpJsonTest.java | 177 ++ .../quota/v1beta/QuotaServiceClientTest.java | 168 ++ .../pom.xml | 45 + .../quota/v1beta/QuotaServiceGrpc.java | 386 +++++ java-shopping-merchant-quota/owlbot.py | 36 + java-shopping-merchant-quota/pom.xml | 55 + .../clirr-ignored-differences.xml | 19 + .../pom.xml | 37 + .../merchant/quota/v1beta/AccountName.java | 168 ++ .../quota/v1beta/ListQuotaGroupsRequest.java | 940 +++++++++++ .../ListQuotaGroupsRequestOrBuilder.java | 98 ++ .../quota/v1beta/ListQuotaGroupsResponse.java | 1216 ++++++++++++++ .../ListQuotaGroupsResponseOrBuilder.java | 120 ++ .../merchant/quota/v1beta/MethodDetails.java | 1179 +++++++++++++ .../quota/v1beta/MethodDetailsOrBuilder.java | 128 ++ .../merchant/quota/v1beta/QuotaGroup.java | 1490 +++++++++++++++++ .../merchant/quota/v1beta/QuotaGroupName.java | 191 +++ .../quota/v1beta/QuotaGroupOrBuilder.java | 159 ++ .../merchant/quota/v1beta/QuotaProto.java | 152 ++ .../merchant/quota/v1beta/quota.proto | 128 ++ .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 39 + .../create/SyncCreateSetEndpoint.java | 41 + .../listquotagroups/AsyncListQuotaGroups.java | 54 + .../AsyncListQuotaGroupsPaged.java | 62 + .../listquotagroups/SyncListQuotaGroups.java | 50 + .../SyncListQuotaGroupsAccountname.java | 44 + .../SyncListQuotaGroupsString.java | 44 + .../listquotagroups/SyncListQuotaGroups.java | 48 + .../listquotagroups/SyncListQuotaGroups.java | 49 + pom.xml | 1 + versions.txt | 3 + 51 files changed, 10991 insertions(+), 5 deletions(-) create mode 100644 java-shopping-merchant-quota/.OwlBot.yaml create mode 100644 java-shopping-merchant-quota/.repo-metadata.json create mode 100644 java-shopping-merchant-quota/README.md create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota-bom/pom.xml create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/pom.xml create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClient.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceSettings.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/gapic_metadata.json create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/package-info.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceCallableFactory.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceStub.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/HttpJsonQuotaServiceCallableFactory.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/HttpJsonQuotaServiceStub.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/QuotaServiceStub.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/QuotaServiceStubSettings.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/resources/META-INF/native-image/com.google.shopping.merchant.quota.v1beta/reflect-config.json create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/MockQuotaService.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/MockQuotaServiceImpl.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClientHttpJsonTest.java create mode 100644 java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClientTest.java create mode 100644 java-shopping-merchant-quota/grpc-google-shopping-merchant-quota-v1beta/pom.xml create mode 100644 java-shopping-merchant-quota/grpc-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceGrpc.java create mode 100644 java-shopping-merchant-quota/owlbot.py create mode 100644 java-shopping-merchant-quota/pom.xml create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/clirr-ignored-differences.xml create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/pom.xml create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/AccountName.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsRequest.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsRequestOrBuilder.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsResponse.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsResponseOrBuilder.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/MethodDetails.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/MethodDetailsOrBuilder.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroup.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroupName.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroupOrBuilder.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaProto.java create mode 100644 java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/proto/google/shopping/merchant/quota/v1beta/quota.proto create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetEndpoint.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/AsyncListQuotaGroups.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/AsyncListQuotaGroupsPaged.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroups.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroupsAccountname.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroupsString.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservicesettings/listquotagroups/SyncListQuotaGroups.java create mode 100644 java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/stub/quotaservicestubsettings/listquotagroups/SyncListQuotaGroups.java diff --git a/generation_config.yaml b/generation_config.yaml index d8fda9de394d..6621544a521c 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -170,7 +170,8 @@ libraries: - api_shortname: apphub name_pretty: App Hub API product_documentation: https://cloud.google.com/app-hub/docs/overview - api_description: App Hub simplifies the process of building, running, and managing applications on Google Cloud. + api_description: App Hub simplifies the process of building, running, and managing + applications on Google Cloud. rpc_documentation: https://cloud.google.com/app-hub/docs/reference/rpc GAPICs: - proto_path: google/cloud/apphub/v1 @@ -446,7 +447,9 @@ libraries: - api_shortname: chat name_pretty: Google Chat API product_documentation: https://developers.google.com/chat/concepts - api_description: The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages. + api_description: The Google Chat API lets you build Chat apps to integrate your + services with Google Chat and manage Chat resources such as spaces, members, and + messages. rest_documentation: https://developers.google.com/chat/api/reference/rest GAPICs: - proto_path: google/chat/v1 @@ -479,7 +482,8 @@ libraries: - api_shortname: cloudcontrolspartner name_pretty: Cloud Controls Partner API product_documentation: https://cloud.google.com/sovereign-controls-by-partners/docs/sovereign-partners - api_description: Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering. + api_description: Provides insights about your customers and their Assured Workloads + based on your Sovereign Controls by Partners offering. GAPICs: - proto_path: google/cloud/cloudcontrolspartner/v1 - proto_path: google/cloud/cloudcontrolspartner/v1beta @@ -1600,7 +1604,10 @@ libraries: - api_shortname: securityposture name_pretty: Security Posture API product_documentation: https://cloud.google.com/security-command-center/docs/security-posture-overview - api_description: Security Posture is a comprehensive framework of policy sets that empowers organizations to define, assess early, deploy, and monitor their security measures in a unified way and helps simplify governance and reduces administrative toil. + api_description: Security Posture is a comprehensive framework of policy sets that + empowers organizations to define, assess early, deploy, and monitor their security + measures in a unified way and helps simplify governance and reduces administrative + toil. GAPICs: - proto_path: google/cloud/securityposture/v1 @@ -1698,6 +1705,21 @@ libraries: GAPICs: - proto_path: google/shopping/merchant/inventories/v1beta +- api_shortname: shopping-merchant-quota + name_pretty: Merchant Quota 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-quota/latest/overview + release_level: preview + distribution_name: com.google.shopping:google-shopping-merchant-quota + api_id: shopping-merchant-quota.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.shopping + cloud_api: false + GAPICs: + - proto_path: google/shopping/merchant/quota/v1beta + requires_billing: true - api_shortname: merchantapi name_pretty: Merchant API product_documentation: https://developers.google.com/merchant/api @@ -2001,7 +2023,8 @@ libraries: - api_shortname: workspaceevents name_pretty: Google Workspace Events API product_documentation: https://developers.google.com/workspace/events - api_description: The Google Workspace Events API lets you subscribe to events and manage change notifications across Google Workspace applications. + api_description: The Google Workspace Events API lets you subscribe to events and + manage change notifications across Google Workspace applications. rest_documentation: https://developers.google.com/workspace/events/reference/rest GAPICs: - proto_path: google/apps/events/subscriptions/v1 diff --git a/java-shopping-merchant-quota/.OwlBot.yaml b/java-shopping-merchant-quota/.OwlBot.yaml new file mode 100644 index 000000000000..7ab8931c801f --- /dev/null +++ b/java-shopping-merchant-quota/.OwlBot.yaml @@ -0,0 +1,35 @@ +# Copyright 2024 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-shopping-merchant-quota/grpc-google-.*/src" +- "/java-shopping-merchant-quota/proto-google-.*/src" +- "/java-shopping-merchant-quota/google-.*/src" +- "/java-shopping-merchant-quota/samples/snippets/generated" + +deep-preserve-regex: +- "/java-shopping-merchant-quota/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/shopping/merchant/quota/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-quota/$1/proto-google-shopping-merchant-quota-$1/src" +- source: "/google/shopping/merchant/quota/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-quota/$1/grpc-google-shopping-merchant-quota-$1/src" +- source: "/google/shopping/merchant/quota/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-shopping-merchant-quota/$1/google-shopping-merchant-quota/src" +- source: "/google/shopping/merchant/quota/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-shopping-merchant-quota/$1/samples/snippets/generated" + +api-name: shopping-merchant-quota \ No newline at end of file diff --git a/java-shopping-merchant-quota/.repo-metadata.json b/java-shopping-merchant-quota/.repo-metadata.json new file mode 100644 index 000000000000..6f445f9d9cbe --- /dev/null +++ b/java-shopping-merchant-quota/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "shopping-merchant-quota", + "name_pretty": "Merchant Quota 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-quota/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-shopping-merchant-quota", + "distribution_name": "com.google.shopping:google-shopping-merchant-quota", + "api_id": "shopping-merchant-quota.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-shopping-merchant-quota/README.md b/java-shopping-merchant-quota/README.md new file mode 100644 index 000000000000..468c2f27b65c --- /dev/null +++ b/java-shopping-merchant-quota/README.md @@ -0,0 +1,225 @@ +# Google Merchant Quota API Client for Java + +Java idiomatic client for [Merchant Quota 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.34.0 + pom + import + + + + + + + com.google.shopping + google-shopping-merchant-quota + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.shopping + google-shopping-merchant-quota + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.shopping:google-shopping-merchant-quota:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.shopping" % "google-shopping-merchant-quota" % "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 Quota API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Merchant Quota API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Merchant Quota API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Merchant Quota 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-quota` library. See the [Quickstart](#quickstart) section +to add `google-shopping-merchant-quota` as a dependency in your code. + +## About Merchant Quota API + + +[Merchant Quota API][product-docs] Programmatically manage your Merchant Center accounts. + +See the [Merchant Quota API client library docs][javadocs] to learn how to +use this Merchant Quota API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Merchant Quota API uses both gRPC and HTTP/JSON 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-quota/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/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-quota.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.shopping/google-shopping-merchant-quota/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/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/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=shopping-merchant-quota.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-shopping-merchant-quota/google-shopping-merchant-quota-bom/pom.xml b/java-shopping-merchant-quota/google-shopping-merchant-quota-bom/pom.xml new file mode 100644 index 000000000000..4b1259599adc --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-quota-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.32.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Merchant Quota API BOM + + BOM for Merchant Quota API + + + + true + + + + + + com.google.shopping + google-shopping-merchant-quota + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-quota-v1beta + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-quota-v1beta + 0.0.1-SNAPSHOT + + + + diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/pom.xml b/java-shopping-merchant-quota/google-shopping-merchant-quota/pom.xml new file mode 100644 index 000000000000..ce57646ee10d --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-quota + 0.0.1-SNAPSHOT + jar + Google Merchant Quota API + Merchant Quota API Programmatically manage your Merchant Center accounts. + + com.google.shopping + google-shopping-merchant-quota-parent + 0.0.1-SNAPSHOT + + + google-shopping-merchant-quota + + + + 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-quota-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-quota-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-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClient.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClient.java new file mode 100644 index 000000000000..597a050aceff --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClient.java @@ -0,0 +1,463 @@ +/* + * Copyright 2024 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.quota.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.shopping.merchant.quota.v1beta.stub.QuotaServiceStub; +import com.google.shopping.merchant.quota.v1beta.stub.QuotaServiceStubSettings; +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 get method call quota information per Merchant API method. + * + *

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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ *   AccountName parent = AccountName.of("[ACCOUNT]");
+ *   for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ * + *

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

ListQuotaGroups

Lists the daily call quota and usage per group for your Merchant Center account.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listQuotaGroups(ListQuotaGroupsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listQuotaGroups(AccountName parent) + *

  • listQuotaGroups(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listQuotaGroupsPagedCallable() + *

  • listQuotaGroupsCallable() + *

+ *
+ * + *

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 QuotaServiceSettings 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
+ * QuotaServiceSettings quotaServiceSettings =
+ *     QuotaServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings);
+ * }
+ * + *

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
+ * QuotaServiceSettings quotaServiceSettings =
+ *     QuotaServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings);
+ * }
+ * + *

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
+ * QuotaServiceSettings quotaServiceSettings = QuotaServiceSettings.newHttpJsonBuilder().build();
+ * QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class QuotaServiceClient implements BackgroundResource { + private final QuotaServiceSettings settings; + private final QuotaServiceStub stub; + + /** Constructs an instance of QuotaServiceClient with default settings. */ + public static final QuotaServiceClient create() throws IOException { + return create(QuotaServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of QuotaServiceClient, 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 QuotaServiceClient create(QuotaServiceSettings settings) throws IOException { + return new QuotaServiceClient(settings); + } + + /** + * Constructs an instance of QuotaServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(QuotaServiceSettings). + */ + public static final QuotaServiceClient create(QuotaServiceStub stub) { + return new QuotaServiceClient(stub); + } + + /** + * Constructs an instance of QuotaServiceClient, 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 QuotaServiceClient(QuotaServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((QuotaServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected QuotaServiceClient(QuotaServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final QuotaServiceSettings getSettings() { + return settings; + } + + public QuotaServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the daily call quota and usage per group for your Merchant Center 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+   *   AccountName parent = AccountName.of("[ACCOUNT]");
+   *   for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The merchant account who owns the collection of method quotas Format: + * accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaGroupsPagedResponse listQuotaGroups(AccountName parent) { + ListQuotaGroupsRequest request = + ListQuotaGroupsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listQuotaGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the daily call quota and usage per group for your Merchant Center 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+   *   String parent = AccountName.of("[ACCOUNT]").toString();
+   *   for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The merchant account who owns the collection of method quotas Format: + * accounts/{account} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaGroupsPagedResponse listQuotaGroups(String parent) { + ListQuotaGroupsRequest request = ListQuotaGroupsRequest.newBuilder().setParent(parent).build(); + return listQuotaGroups(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the daily call quota and usage per group for your Merchant Center 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+   *   ListQuotaGroupsRequest request =
+   *       ListQuotaGroupsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (QuotaGroup element : quotaServiceClient.listQuotaGroups(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 ListQuotaGroupsPagedResponse listQuotaGroups(ListQuotaGroupsRequest request) { + return listQuotaGroupsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the daily call quota and usage per group for your Merchant Center 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+   *   ListQuotaGroupsRequest request =
+   *       ListQuotaGroupsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       quotaServiceClient.listQuotaGroupsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (QuotaGroup element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listQuotaGroupsPagedCallable() { + return stub.listQuotaGroupsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the daily call quota and usage per group for your Merchant Center 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+   *   ListQuotaGroupsRequest request =
+   *       ListQuotaGroupsRequest.newBuilder()
+   *           .setParent(AccountName.of("[ACCOUNT]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListQuotaGroupsResponse response =
+   *         quotaServiceClient.listQuotaGroupsCallable().call(request);
+   *     for (QuotaGroup element : response.getQuotaGroupsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listQuotaGroupsCallable() { + return stub.listQuotaGroupsCallable(); + } + + @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 ListQuotaGroupsPagedResponse + extends AbstractPagedListResponse< + ListQuotaGroupsRequest, + ListQuotaGroupsResponse, + QuotaGroup, + ListQuotaGroupsPage, + ListQuotaGroupsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListQuotaGroupsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListQuotaGroupsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListQuotaGroupsPagedResponse(ListQuotaGroupsPage page) { + super(page, ListQuotaGroupsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListQuotaGroupsPage + extends AbstractPage< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, QuotaGroup, ListQuotaGroupsPage> { + + private ListQuotaGroupsPage( + PageContext context, + ListQuotaGroupsResponse response) { + super(context, response); + } + + private static ListQuotaGroupsPage createEmptyPage() { + return new ListQuotaGroupsPage(null, null); + } + + @Override + protected ListQuotaGroupsPage createPage( + PageContext context, + ListQuotaGroupsResponse response) { + return new ListQuotaGroupsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListQuotaGroupsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListQuotaGroupsRequest, + ListQuotaGroupsResponse, + QuotaGroup, + ListQuotaGroupsPage, + ListQuotaGroupsFixedSizeCollection> { + + private ListQuotaGroupsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListQuotaGroupsFixedSizeCollection createEmptyCollection() { + return new ListQuotaGroupsFixedSizeCollection(null, 0); + } + + @Override + protected ListQuotaGroupsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListQuotaGroupsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceSettings.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceSettings.java new file mode 100644 index 000000000000..5f2aaa6f2618 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceSettings.java @@ -0,0 +1,209 @@ +/* + * Copyright 2024 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.quota.v1beta; + +import static com.google.shopping.merchant.quota.v1beta.QuotaServiceClient.ListQuotaGroupsPagedResponse; + +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.shopping.merchant.quota.v1beta.stub.QuotaServiceStubSettings; +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 QuotaServiceClient}. + * + *

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 listQuotaGroups 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
+ * QuotaServiceSettings.Builder quotaServiceSettingsBuilder = QuotaServiceSettings.newBuilder();
+ * quotaServiceSettingsBuilder
+ *     .listQuotaGroupsSettings()
+ *     .setRetrySettings(
+ *         quotaServiceSettingsBuilder
+ *             .listQuotaGroupsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * QuotaServiceSettings quotaServiceSettings = quotaServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class QuotaServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listQuotaGroups. */ + public PagedCallSettings< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, ListQuotaGroupsPagedResponse> + listQuotaGroupsSettings() { + return ((QuotaServiceStubSettings) getStubSettings()).listQuotaGroupsSettings(); + } + + public static final QuotaServiceSettings create(QuotaServiceStubSettings stub) + throws IOException { + return new QuotaServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return QuotaServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return QuotaServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return QuotaServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return QuotaServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return QuotaServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return QuotaServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return QuotaServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return QuotaServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** 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 QuotaServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for QuotaServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(QuotaServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(QuotaServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(QuotaServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(QuotaServiceStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(QuotaServiceStubSettings.newHttpJsonBuilder()); + } + + public QuotaServiceStubSettings.Builder getStubSettingsBuilder() { + return ((QuotaServiceStubSettings.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 listQuotaGroups. */ + public PagedCallSettings.Builder< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, ListQuotaGroupsPagedResponse> + listQuotaGroupsSettings() { + return getStubSettingsBuilder().listQuotaGroupsSettings(); + } + + @Override + public QuotaServiceSettings build() throws IOException { + return new QuotaServiceSettings(this); + } + } +} diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/gapic_metadata.json b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..789287a73777 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/gapic_metadata.json @@ -0,0 +1,21 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.shopping.merchant.quota.v1beta", + "libraryPackage": "com.google.shopping.merchant.quota.v1beta", + "services": { + "QuotaService": { + "clients": { + "grpc": { + "libraryClient": "QuotaServiceClient", + "rpcs": { + "ListQuotaGroups": { + "methods": ["listQuotaGroups", "listQuotaGroups", "listQuotaGroups", "listQuotaGroupsPagedCallable", "listQuotaGroupsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/package-info.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/package-info.java new file mode 100644 index 000000000000..239191bc67c6 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/package-info.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 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. + * + *

======================= QuotaServiceClient ======================= + * + *

Service Description: Service to get method call quota information per Merchant API method. + * + *

Sample for QuotaServiceClient: + * + *

{@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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) {
+ *   AccountName parent = AccountName.of("[ACCOUNT]");
+ *   for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.shopping.merchant.quota.v1beta; + +import javax.annotation.Generated; diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceCallableFactory.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceCallableFactory.java new file mode 100644 index 000000000000..e9f5d6726685 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2024 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.quota.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 QuotaService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcQuotaServiceCallableFactory 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-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceStub.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceStub.java new file mode 100644 index 000000000000..2c6d0570e87d --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/GrpcQuotaServiceStub.java @@ -0,0 +1,179 @@ +/* + * Copyright 2024 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.quota.v1beta.stub; + +import static com.google.shopping.merchant.quota.v1beta.QuotaServiceClient.ListQuotaGroupsPagedResponse; + +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.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse; +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 QuotaService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcQuotaServiceStub extends QuotaServiceStub { + private static final MethodDescriptor + listQuotaGroupsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.shopping.merchant.quota.v1beta.QuotaService/ListQuotaGroups") + .setRequestMarshaller( + ProtoUtils.marshaller(ListQuotaGroupsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListQuotaGroupsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable + listQuotaGroupsCallable; + private final UnaryCallable + listQuotaGroupsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcQuotaServiceStub create(QuotaServiceStubSettings settings) + throws IOException { + return new GrpcQuotaServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcQuotaServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcQuotaServiceStub(QuotaServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcQuotaServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcQuotaServiceStub( + QuotaServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcQuotaServiceStub, 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 GrpcQuotaServiceStub(QuotaServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcQuotaServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcQuotaServiceStub, 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 GrpcQuotaServiceStub( + QuotaServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listQuotaGroupsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listQuotaGroupsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.listQuotaGroupsCallable = + callableFactory.createUnaryCallable( + listQuotaGroupsTransportSettings, settings.listQuotaGroupsSettings(), clientContext); + this.listQuotaGroupsPagedCallable = + callableFactory.createPagedCallable( + listQuotaGroupsTransportSettings, settings.listQuotaGroupsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listQuotaGroupsCallable() { + return listQuotaGroupsCallable; + } + + @Override + public UnaryCallable + listQuotaGroupsPagedCallable() { + return listQuotaGroupsPagedCallable; + } + + @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-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/HttpJsonQuotaServiceCallableFactory.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/HttpJsonQuotaServiceCallableFactory.java new file mode 100644 index 000000000000..7e6b989ed7e1 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/HttpJsonQuotaServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2024 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.quota.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 QuotaService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonQuotaServiceCallableFactory + 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); + } + + @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-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/HttpJsonQuotaServiceStub.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/HttpJsonQuotaServiceStub.java new file mode 100644 index 000000000000..dcf3f59348e7 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/HttpJsonQuotaServiceStub.java @@ -0,0 +1,217 @@ +/* + * Copyright 2024 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.quota.v1beta.stub; + +import static com.google.shopping.merchant.quota.v1beta.QuotaServiceClient.ListQuotaGroupsPagedResponse; + +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.TypeRegistry; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse; +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 QuotaService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonQuotaServiceStub extends QuotaServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listQuotaGroupsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.shopping.merchant.quota.v1beta.QuotaService/ListQuotaGroups") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/quota/v1beta/{parent=accounts/*}/quotas", + 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(ListQuotaGroupsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + listQuotaGroupsCallable; + private final UnaryCallable + listQuotaGroupsPagedCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonQuotaServiceStub create(QuotaServiceStubSettings settings) + throws IOException { + return new HttpJsonQuotaServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonQuotaServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonQuotaServiceStub( + QuotaServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonQuotaServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonQuotaServiceStub( + QuotaServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonQuotaServiceStub, 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 HttpJsonQuotaServiceStub(QuotaServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonQuotaServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonQuotaServiceStub, 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 HttpJsonQuotaServiceStub( + QuotaServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listQuotaGroupsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listQuotaGroupsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + + this.listQuotaGroupsCallable = + callableFactory.createUnaryCallable( + listQuotaGroupsTransportSettings, settings.listQuotaGroupsSettings(), clientContext); + this.listQuotaGroupsPagedCallable = + callableFactory.createPagedCallable( + listQuotaGroupsTransportSettings, settings.listQuotaGroupsSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listQuotaGroupsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listQuotaGroupsCallable() { + return listQuotaGroupsCallable; + } + + @Override + public UnaryCallable + listQuotaGroupsPagedCallable() { + return listQuotaGroupsPagedCallable; + } + + @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-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/QuotaServiceStub.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/QuotaServiceStub.java new file mode 100644 index 000000000000..f9a65c728b89 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/QuotaServiceStub.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 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.quota.v1beta.stub; + +import static com.google.shopping.merchant.quota.v1beta.QuotaServiceClient.ListQuotaGroupsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the QuotaService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class QuotaServiceStub implements BackgroundResource { + + public UnaryCallable + listQuotaGroupsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaGroupsPagedCallable()"); + } + + public UnaryCallable listQuotaGroupsCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaGroupsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/QuotaServiceStubSettings.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/QuotaServiceStubSettings.java new file mode 100644 index 000000000000..62778fb5152e --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/java/com/google/shopping/merchant/quota/v1beta/stub/QuotaServiceStubSettings.java @@ -0,0 +1,420 @@ +/* + * Copyright 2024 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.quota.v1beta.stub; + +import static com.google.shopping.merchant.quota.v1beta.QuotaServiceClient.ListQuotaGroupsPagedResponse; + +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.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse; +import com.google.shopping.merchant.quota.v1beta.QuotaGroup; +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 QuotaServiceStub}. + * + *

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 listQuotaGroups 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
+ * QuotaServiceStubSettings.Builder quotaServiceSettingsBuilder =
+ *     QuotaServiceStubSettings.newBuilder();
+ * quotaServiceSettingsBuilder
+ *     .listQuotaGroupsSettings()
+ *     .setRetrySettings(
+ *         quotaServiceSettingsBuilder
+ *             .listQuotaGroupsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * QuotaServiceStubSettings quotaServiceSettings = quotaServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class QuotaServiceStubSettings 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< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, ListQuotaGroupsPagedResponse> + listQuotaGroupsSettings; + + private static final PagedListDescriptor< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, QuotaGroup> + LIST_QUOTA_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListQuotaGroupsRequest injectToken( + ListQuotaGroupsRequest payload, String token) { + return ListQuotaGroupsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListQuotaGroupsRequest injectPageSize( + ListQuotaGroupsRequest payload, int pageSize) { + return ListQuotaGroupsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListQuotaGroupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListQuotaGroupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListQuotaGroupsResponse payload) { + return payload.getQuotaGroupsList() == null + ? ImmutableList.of() + : payload.getQuotaGroupsList(); + } + }; + + private static final PagedListResponseFactory< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, ListQuotaGroupsPagedResponse> + LIST_QUOTA_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, ListQuotaGroupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListQuotaGroupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_QUOTA_GROUPS_PAGE_STR_DESC, request, context); + return ListQuotaGroupsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listQuotaGroups. */ + public PagedCallSettings< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, ListQuotaGroupsPagedResponse> + listQuotaGroupsSettings() { + return listQuotaGroupsSettings; + } + + public QuotaServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcQuotaServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonQuotaServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "merchantapi"; + } + + /** 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(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(QuotaServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(QuotaServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return QuotaServiceStubSettings.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 QuotaServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listQuotaGroupsSettings = settingsBuilder.listQuotaGroupsSettings().build(); + } + + /** Builder for QuotaServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, ListQuotaGroupsPagedResponse> + listQuotaGroupsSettings; + 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); + + listQuotaGroupsSettings = PagedCallSettings.newBuilder(LIST_QUOTA_GROUPS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(listQuotaGroupsSettings); + initDefaults(this); + } + + protected Builder(QuotaServiceStubSettings settings) { + super(settings); + + listQuotaGroupsSettings = settings.listQuotaGroupsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(listQuotaGroupsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + 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.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listQuotaGroupsSettings() + .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 listQuotaGroups. */ + public PagedCallSettings.Builder< + ListQuotaGroupsRequest, ListQuotaGroupsResponse, ListQuotaGroupsPagedResponse> + listQuotaGroupsSettings() { + return listQuotaGroupsSettings; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public QuotaServiceStubSettings build() throws IOException { + return new QuotaServiceStubSettings(this); + } + } +} diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/resources/META-INF/native-image/com.google.shopping.merchant.quota.v1beta/reflect-config.json b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/resources/META-INF/native-image/com.google.shopping.merchant.quota.v1beta/reflect-config.json new file mode 100644 index 000000000000..fe2f955d0b64 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/main/resources/META-INF/native-image/com.google.shopping.merchant.quota.v1beta/reflect-config.json @@ -0,0 +1,1199 @@ +[ + { + "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$Edition", + "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$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "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$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "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.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.quota.v1beta.MethodDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.quota.v1beta.MethodDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.quota.v1beta.QuotaGroup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.shopping.merchant.quota.v1beta.QuotaGroup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/MockQuotaService.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/MockQuotaService.java new file mode 100644 index 000000000000..8b19a9190fb4 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/MockQuotaService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 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.quota.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 MockQuotaService implements MockGrpcService { + private final MockQuotaServiceImpl serviceImpl; + + public MockQuotaService() { + serviceImpl = new MockQuotaServiceImpl(); + } + + @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-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/MockQuotaServiceImpl.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/MockQuotaServiceImpl.java new file mode 100644 index 000000000000..8216604a2066 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/MockQuotaServiceImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2024 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.quota.v1beta; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceGrpc.QuotaServiceImplBase; +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 MockQuotaServiceImpl extends QuotaServiceImplBase { + private List requests; + private Queue responses; + + public MockQuotaServiceImpl() { + 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 listQuotaGroups( + ListQuotaGroupsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListQuotaGroupsResponse) { + requests.add(request); + responseObserver.onNext(((ListQuotaGroupsResponse) 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 ListQuotaGroups, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListQuotaGroupsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClientHttpJsonTest.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..15b5b2b34a5a --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClientHttpJsonTest.java @@ -0,0 +1,177 @@ +/* + * Copyright 2024 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.quota.v1beta; + +import static com.google.shopping.merchant.quota.v1beta.QuotaServiceClient.ListQuotaGroupsPagedResponse; + +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.shopping.merchant.quota.v1beta.stub.HttpJsonQuotaServiceStub; +import java.io.IOException; +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 QuotaServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static QuotaServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonQuotaServiceStub.getMethodDescriptors(), + QuotaServiceSettings.getDefaultEndpoint()); + QuotaServiceSettings settings = + QuotaServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + QuotaServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = QuotaServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listQuotaGroupsTest() throws Exception { + QuotaGroup responsesElement = QuotaGroup.newBuilder().build(); + ListQuotaGroupsResponse expectedResponse = + ListQuotaGroupsResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaGroups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListQuotaGroupsPagedResponse pagedListResponse = client.listQuotaGroups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaGroupsList().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 listQuotaGroupsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listQuotaGroups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaGroupsTest2() throws Exception { + QuotaGroup responsesElement = QuotaGroup.newBuilder().build(); + ListQuotaGroupsResponse expectedResponse = + ListQuotaGroupsResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaGroups(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "accounts/account-4811"; + + ListQuotaGroupsPagedResponse pagedListResponse = client.listQuotaGroups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaGroupsList().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 listQuotaGroupsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "accounts/account-4811"; + client.listQuotaGroups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClientTest.java b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClientTest.java new file mode 100644 index 000000000000..7674e58527e7 --- /dev/null +++ b/java-shopping-merchant-quota/google-shopping-merchant-quota/src/test/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceClientTest.java @@ -0,0 +1,168 @@ +/* + * Copyright 2024 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.quota.v1beta; + +import static com.google.shopping.merchant.quota.v1beta.QuotaServiceClient.ListQuotaGroupsPagedResponse; + +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 io.grpc.StatusRuntimeException; +import java.io.IOException; +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 QuotaServiceClientTest { + private static MockQuotaService mockQuotaService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private QuotaServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockQuotaService = new MockQuotaService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockQuotaService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + QuotaServiceSettings settings = + QuotaServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = QuotaServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listQuotaGroupsTest() throws Exception { + QuotaGroup responsesElement = QuotaGroup.newBuilder().build(); + ListQuotaGroupsResponse expectedResponse = + ListQuotaGroupsResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaGroups(Arrays.asList(responsesElement)) + .build(); + mockQuotaService.addResponse(expectedResponse); + + AccountName parent = AccountName.of("[ACCOUNT]"); + + ListQuotaGroupsPagedResponse pagedListResponse = client.listQuotaGroups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaGroupsList().get(0), resources.get(0)); + + List actualRequests = mockQuotaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaGroupsRequest actualRequest = ((ListQuotaGroupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaGroupsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockQuotaService.addException(exception); + + try { + AccountName parent = AccountName.of("[ACCOUNT]"); + client.listQuotaGroups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaGroupsTest2() throws Exception { + QuotaGroup responsesElement = QuotaGroup.newBuilder().build(); + ListQuotaGroupsResponse expectedResponse = + ListQuotaGroupsResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaGroups(Arrays.asList(responsesElement)) + .build(); + mockQuotaService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListQuotaGroupsPagedResponse pagedListResponse = client.listQuotaGroups(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaGroupsList().get(0), resources.get(0)); + + List actualRequests = mockQuotaService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaGroupsRequest actualRequest = ((ListQuotaGroupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaGroupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockQuotaService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listQuotaGroups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-shopping-merchant-quota/grpc-google-shopping-merchant-quota-v1beta/pom.xml b/java-shopping-merchant-quota/grpc-google-shopping-merchant-quota-v1beta/pom.xml new file mode 100644 index 000000000000..0a4a5d5be87f --- /dev/null +++ b/java-shopping-merchant-quota/grpc-google-shopping-merchant-quota-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.shopping.api.grpc + grpc-google-shopping-merchant-quota-v1beta + 0.0.1-SNAPSHOT + grpc-google-shopping-merchant-quota-v1beta + GRPC library for google-shopping-merchant-quota + + com.google.shopping + google-shopping-merchant-quota-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-quota-v1beta + + + com.google.guava + guava + + + diff --git a/java-shopping-merchant-quota/grpc-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceGrpc.java b/java-shopping-merchant-quota/grpc-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceGrpc.java new file mode 100644 index 000000000000..f5b7ea5e23a2 --- /dev/null +++ b/java-shopping-merchant-quota/grpc-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaServiceGrpc.java @@ -0,0 +1,386 @@ +/* + * Copyright 2024 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.quota.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service to get method call quota information per Merchant API method.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/shopping/merchant/quota/v1beta/quota.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class QuotaServiceGrpc { + + private QuotaServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.shopping.merchant.quota.v1beta.QuotaService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest, + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse> + getListQuotaGroupsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListQuotaGroups", + requestType = com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest.class, + responseType = com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest, + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse> + getListQuotaGroupsMethod() { + io.grpc.MethodDescriptor< + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest, + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse> + getListQuotaGroupsMethod; + if ((getListQuotaGroupsMethod = QuotaServiceGrpc.getListQuotaGroupsMethod) == null) { + synchronized (QuotaServiceGrpc.class) { + if ((getListQuotaGroupsMethod = QuotaServiceGrpc.getListQuotaGroupsMethod) == null) { + QuotaServiceGrpc.getListQuotaGroupsMethod = + getListQuotaGroupsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListQuotaGroups")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new QuotaServiceMethodDescriptorSupplier("ListQuotaGroups")) + .build(); + } + } + } + return getListQuotaGroupsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static QuotaServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaServiceStub(channel, callOptions); + } + }; + return QuotaServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static QuotaServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaServiceBlockingStub(channel, callOptions); + } + }; + return QuotaServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static QuotaServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public QuotaServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaServiceFutureStub(channel, callOptions); + } + }; + return QuotaServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service to get method call quota information per Merchant API method.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists the daily call quota and usage per group for your Merchant
+     * Center account.
+     * 
+ */ + default void listQuotaGroups( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListQuotaGroupsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service QuotaService. + * + *
+   * Service to get method call quota information per Merchant API method.
+   * 
+ */ + public abstract static class QuotaServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return QuotaServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service QuotaService. + * + *
+   * Service to get method call quota information per Merchant API method.
+   * 
+ */ + public static final class QuotaServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private QuotaServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the daily call quota and usage per group for your Merchant
+     * Center account.
+     * 
+ */ + public void listQuotaGroups( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest request, + io.grpc.stub.StreamObserver< + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListQuotaGroupsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service QuotaService. + * + *
+   * Service to get method call quota information per Merchant API method.
+   * 
+ */ + public static final class QuotaServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private QuotaServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the daily call quota and usage per group for your Merchant
+     * Center account.
+     * 
+ */ + public com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse listQuotaGroups( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListQuotaGroupsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service QuotaService. + * + *
+   * Service to get method call quota information per Merchant API method.
+   * 
+ */ + public static final class QuotaServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private QuotaServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected QuotaServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new QuotaServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists the daily call quota and usage per group for your Merchant
+     * Center account.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse> + listQuotaGroups(com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListQuotaGroupsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_QUOTA_GROUPS = 0; + + 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_QUOTA_GROUPS: + serviceImpl.listQuotaGroups( + (com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse>) + 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( + getListQuotaGroupsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest, + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse>( + service, METHODID_LIST_QUOTA_GROUPS))) + .build(); + } + + private abstract static class QuotaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + QuotaServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("QuotaService"); + } + } + + private static final class QuotaServiceFileDescriptorSupplier + extends QuotaServiceBaseDescriptorSupplier { + QuotaServiceFileDescriptorSupplier() {} + } + + private static final class QuotaServiceMethodDescriptorSupplier + extends QuotaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + QuotaServiceMethodDescriptorSupplier(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 (QuotaServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new QuotaServiceFileDescriptorSupplier()) + .addMethod(getListQuotaGroupsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-shopping-merchant-quota/owlbot.py b/java-shopping-merchant-quota/owlbot.py new file mode 100644 index 000000000000..c2c142892a23 --- /dev/null +++ b/java-shopping-merchant-quota/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2024 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-shopping-merchant-quota/pom.xml b/java-shopping-merchant-quota/pom.xml new file mode 100644 index 000000000000..73dfb10184b1 --- /dev/null +++ b/java-shopping-merchant-quota/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.shopping + google-shopping-merchant-quota-parent + pom + 0.0.1-SNAPSHOT + Google Merchant Quota API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.32.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-shopping-merchant-quota-parent + + + + + + com.google.shopping + google-shopping-merchant-quota + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + grpc-google-shopping-merchant-quota-v1beta + 0.0.1-SNAPSHOT + + + com.google.shopping.api.grpc + proto-google-shopping-merchant-quota-v1beta + 0.0.1-SNAPSHOT + + + + + + + google-shopping-merchant-quota + grpc-google-shopping-merchant-quota-v1beta + proto-google-shopping-merchant-quota-v1beta + google-shopping-merchant-quota-bom + + + diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/clirr-ignored-differences.xml b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..a6bfafbedadf --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/shopping/merchant/quota/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/shopping/merchant/quota/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/shopping/merchant/quota/v1beta/*OrBuilder + boolean has*(*) + + diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/pom.xml b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/pom.xml new file mode 100644 index 000000000000..485f7e50473a --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.shopping.api.grpc + proto-google-shopping-merchant-quota-v1beta + 0.0.1-SNAPSHOT + proto-google-shopping-merchant-quota-v1beta + Proto library for google-shopping-merchant-quota + + com.google.shopping + google-shopping-merchant-quota-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-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/AccountName.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/AccountName.java new file mode 100644 index 000000000000..c7bb70333f58 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/AccountName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2024 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.quota.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 AccountName implements ResourceName { + private static final PathTemplate ACCOUNT = + PathTemplate.createWithoutUrlEncoding("accounts/{account}"); + private volatile Map fieldValuesMap; + private final String account; + + @Deprecated + protected AccountName() { + account = null; + } + + private AccountName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + } + + public String getAccount() { + return account; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AccountName of(String account) { + return newBuilder().setAccount(account).build(); + } + + public static String format(String account) { + return newBuilder().setAccount(account).build().toString(); + } + + public static AccountName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT.validatedMatch( + formattedString, "AccountName.parse: formattedString not in valid format"); + return of(matchMap.get("account")); + } + + 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 (AccountName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT.instantiate("account", account); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AccountName that = ((AccountName) o); + return Objects.equals(this.account, that.account); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + return h; + } + + /** Builder for accounts/{account}. */ + public static class Builder { + private String account; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + private Builder(AccountName accountName) { + this.account = accountName.account; + } + + public AccountName build() { + return new AccountName(this); + } + } +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsRequest.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsRequest.java new file mode 100644 index 000000000000..abf923725384 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsRequest.java @@ -0,0 +1,940 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +/** + * + * + *
+ * Request message for the ListQuotaGroups method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest} + */ +public final class ListQuotaGroupsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest) + ListQuotaGroupsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaGroupsRequest.newBuilder() to construct. + private ListQuotaGroupsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaGroupsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaGroupsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest.class, + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The merchant account who owns the collection of method quotas
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 merchant account who owns the collection of method quotas
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + /** + * + * + *
+   * Optional. The maximum number of quotas to return in the response, used
+   * for paging. Defaults to 500; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ = ""; + /** + * + * + *
+   * Optional. Token (if provided) to retrieve the subsequent page. All other
+   * parameters must match the original call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Token (if provided) to retrieve the subsequent page. All other
+   * parameters must match the original call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.quota.v1beta.ListQuotaGroupsRequest)) { + return super.equals(obj); + } + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest other = + (com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest) 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.quota.v1beta.ListQuotaGroupsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest 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.quota.v1beta.ListQuotaGroupsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest 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.quota.v1beta.ListQuotaGroupsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest 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.quota.v1beta.ListQuotaGroupsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest 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.quota.v1beta.ListQuotaGroupsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest 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.quota.v1beta.ListQuotaGroupsRequest 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 ListQuotaGroups method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest) + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest.class, + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest.Builder.class); + } + + // Construct using com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest.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.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest + getDefaultInstanceForType() { + return com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest build() { + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest buildPartial() { + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest result = + new com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest 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.quota.v1beta.ListQuotaGroupsRequest) { + return mergeFrom((com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest other) { + if (other + == com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest.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 merchant account who owns the collection of method quotas
+     * Format: accounts/{account}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 merchant account who owns the collection of method quotas
+     * Format: accounts/{account}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 merchant account who owns the collection of method quotas
+     * Format: accounts/{account}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 merchant account who owns the collection of method quotas
+     * Format: accounts/{account}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The merchant account who owns the collection of method quotas
+     * Format: accounts/{account}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_; + /** + * + * + *
+     * Optional. The maximum number of quotas to return in the response, used
+     * for paging. Defaults to 500; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of quotas to return in the response, used
+     * for paging. Defaults to 500; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of quotas to return in the response, used
+     * for paging. Defaults to 500; values above 1000 will be coerced to 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. Token (if provided) to retrieve the subsequent page. All other
+     * parameters must match the original call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Token (if provided) to retrieve the subsequent page. All other
+     * parameters must match the original call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Token (if provided) to retrieve the subsequent page. All other
+     * parameters must match the original call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. Token (if provided) to retrieve the subsequent page. All other
+     * parameters must match the original call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Token (if provided) to retrieve the subsequent page. All other
+     * parameters must match the original call that provided the page token.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.quota.v1beta.ListQuotaGroupsRequest) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest) + private static final com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest(); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaGroupsRequest 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.quota.v1beta.ListQuotaGroupsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsRequestOrBuilder.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsRequestOrBuilder.java new file mode 100644 index 000000000000..1e548726d321 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +public interface ListQuotaGroupsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The merchant account who owns the collection of method quotas
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The merchant account who owns the collection of method quotas
+   * Format: accounts/{account}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of quotas to return in the response, used
+   * for paging. Defaults to 500; values above 1000 will be coerced to 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. Token (if provided) to retrieve the subsequent page. All other
+   * parameters must match the original call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. Token (if provided) to retrieve the subsequent page. All other
+   * parameters must match the original call that provided the page token.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsResponse.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsResponse.java new file mode 100644 index 000000000000..8f6704e505cb --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsResponse.java @@ -0,0 +1,1216 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +/** + * + * + *
+ * Response message for the ListMethodGroups method.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse} + */ +public final class ListQuotaGroupsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse) + ListQuotaGroupsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaGroupsResponse.newBuilder() to construct. + private ListQuotaGroupsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaGroupsResponse() { + quotaGroups_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaGroupsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse.class, + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse.Builder.class); + } + + public static final int QUOTA_GROUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List quotaGroups_; + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + @java.lang.Override + public java.util.List getQuotaGroupsList() { + return quotaGroups_; + } + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + @java.lang.Override + public java.util.List + getQuotaGroupsOrBuilderList() { + return quotaGroups_; + } + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + @java.lang.Override + public int getQuotaGroupsCount() { + return quotaGroups_.size(); + } + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.QuotaGroup getQuotaGroups(int index) { + return quotaGroups_.get(index); + } + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.QuotaGroupOrBuilder getQuotaGroupsOrBuilder( + int index) { + return quotaGroups_.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 `page_token` 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 `page_token` 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 < quotaGroups_.size(); i++) { + output.writeMessage(1, quotaGroups_.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 < quotaGroups_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, quotaGroups_.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.quota.v1beta.ListQuotaGroupsResponse)) { + return super.equals(obj); + } + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse other = + (com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse) obj; + + if (!getQuotaGroupsList().equals(other.getQuotaGroupsList())) 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 (getQuotaGroupsCount() > 0) { + hash = (37 * hash) + QUOTA_GROUPS_FIELD_NUMBER; + hash = (53 * hash) + getQuotaGroupsList().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.quota.v1beta.ListQuotaGroupsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse 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.quota.v1beta.ListQuotaGroupsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse 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.quota.v1beta.ListQuotaGroupsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse 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.quota.v1beta.ListQuotaGroupsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse + 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.quota.v1beta.ListQuotaGroupsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse 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.quota.v1beta.ListQuotaGroupsResponse 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 ListMethodGroups method.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse) + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse.class, + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse.Builder.class); + } + + // Construct using + // com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (quotaGroupsBuilder_ == null) { + quotaGroups_ = java.util.Collections.emptyList(); + } else { + quotaGroups_ = null; + quotaGroupsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse + getDefaultInstanceForType() { + return com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse build() { + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse buildPartial() { + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse result = + new com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse result) { + if (quotaGroupsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + quotaGroups_ = java.util.Collections.unmodifiableList(quotaGroups_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.quotaGroups_ = quotaGroups_; + } else { + result.quotaGroups_ = quotaGroupsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse 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.quota.v1beta.ListQuotaGroupsResponse) { + return mergeFrom((com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse other) { + if (other + == com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse.getDefaultInstance()) + return this; + if (quotaGroupsBuilder_ == null) { + if (!other.quotaGroups_.isEmpty()) { + if (quotaGroups_.isEmpty()) { + quotaGroups_ = other.quotaGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQuotaGroupsIsMutable(); + quotaGroups_.addAll(other.quotaGroups_); + } + onChanged(); + } + } else { + if (!other.quotaGroups_.isEmpty()) { + if (quotaGroupsBuilder_.isEmpty()) { + quotaGroupsBuilder_.dispose(); + quotaGroupsBuilder_ = null; + quotaGroups_ = other.quotaGroups_; + bitField0_ = (bitField0_ & ~0x00000001); + quotaGroupsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQuotaGroupsFieldBuilder() + : null; + } else { + quotaGroupsBuilder_.addAllMessages(other.quotaGroups_); + } + } + } + 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.quota.v1beta.QuotaGroup m = + input.readMessage( + com.google.shopping.merchant.quota.v1beta.QuotaGroup.parser(), + extensionRegistry); + if (quotaGroupsBuilder_ == null) { + ensureQuotaGroupsIsMutable(); + quotaGroups_.add(m); + } else { + quotaGroupsBuilder_.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 quotaGroups_ = + java.util.Collections.emptyList(); + + private void ensureQuotaGroupsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + quotaGroups_ = + new java.util.ArrayList( + quotaGroups_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.quota.v1beta.QuotaGroup, + com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder, + com.google.shopping.merchant.quota.v1beta.QuotaGroupOrBuilder> + quotaGroupsBuilder_; + + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public java.util.List + getQuotaGroupsList() { + if (quotaGroupsBuilder_ == null) { + return java.util.Collections.unmodifiableList(quotaGroups_); + } else { + return quotaGroupsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public int getQuotaGroupsCount() { + if (quotaGroupsBuilder_ == null) { + return quotaGroups_.size(); + } else { + return quotaGroupsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public com.google.shopping.merchant.quota.v1beta.QuotaGroup getQuotaGroups(int index) { + if (quotaGroupsBuilder_ == null) { + return quotaGroups_.get(index); + } else { + return quotaGroupsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder setQuotaGroups( + int index, com.google.shopping.merchant.quota.v1beta.QuotaGroup value) { + if (quotaGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaGroupsIsMutable(); + quotaGroups_.set(index, value); + onChanged(); + } else { + quotaGroupsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder setQuotaGroups( + int index, com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder builderForValue) { + if (quotaGroupsBuilder_ == null) { + ensureQuotaGroupsIsMutable(); + quotaGroups_.set(index, builderForValue.build()); + onChanged(); + } else { + quotaGroupsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder addQuotaGroups(com.google.shopping.merchant.quota.v1beta.QuotaGroup value) { + if (quotaGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaGroupsIsMutable(); + quotaGroups_.add(value); + onChanged(); + } else { + quotaGroupsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder addQuotaGroups( + int index, com.google.shopping.merchant.quota.v1beta.QuotaGroup value) { + if (quotaGroupsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaGroupsIsMutable(); + quotaGroups_.add(index, value); + onChanged(); + } else { + quotaGroupsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder addQuotaGroups( + com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder builderForValue) { + if (quotaGroupsBuilder_ == null) { + ensureQuotaGroupsIsMutable(); + quotaGroups_.add(builderForValue.build()); + onChanged(); + } else { + quotaGroupsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder addQuotaGroups( + int index, com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder builderForValue) { + if (quotaGroupsBuilder_ == null) { + ensureQuotaGroupsIsMutable(); + quotaGroups_.add(index, builderForValue.build()); + onChanged(); + } else { + quotaGroupsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder addAllQuotaGroups( + java.lang.Iterable values) { + if (quotaGroupsBuilder_ == null) { + ensureQuotaGroupsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, quotaGroups_); + onChanged(); + } else { + quotaGroupsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder clearQuotaGroups() { + if (quotaGroupsBuilder_ == null) { + quotaGroups_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + quotaGroupsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public Builder removeQuotaGroups(int index) { + if (quotaGroupsBuilder_ == null) { + ensureQuotaGroupsIsMutable(); + quotaGroups_.remove(index); + onChanged(); + } else { + quotaGroupsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder getQuotaGroupsBuilder( + int index) { + return getQuotaGroupsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public com.google.shopping.merchant.quota.v1beta.QuotaGroupOrBuilder getQuotaGroupsOrBuilder( + int index) { + if (quotaGroupsBuilder_ == null) { + return quotaGroups_.get(index); + } else { + return quotaGroupsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public java.util.List + getQuotaGroupsOrBuilderList() { + if (quotaGroupsBuilder_ != null) { + return quotaGroupsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(quotaGroups_); + } + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder addQuotaGroupsBuilder() { + return getQuotaGroupsFieldBuilder() + .addBuilder(com.google.shopping.merchant.quota.v1beta.QuotaGroup.getDefaultInstance()); + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder addQuotaGroupsBuilder( + int index) { + return getQuotaGroupsFieldBuilder() + .addBuilder( + index, com.google.shopping.merchant.quota.v1beta.QuotaGroup.getDefaultInstance()); + } + /** + * + * + *
+     * The methods, current quota usage and limits per each group. The quota is
+     * shared between all methods in the group. The groups are sorted in
+     * descending order based on
+     * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+     * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + public java.util.List + getQuotaGroupsBuilderList() { + return getQuotaGroupsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.quota.v1beta.QuotaGroup, + com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder, + com.google.shopping.merchant.quota.v1beta.QuotaGroupOrBuilder> + getQuotaGroupsFieldBuilder() { + if (quotaGroupsBuilder_ == null) { + quotaGroupsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.quota.v1beta.QuotaGroup, + com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder, + com.google.shopping.merchant.quota.v1beta.QuotaGroupOrBuilder>( + quotaGroups_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + quotaGroups_ = null; + } + return quotaGroupsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` 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 `page_token` 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 `page_token` 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 `page_token` 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 `page_token` 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.quota.v1beta.ListQuotaGroupsResponse) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse) + private static final com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse(); + } + + public static com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaGroupsResponse 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.quota.v1beta.ListQuotaGroupsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsResponseOrBuilder.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsResponseOrBuilder.java new file mode 100644 index 000000000000..9b3671625d93 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/ListQuotaGroupsResponseOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +public interface ListQuotaGroupsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + java.util.List getQuotaGroupsList(); + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + com.google.shopping.merchant.quota.v1beta.QuotaGroup getQuotaGroups(int index); + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + int getQuotaGroupsCount(); + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + java.util.List + getQuotaGroupsOrBuilderList(); + /** + * + * + *
+   * The methods, current quota usage and limits per each group. The quota is
+   * shared between all methods in the group. The groups are sorted in
+   * descending order based on
+   * [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage].
+   * 
+ * + * repeated .google.shopping.merchant.quota.v1beta.QuotaGroup quota_groups = 1; + */ + com.google.shopping.merchant.quota.v1beta.QuotaGroupOrBuilder getQuotaGroupsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` 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 `page_token` 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-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/MethodDetails.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/MethodDetails.java new file mode 100644 index 000000000000..176e32d83a04 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/MethodDetails.java @@ -0,0 +1,1179 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +/** + * + * + *
+ * The method details per method in the Merchant API.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.quota.v1beta.MethodDetails} + */ +public final class MethodDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.quota.v1beta.MethodDetails) + MethodDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use MethodDetails.newBuilder() to construct. + private MethodDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MethodDetails() { + method_ = ""; + version_ = ""; + subapi_ = ""; + path_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MethodDetails(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.quota.v1beta.MethodDetails.class, + com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder.class); + } + + public static final int METHOD_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object method_ = ""; + /** + * + * + *
+   * Output only. The name of the method for example `products.list`.
+   * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The method. + */ + @java.lang.Override + public java.lang.String getMethod() { + java.lang.Object ref = method_; + 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(); + method_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the method for example `products.list`.
+   * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for method. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object version_ = ""; + /** + * + * + *
+   * Output only. The API version that the method belongs to.
+   * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The API version that the method belongs to.
+   * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUBAPI_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object subapi_ = ""; + /** + * + * + *
+   * Output only. The sub-API that the method belongs to.
+   * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The subapi. + */ + @java.lang.Override + public java.lang.String getSubapi() { + java.lang.Object ref = subapi_; + 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(); + subapi_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The sub-API that the method belongs to.
+   * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for subapi. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSubapiBytes() { + java.lang.Object ref = subapi_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subapi_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object path_ = ""; + /** + * + * + *
+   * Output only. The path for the method such as
+   * `products/v1/productInputs.insert`
+   * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + 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(); + path_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The path for the method such as
+   * `products/v1/productInputs.insert`
+   * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = 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(method_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subapi_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, subapi_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, path_); + } + 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(method_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subapi_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, subapi_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, path_); + } + 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.quota.v1beta.MethodDetails)) { + return super.equals(obj); + } + com.google.shopping.merchant.quota.v1beta.MethodDetails other = + (com.google.shopping.merchant.quota.v1beta.MethodDetails) obj; + + if (!getMethod().equals(other.getMethod())) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (!getSubapi().equals(other.getSubapi())) return false; + if (!getPath().equals(other.getPath())) 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) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + SUBAPI_FIELD_NUMBER; + hash = (53 * hash) + getSubapi().hashCode(); + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails 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.quota.v1beta.MethodDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails 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.quota.v1beta.MethodDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails 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.quota.v1beta.MethodDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails 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.quota.v1beta.MethodDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails 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.quota.v1beta.MethodDetails 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 method details per method in the Merchant API.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.quota.v1beta.MethodDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.quota.v1beta.MethodDetails) + com.google.shopping.merchant.quota.v1beta.MethodDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.quota.v1beta.MethodDetails.class, + com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder.class); + } + + // Construct using com.google.shopping.merchant.quota.v1beta.MethodDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + method_ = ""; + version_ = ""; + subapi_ = ""; + path_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.MethodDetails getDefaultInstanceForType() { + return com.google.shopping.merchant.quota.v1beta.MethodDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.MethodDetails build() { + com.google.shopping.merchant.quota.v1beta.MethodDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.MethodDetails buildPartial() { + com.google.shopping.merchant.quota.v1beta.MethodDetails result = + new com.google.shopping.merchant.quota.v1beta.MethodDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.merchant.quota.v1beta.MethodDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.method_ = method_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.version_ = version_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.subapi_ = subapi_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.path_ = path_; + } + } + + @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.quota.v1beta.MethodDetails) { + return mergeFrom((com.google.shopping.merchant.quota.v1beta.MethodDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.merchant.quota.v1beta.MethodDetails other) { + if (other == com.google.shopping.merchant.quota.v1beta.MethodDetails.getDefaultInstance()) + return this; + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getSubapi().isEmpty()) { + subapi_ = other.subapi_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getPath().isEmpty()) { + path_ = other.path_; + bitField0_ |= 0x00000008; + 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: + { + method_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + version_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + subapi_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + path_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + 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 method_ = ""; + /** + * + * + *
+     * Output only. The name of the method for example `products.list`.
+     * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The method. + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the method for example `products.list`.
+     * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for method. + */ + public com.google.protobuf.ByteString getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the method for example `products.list`.
+     * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the method for example `products.list`.
+     * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMethod() { + method_ = getDefaultInstance().getMethod(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the method for example `products.list`.
+     * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for method to set. + * @return This builder for chaining. + */ + public Builder setMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + method_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * Output only. The API version that the method belongs to.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The API version that the method belongs to.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The API version that the method belongs to.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The API version that the method belongs to.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + version_ = getDefaultInstance().getVersion(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The API version that the method belongs to.
+     * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + version_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object subapi_ = ""; + /** + * + * + *
+     * Output only. The sub-API that the method belongs to.
+     * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The subapi. + */ + public java.lang.String getSubapi() { + java.lang.Object ref = subapi_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subapi_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The sub-API that the method belongs to.
+     * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for subapi. + */ + public com.google.protobuf.ByteString getSubapiBytes() { + java.lang.Object ref = subapi_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + subapi_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The sub-API that the method belongs to.
+     * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The subapi to set. + * @return This builder for chaining. + */ + public Builder setSubapi(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + subapi_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The sub-API that the method belongs to.
+     * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSubapi() { + subapi_ = getDefaultInstance().getSubapi(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The sub-API that the method belongs to.
+     * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for subapi to set. + * @return This builder for chaining. + */ + public Builder setSubapiBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + subapi_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object path_ = ""; + /** + * + * + *
+     * Output only. The path for the method such as
+     * `products/v1/productInputs.insert`
+     * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The path for the method such as
+     * `products/v1/productInputs.insert`
+     * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The path for the method such as
+     * `products/v1/productInputs.insert`
+     * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + path_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The path for the method such as
+     * `products/v1/productInputs.insert`
+     * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + path_ = getDefaultInstance().getPath(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The path for the method such as
+     * `products/v1/productInputs.insert`
+     * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + path_ = value; + bitField0_ |= 0x00000008; + 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.quota.v1beta.MethodDetails) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.quota.v1beta.MethodDetails) + private static final com.google.shopping.merchant.quota.v1beta.MethodDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.quota.v1beta.MethodDetails(); + } + + public static com.google.shopping.merchant.quota.v1beta.MethodDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MethodDetails 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.quota.v1beta.MethodDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/MethodDetailsOrBuilder.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/MethodDetailsOrBuilder.java new file mode 100644 index 000000000000..2c129573911f --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/MethodDetailsOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +public interface MethodDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.quota.v1beta.MethodDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the method for example `products.list`.
+   * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The method. + */ + java.lang.String getMethod(); + /** + * + * + *
+   * Output only. The name of the method for example `products.list`.
+   * 
+ * + * string method = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for method. + */ + com.google.protobuf.ByteString getMethodBytes(); + + /** + * + * + *
+   * Output only. The API version that the method belongs to.
+   * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * Output only. The API version that the method belongs to.
+   * 
+ * + * string version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+   * Output only. The sub-API that the method belongs to.
+   * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The subapi. + */ + java.lang.String getSubapi(); + /** + * + * + *
+   * Output only. The sub-API that the method belongs to.
+   * 
+ * + * string subapi = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for subapi. + */ + com.google.protobuf.ByteString getSubapiBytes(); + + /** + * + * + *
+   * Output only. The path for the method such as
+   * `products/v1/productInputs.insert`
+   * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+   * Output only. The path for the method such as
+   * `products/v1/productInputs.insert`
+   * 
+ * + * string path = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroup.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroup.java new file mode 100644 index 000000000000..6d6d27820fa3 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroup.java @@ -0,0 +1,1490 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +/** + * + * + *
+ * The group information for methods in the Merchant API. The quota is shared
+ * between all methods in the group. Even if none of the methods within the
+ * group have usage the information for the group is returned.
+ * 
+ * + * Protobuf type {@code google.shopping.merchant.quota.v1beta.QuotaGroup} + */ +public final class QuotaGroup extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.merchant.quota.v1beta.QuotaGroup) + QuotaGroupOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaGroup.newBuilder() to construct. + private QuotaGroup(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaGroup() { + name_ = ""; + methodDetails_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaGroup(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.quota.v1beta.QuotaGroup.class, + com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The resource name of the quota group.
+   * Format: accounts/{account}/quotas/{group}
+   * Note: There is no guarantee on the format of {group}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The resource name of the quota group.
+   * Format: accounts/{account}/quotas/{group}
+   * Note: There is no guarantee on the format of {group}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 QUOTA_USAGE_FIELD_NUMBER = 2; + private long quotaUsage_ = 0L; + /** + * + * + *
+   * Output only. The current quota usage, meaning the number of calls already
+   * made on a given day to the methods in the group. The daily quota limits
+   * reset at at 12:00 PM midday UTC.
+   * 
+ * + * int64 quota_usage = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaUsage. + */ + @java.lang.Override + public long getQuotaUsage() { + return quotaUsage_; + } + + public static final int QUOTA_LIMIT_FIELD_NUMBER = 3; + private long quotaLimit_ = 0L; + /** + * + * + *
+   * Output only. The maximum number of calls allowed per day for the group.
+   * 
+ * + * int64 quota_limit = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaLimit. + */ + @java.lang.Override + public long getQuotaLimit() { + return quotaLimit_; + } + + public static final int QUOTA_MINUTE_LIMIT_FIELD_NUMBER = 5; + private long quotaMinuteLimit_ = 0L; + /** + * + * + *
+   * Output only. The maximum number of calls allowed per minute for the group.
+   * 
+ * + * int64 quota_minute_limit = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaMinuteLimit. + */ + @java.lang.Override + public long getQuotaMinuteLimit() { + return quotaMinuteLimit_; + } + + public static final int METHOD_DETAILS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List methodDetails_; + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getMethodDetailsList() { + return methodDetails_; + } + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getMethodDetailsOrBuilderList() { + return methodDetails_; + } + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getMethodDetailsCount() { + return methodDetails_.size(); + } + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.MethodDetails getMethodDetails(int index) { + return methodDetails_.get(index); + } + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.MethodDetailsOrBuilder getMethodDetailsOrBuilder( + int index) { + return methodDetails_.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 (quotaUsage_ != 0L) { + output.writeInt64(2, quotaUsage_); + } + if (quotaLimit_ != 0L) { + output.writeInt64(3, quotaLimit_); + } + for (int i = 0; i < methodDetails_.size(); i++) { + output.writeMessage(4, methodDetails_.get(i)); + } + if (quotaMinuteLimit_ != 0L) { + output.writeInt64(5, quotaMinuteLimit_); + } + 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 (quotaUsage_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, quotaUsage_); + } + if (quotaLimit_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, quotaLimit_); + } + for (int i = 0; i < methodDetails_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, methodDetails_.get(i)); + } + if (quotaMinuteLimit_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, quotaMinuteLimit_); + } + 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.quota.v1beta.QuotaGroup)) { + return super.equals(obj); + } + com.google.shopping.merchant.quota.v1beta.QuotaGroup other = + (com.google.shopping.merchant.quota.v1beta.QuotaGroup) obj; + + if (!getName().equals(other.getName())) return false; + if (getQuotaUsage() != other.getQuotaUsage()) return false; + if (getQuotaLimit() != other.getQuotaLimit()) return false; + if (getQuotaMinuteLimit() != other.getQuotaMinuteLimit()) return false; + if (!getMethodDetailsList().equals(other.getMethodDetailsList())) 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) + QUOTA_USAGE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getQuotaUsage()); + hash = (37 * hash) + QUOTA_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getQuotaLimit()); + hash = (37 * hash) + QUOTA_MINUTE_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getQuotaMinuteLimit()); + if (getMethodDetailsCount() > 0) { + hash = (37 * hash) + METHOD_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getMethodDetailsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup 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.quota.v1beta.QuotaGroup parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup 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.quota.v1beta.QuotaGroup parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup 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.quota.v1beta.QuotaGroup parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup 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.quota.v1beta.QuotaGroup parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup 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.quota.v1beta.QuotaGroup 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 group information for methods in the Merchant API. The quota is shared
+   * between all methods in the group. Even if none of the methods within the
+   * group have usage the information for the group is returned.
+   * 
+ * + * Protobuf type {@code google.shopping.merchant.quota.v1beta.QuotaGroup} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.merchant.quota.v1beta.QuotaGroup) + com.google.shopping.merchant.quota.v1beta.QuotaGroupOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.merchant.quota.v1beta.QuotaGroup.class, + com.google.shopping.merchant.quota.v1beta.QuotaGroup.Builder.class); + } + + // Construct using com.google.shopping.merchant.quota.v1beta.QuotaGroup.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + quotaUsage_ = 0L; + quotaLimit_ = 0L; + quotaMinuteLimit_ = 0L; + if (methodDetailsBuilder_ == null) { + methodDetails_ = java.util.Collections.emptyList(); + } else { + methodDetails_ = null; + methodDetailsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.merchant.quota.v1beta.QuotaProto + .internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_descriptor; + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.QuotaGroup getDefaultInstanceForType() { + return com.google.shopping.merchant.quota.v1beta.QuotaGroup.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.QuotaGroup build() { + com.google.shopping.merchant.quota.v1beta.QuotaGroup result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.merchant.quota.v1beta.QuotaGroup buildPartial() { + com.google.shopping.merchant.quota.v1beta.QuotaGroup result = + new com.google.shopping.merchant.quota.v1beta.QuotaGroup(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.shopping.merchant.quota.v1beta.QuotaGroup result) { + if (methodDetailsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + methodDetails_ = java.util.Collections.unmodifiableList(methodDetails_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.methodDetails_ = methodDetails_; + } else { + result.methodDetails_ = methodDetailsBuilder_.build(); + } + } + + private void buildPartial0(com.google.shopping.merchant.quota.v1beta.QuotaGroup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.quotaUsage_ = quotaUsage_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.quotaLimit_ = quotaLimit_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.quotaMinuteLimit_ = quotaMinuteLimit_; + } + } + + @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.quota.v1beta.QuotaGroup) { + return mergeFrom((com.google.shopping.merchant.quota.v1beta.QuotaGroup) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.merchant.quota.v1beta.QuotaGroup other) { + if (other == com.google.shopping.merchant.quota.v1beta.QuotaGroup.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getQuotaUsage() != 0L) { + setQuotaUsage(other.getQuotaUsage()); + } + if (other.getQuotaLimit() != 0L) { + setQuotaLimit(other.getQuotaLimit()); + } + if (other.getQuotaMinuteLimit() != 0L) { + setQuotaMinuteLimit(other.getQuotaMinuteLimit()); + } + if (methodDetailsBuilder_ == null) { + if (!other.methodDetails_.isEmpty()) { + if (methodDetails_.isEmpty()) { + methodDetails_ = other.methodDetails_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureMethodDetailsIsMutable(); + methodDetails_.addAll(other.methodDetails_); + } + onChanged(); + } + } else { + if (!other.methodDetails_.isEmpty()) { + if (methodDetailsBuilder_.isEmpty()) { + methodDetailsBuilder_.dispose(); + methodDetailsBuilder_ = null; + methodDetails_ = other.methodDetails_; + bitField0_ = (bitField0_ & ~0x00000010); + methodDetailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMethodDetailsFieldBuilder() + : null; + } else { + methodDetailsBuilder_.addAllMessages(other.methodDetails_); + } + } + } + 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: + { + quotaUsage_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + quotaLimit_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + com.google.shopping.merchant.quota.v1beta.MethodDetails m = + input.readMessage( + com.google.shopping.merchant.quota.v1beta.MethodDetails.parser(), + extensionRegistry); + if (methodDetailsBuilder_ == null) { + ensureMethodDetailsIsMutable(); + methodDetails_.add(m); + } else { + methodDetailsBuilder_.addMessage(m); + } + break; + } // case 34 + case 40: + { + quotaMinuteLimit_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 40 + 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_ = ""; + /** + * + * + *
+     * Identifier. The resource name of the quota group.
+     * Format: accounts/{account}/quotas/{group}
+     * Note: There is no guarantee on the format of {group}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The resource name of the quota group.
+     * Format: accounts/{account}/quotas/{group}
+     * Note: There is no guarantee on the format of {group}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The resource name of the quota group.
+     * Format: accounts/{account}/quotas/{group}
+     * Note: There is no guarantee on the format of {group}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + /** + * + * + *
+     * Identifier. The resource name of the quota group.
+     * Format: accounts/{account}/quotas/{group}
+     * Note: There is no guarantee on the format of {group}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of the quota group.
+     * Format: accounts/{account}/quotas/{group}
+     * Note: There is no guarantee on the format of {group}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 quotaUsage_; + /** + * + * + *
+     * Output only. The current quota usage, meaning the number of calls already
+     * made on a given day to the methods in the group. The daily quota limits
+     * reset at at 12:00 PM midday UTC.
+     * 
+ * + * int64 quota_usage = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaUsage. + */ + @java.lang.Override + public long getQuotaUsage() { + return quotaUsage_; + } + /** + * + * + *
+     * Output only. The current quota usage, meaning the number of calls already
+     * made on a given day to the methods in the group. The daily quota limits
+     * reset at at 12:00 PM midday UTC.
+     * 
+ * + * int64 quota_usage = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The quotaUsage to set. + * @return This builder for chaining. + */ + public Builder setQuotaUsage(long value) { + + quotaUsage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current quota usage, meaning the number of calls already
+     * made on a given day to the methods in the group. The daily quota limits
+     * reset at at 12:00 PM midday UTC.
+     * 
+ * + * int64 quota_usage = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearQuotaUsage() { + bitField0_ = (bitField0_ & ~0x00000002); + quotaUsage_ = 0L; + onChanged(); + return this; + } + + private long quotaLimit_; + /** + * + * + *
+     * Output only. The maximum number of calls allowed per day for the group.
+     * 
+ * + * int64 quota_limit = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaLimit. + */ + @java.lang.Override + public long getQuotaLimit() { + return quotaLimit_; + } + /** + * + * + *
+     * Output only. The maximum number of calls allowed per day for the group.
+     * 
+ * + * int64 quota_limit = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The quotaLimit to set. + * @return This builder for chaining. + */ + public Builder setQuotaLimit(long value) { + + quotaLimit_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The maximum number of calls allowed per day for the group.
+     * 
+ * + * int64 quota_limit = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearQuotaLimit() { + bitField0_ = (bitField0_ & ~0x00000004); + quotaLimit_ = 0L; + onChanged(); + return this; + } + + private long quotaMinuteLimit_; + /** + * + * + *
+     * Output only. The maximum number of calls allowed per minute for the group.
+     * 
+ * + * int64 quota_minute_limit = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaMinuteLimit. + */ + @java.lang.Override + public long getQuotaMinuteLimit() { + return quotaMinuteLimit_; + } + /** + * + * + *
+     * Output only. The maximum number of calls allowed per minute for the group.
+     * 
+ * + * int64 quota_minute_limit = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The quotaMinuteLimit to set. + * @return This builder for chaining. + */ + public Builder setQuotaMinuteLimit(long value) { + + quotaMinuteLimit_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The maximum number of calls allowed per minute for the group.
+     * 
+ * + * int64 quota_minute_limit = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearQuotaMinuteLimit() { + bitField0_ = (bitField0_ & ~0x00000008); + quotaMinuteLimit_ = 0L; + onChanged(); + return this; + } + + private java.util.List methodDetails_ = + java.util.Collections.emptyList(); + + private void ensureMethodDetailsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + methodDetails_ = + new java.util.ArrayList( + methodDetails_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.quota.v1beta.MethodDetails, + com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder, + com.google.shopping.merchant.quota.v1beta.MethodDetailsOrBuilder> + methodDetailsBuilder_; + + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMethodDetailsList() { + if (methodDetailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(methodDetails_); + } else { + return methodDetailsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getMethodDetailsCount() { + if (methodDetailsBuilder_ == null) { + return methodDetails_.size(); + } else { + return methodDetailsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.quota.v1beta.MethodDetails getMethodDetails(int index) { + if (methodDetailsBuilder_ == null) { + return methodDetails_.get(index); + } else { + return methodDetailsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMethodDetails( + int index, com.google.shopping.merchant.quota.v1beta.MethodDetails value) { + if (methodDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodDetailsIsMutable(); + methodDetails_.set(index, value); + onChanged(); + } else { + methodDetailsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setMethodDetails( + int index, + com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder builderForValue) { + if (methodDetailsBuilder_ == null) { + ensureMethodDetailsIsMutable(); + methodDetails_.set(index, builderForValue.build()); + onChanged(); + } else { + methodDetailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMethodDetails(com.google.shopping.merchant.quota.v1beta.MethodDetails value) { + if (methodDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodDetailsIsMutable(); + methodDetails_.add(value); + onChanged(); + } else { + methodDetailsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMethodDetails( + int index, com.google.shopping.merchant.quota.v1beta.MethodDetails value) { + if (methodDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodDetailsIsMutable(); + methodDetails_.add(index, value); + onChanged(); + } else { + methodDetailsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMethodDetails( + com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder builderForValue) { + if (methodDetailsBuilder_ == null) { + ensureMethodDetailsIsMutable(); + methodDetails_.add(builderForValue.build()); + onChanged(); + } else { + methodDetailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addMethodDetails( + int index, + com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder builderForValue) { + if (methodDetailsBuilder_ == null) { + ensureMethodDetailsIsMutable(); + methodDetails_.add(index, builderForValue.build()); + onChanged(); + } else { + methodDetailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllMethodDetails( + java.lang.Iterable + values) { + if (methodDetailsBuilder_ == null) { + ensureMethodDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, methodDetails_); + onChanged(); + } else { + methodDetailsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearMethodDetails() { + if (methodDetailsBuilder_ == null) { + methodDetails_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + methodDetailsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeMethodDetails(int index) { + if (methodDetailsBuilder_ == null) { + ensureMethodDetailsIsMutable(); + methodDetails_.remove(index); + onChanged(); + } else { + methodDetailsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder getMethodDetailsBuilder( + int index) { + return getMethodDetailsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.quota.v1beta.MethodDetailsOrBuilder + getMethodDetailsOrBuilder(int index) { + if (methodDetailsBuilder_ == null) { + return methodDetails_.get(index); + } else { + return methodDetailsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.shopping.merchant.quota.v1beta.MethodDetailsOrBuilder> + getMethodDetailsOrBuilderList() { + if (methodDetailsBuilder_ != null) { + return methodDetailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(methodDetails_); + } + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder + addMethodDetailsBuilder() { + return getMethodDetailsFieldBuilder() + .addBuilder(com.google.shopping.merchant.quota.v1beta.MethodDetails.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder addMethodDetailsBuilder( + int index) { + return getMethodDetailsFieldBuilder() + .addBuilder( + index, com.google.shopping.merchant.quota.v1beta.MethodDetails.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of all methods group quota applies to.
+     * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getMethodDetailsBuilderList() { + return getMethodDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.quota.v1beta.MethodDetails, + com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder, + com.google.shopping.merchant.quota.v1beta.MethodDetailsOrBuilder> + getMethodDetailsFieldBuilder() { + if (methodDetailsBuilder_ == null) { + methodDetailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.shopping.merchant.quota.v1beta.MethodDetails, + com.google.shopping.merchant.quota.v1beta.MethodDetails.Builder, + com.google.shopping.merchant.quota.v1beta.MethodDetailsOrBuilder>( + methodDetails_, + ((bitField0_ & 0x00000010) != 0), + getParentForChildren(), + isClean()); + methodDetails_ = null; + } + return methodDetailsBuilder_; + } + + @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.quota.v1beta.QuotaGroup) + } + + // @@protoc_insertion_point(class_scope:google.shopping.merchant.quota.v1beta.QuotaGroup) + private static final com.google.shopping.merchant.quota.v1beta.QuotaGroup DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.merchant.quota.v1beta.QuotaGroup(); + } + + public static com.google.shopping.merchant.quota.v1beta.QuotaGroup getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaGroup 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.quota.v1beta.QuotaGroup getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroupName.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroupName.java new file mode 100644 index 000000000000..3cf3bd135157 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroupName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2024 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.quota.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 QuotaGroupName implements ResourceName { + private static final PathTemplate ACCOUNT_GROUP = + PathTemplate.createWithoutUrlEncoding("accounts/{account}/groups/{group}"); + private volatile Map fieldValuesMap; + private final String account; + private final String group; + + @Deprecated + protected QuotaGroupName() { + account = null; + group = null; + } + + private QuotaGroupName(Builder builder) { + account = Preconditions.checkNotNull(builder.getAccount()); + group = Preconditions.checkNotNull(builder.getGroup()); + } + + public String getAccount() { + return account; + } + + public String getGroup() { + return group; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static QuotaGroupName of(String account, String group) { + return newBuilder().setAccount(account).setGroup(group).build(); + } + + public static String format(String account, String group) { + return newBuilder().setAccount(account).setGroup(group).build().toString(); + } + + public static QuotaGroupName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ACCOUNT_GROUP.validatedMatch( + formattedString, "QuotaGroupName.parse: formattedString not in valid format"); + return of(matchMap.get("account"), matchMap.get("group")); + } + + 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 (QuotaGroupName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ACCOUNT_GROUP.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 (group != null) { + fieldMapBuilder.put("group", group); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ACCOUNT_GROUP.instantiate("account", account, "group", group); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + QuotaGroupName that = ((QuotaGroupName) o); + return Objects.equals(this.account, that.account) && Objects.equals(this.group, that.group); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(account); + h *= 1000003; + h ^= Objects.hashCode(group); + return h; + } + + /** Builder for accounts/{account}/groups/{group}. */ + public static class Builder { + private String account; + private String group; + + protected Builder() {} + + public String getAccount() { + return account; + } + + public String getGroup() { + return group; + } + + public Builder setAccount(String account) { + this.account = account; + return this; + } + + public Builder setGroup(String group) { + this.group = group; + return this; + } + + private Builder(QuotaGroupName quotaGroupName) { + this.account = quotaGroupName.account; + this.group = quotaGroupName.group; + } + + public QuotaGroupName build() { + return new QuotaGroupName(this); + } + } +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroupOrBuilder.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroupOrBuilder.java new file mode 100644 index 000000000000..c6cafe6b2730 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaGroupOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +public interface QuotaGroupOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.merchant.quota.v1beta.QuotaGroup) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The resource name of the quota group.
+   * Format: accounts/{account}/quotas/{group}
+   * Note: There is no guarantee on the format of {group}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The resource name of the quota group.
+   * Format: accounts/{account}/quotas/{group}
+   * Note: There is no guarantee on the format of {group}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The current quota usage, meaning the number of calls already
+   * made on a given day to the methods in the group. The daily quota limits
+   * reset at at 12:00 PM midday UTC.
+   * 
+ * + * int64 quota_usage = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaUsage. + */ + long getQuotaUsage(); + + /** + * + * + *
+   * Output only. The maximum number of calls allowed per day for the group.
+   * 
+ * + * int64 quota_limit = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaLimit. + */ + long getQuotaLimit(); + + /** + * + * + *
+   * Output only. The maximum number of calls allowed per minute for the group.
+   * 
+ * + * int64 quota_minute_limit = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The quotaMinuteLimit. + */ + long getQuotaMinuteLimit(); + + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getMethodDetailsList(); + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.merchant.quota.v1beta.MethodDetails getMethodDetails(int index); + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getMethodDetailsCount(); + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getMethodDetailsOrBuilderList(); + /** + * + * + *
+   * Output only. List of all methods group quota applies to.
+   * 
+ * + * + * repeated .google.shopping.merchant.quota.v1beta.MethodDetails method_details = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.shopping.merchant.quota.v1beta.MethodDetailsOrBuilder getMethodDetailsOrBuilder( + int index); +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaProto.java b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaProto.java new file mode 100644 index 000000000000..79e4ef489e01 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/java/com/google/shopping/merchant/quota/v1beta/QuotaProto.java @@ -0,0 +1,152 @@ +/* + * Copyright 2024 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/quota/v1beta/quota.proto + +// Protobuf Java Version: 3.25.2 +package com.google.shopping.merchant.quota.v1beta; + +public final class QuotaProto { + private QuotaProto() {} + + 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_quota_v1beta_QuotaGroup_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/shopping/merchant/quota/v1beta/" + + "quota.proto\022%google.shopping.merchant.qu" + + "ota.v1beta\032\034google/api/annotations.proto" + + "\032\027google/api/client.proto\032\037google/api/fi" + + "eld_behavior.proto\032\031google/api/resource." + + "proto\"\257\002\n\nQuotaGroup\022\021\n\004name\030\001 \001(\tB\003\340A\010\022" + + "\030\n\013quota_usage\030\002 \001(\003B\003\340A\003\022\030\n\013quota_limit" + + "\030\003 \001(\003B\003\340A\003\022\037\n\022quota_minute_limit\030\005 \001(\003B" + + "\003\340A\003\022Q\n\016method_details\030\004 \003(\01324.google.sh" + + "opping.merchant.quota.v1beta.MethodDetai" + + "lsB\003\340A\003:f\352Ac\n%merchantapi.googleapis.com" + + "/QuotaGroup\022!accounts/{account}/groups/{" + + "group}*\013quotaGroups2\nquotaGroup\"b\n\rMetho" + + "dDetails\022\023\n\006method\030\001 \001(\tB\003\340A\003\022\024\n\007version" + + "\030\002 \001(\tB\003\340A\003\022\023\n\006subapi\030\003 \001(\tB\003\340A\003\022\021\n\004path" + + "\030\004 \001(\tB\003\340A\003\"\210\001\n\026ListQuotaGroupsRequest\022=" + + "\n\006parent\030\001 \001(\tB-\340A\002\372A\'\022%merchantapi.goog" + + "leapis.com/QuotaGroup\022\026\n\tpage_size\030\002 \001(\005" + + "B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"{\n\027ListQu" + + "otaGroupsResponse\022G\n\014quota_groups\030\001 \003(\0132" + + "1.google.shopping.merchant.quota.v1beta." + + "QuotaGroup\022\027\n\017next_page_token\030\002 \001(\t2\245\002\n\014" + + "QuotaService\022\313\001\n\017ListQuotaGroups\022=.googl" + + "e.shopping.merchant.quota.v1beta.ListQuo" + + "taGroupsRequest\032>.google.shopping.mercha" + + "nt.quota.v1beta.ListQuotaGroupsResponse\"" + + "9\332A\006parent\202\323\344\223\002*\022(/quota/v1beta/{parent=" + + "accounts/*}/quotas\032G\312A\032merchantapi.googl" + + "eapis.com\322A\'https://www.googleapis.com/a" + + "uth/contentB\273\001\n)com.google.shopping.merc" + + "hant.quota.v1betaB\nQuotaProtoP\001ZEcloud.g" + + "oogle.com/go/shopping/merchant/quota/api" + + "v1beta/quotapb;quotapb\352A8\n\"merchantapi.g" + + "oogleapis.com/Account\022\022accounts/{account" + + "}b\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(), + }); + internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_quota_v1beta_QuotaGroup_descriptor, + new java.lang.String[] { + "Name", "QuotaUsage", "QuotaLimit", "QuotaMinuteLimit", "MethodDetails", + }); + internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_quota_v1beta_MethodDetails_descriptor, + new java.lang.String[] { + "Method", "Version", "Subapi", "Path", + }); + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_merchant_quota_v1beta_ListQuotaGroupsResponse_descriptor, + new java.lang.String[] { + "QuotaGroups", "NextPageToken", + }); + 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.resourceDefinition); + 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(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/proto/google/shopping/merchant/quota/v1beta/quota.proto b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/proto/google/shopping/merchant/quota/v1beta/quota.proto new file mode 100644 index 000000000000..015a833674c4 --- /dev/null +++ b/java-shopping-merchant-quota/proto-google-shopping-merchant-quota-v1beta/src/main/proto/google/shopping/merchant/quota/v1beta/quota.proto @@ -0,0 +1,128 @@ +// 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.quota.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/shopping/merchant/quota/apiv1beta/quotapb;quotapb"; +option java_multiple_files = true; +option java_outer_classname = "QuotaProto"; +option java_package = "com.google.shopping.merchant.quota.v1beta"; +option (google.api.resource_definition) = { + type: "merchantapi.googleapis.com/Account" + pattern: "accounts/{account}" +}; + +// Service to get method call quota information per Merchant API method. +service QuotaService { + option (google.api.default_host) = "merchantapi.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/content"; + + // Lists the daily call quota and usage per group for your Merchant + // Center account. + rpc ListQuotaGroups(ListQuotaGroupsRequest) + returns (ListQuotaGroupsResponse) { + option (google.api.http) = { + get: "/quota/v1beta/{parent=accounts/*}/quotas" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The group information for methods in the Merchant API. The quota is shared +// between all methods in the group. Even if none of the methods within the +// group have usage the information for the group is returned. +message QuotaGroup { + option (google.api.resource) = { + type: "merchantapi.googleapis.com/QuotaGroup" + pattern: "accounts/{account}/groups/{group}" + plural: "quotaGroups" + singular: "quotaGroup" + }; + + // Identifier. The resource name of the quota group. + // Format: accounts/{account}/quotas/{group} + // Note: There is no guarantee on the format of {group} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The current quota usage, meaning the number of calls already + // made on a given day to the methods in the group. The daily quota limits + // reset at at 12:00 PM midday UTC. + int64 quota_usage = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The maximum number of calls allowed per day for the group. + int64 quota_limit = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The maximum number of calls allowed per minute for the group. + int64 quota_minute_limit = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of all methods group quota applies to. + repeated MethodDetails method_details = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The method details per method in the Merchant API. +message MethodDetails { + // Output only. The name of the method for example `products.list`. + string method = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The API version that the method belongs to. + string version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The sub-API that the method belongs to. + string subapi = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The path for the method such as + // `products/v1/productInputs.insert` + string path = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for the ListQuotaGroups method. +message ListQuotaGroupsRequest { + // Required. The merchant account who owns the collection of method quotas + // Format: accounts/{account} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "merchantapi.googleapis.com/QuotaGroup" + } + ]; + + // Optional. The maximum number of quotas to return in the response, used + // for paging. Defaults to 500; values above 1000 will be coerced to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Token (if provided) to retrieve the subsequent page. All other + // parameters must match the original call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for the ListMethodGroups method. +message ListQuotaGroupsResponse { + // The methods, current quota usage and limits per each group. The quota is + // shared between all methods in the group. The groups are sorted in + // descending order based on + // [quotaUsage][google.shopping.merchant.quota.v1main.QuotaGroup.quota_usage]. + repeated QuotaGroup quota_groups = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetCredentialsProvider.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..bc67b198a860 --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceClient; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceSettings; +import com.google.shopping.merchant.quota.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 + QuotaServiceSettings quotaServiceSettings = + QuotaServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings); + } +} +// [END merchantapi_v1beta_generated_QuotaService_Create_SetCredentialsProvider_sync] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetCredentialsProvider1.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..a8014ff2045b --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaService_Create_SetCredentialsProvider1_sync] +import com.google.shopping.merchant.quota.v1beta.QuotaServiceClient; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceSettings; + +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 + QuotaServiceSettings quotaServiceSettings = QuotaServiceSettings.newHttpJsonBuilder().build(); + QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings); + } +} +// [END merchantapi_v1beta_generated_QuotaService_Create_SetCredentialsProvider1_sync] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetEndpoint.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..1d58b309b7b2 --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaService_Create_SetEndpoint_sync] +import com.google.shopping.merchant.quota.v1beta.QuotaServiceClient; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceSettings; +import com.google.shopping.merchant.quota.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 + QuotaServiceSettings quotaServiceSettings = + QuotaServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + QuotaServiceClient quotaServiceClient = QuotaServiceClient.create(quotaServiceSettings); + } +} +// [END merchantapi_v1beta_generated_QuotaService_Create_SetEndpoint_sync] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/AsyncListQuotaGroups.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/AsyncListQuotaGroups.java new file mode 100644 index 000000000000..48777f1f1d09 --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/AsyncListQuotaGroups.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_async] +import com.google.api.core.ApiFuture; +import com.google.shopping.merchant.quota.v1beta.AccountName; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest; +import com.google.shopping.merchant.quota.v1beta.QuotaGroup; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceClient; + +public class AsyncListQuotaGroups { + + public static void main(String[] args) throws Exception { + asyncListQuotaGroups(); + } + + public static void asyncListQuotaGroups() 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) { + ListQuotaGroupsRequest request = + ListQuotaGroupsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + quotaServiceClient.listQuotaGroupsPagedCallable().futureCall(request); + // Do something. + for (QuotaGroup element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_async] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/AsyncListQuotaGroupsPaged.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/AsyncListQuotaGroupsPaged.java new file mode 100644 index 000000000000..85f22132f519 --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/AsyncListQuotaGroupsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_Paged_async] +import com.google.common.base.Strings; +import com.google.shopping.merchant.quota.v1beta.AccountName; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsResponse; +import com.google.shopping.merchant.quota.v1beta.QuotaGroup; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceClient; + +public class AsyncListQuotaGroupsPaged { + + public static void main(String[] args) throws Exception { + asyncListQuotaGroupsPaged(); + } + + public static void asyncListQuotaGroupsPaged() 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) { + ListQuotaGroupsRequest request = + ListQuotaGroupsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListQuotaGroupsResponse response = + quotaServiceClient.listQuotaGroupsCallable().call(request); + for (QuotaGroup element : response.getQuotaGroupsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_Paged_async] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroups.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroups.java new file mode 100644 index 000000000000..64d819fafb35 --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroups.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_sync] +import com.google.shopping.merchant.quota.v1beta.AccountName; +import com.google.shopping.merchant.quota.v1beta.ListQuotaGroupsRequest; +import com.google.shopping.merchant.quota.v1beta.QuotaGroup; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceClient; + +public class SyncListQuotaGroups { + + public static void main(String[] args) throws Exception { + syncListQuotaGroups(); + } + + public static void syncListQuotaGroups() 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) { + ListQuotaGroupsRequest request = + ListQuotaGroupsRequest.newBuilder() + .setParent(AccountName.of("[ACCOUNT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (QuotaGroup element : quotaServiceClient.listQuotaGroups(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_sync] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroupsAccountname.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroupsAccountname.java new file mode 100644 index 000000000000..8a4113e6f22a --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroupsAccountname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_Accountname_sync] +import com.google.shopping.merchant.quota.v1beta.AccountName; +import com.google.shopping.merchant.quota.v1beta.QuotaGroup; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceClient; + +public class SyncListQuotaGroupsAccountname { + + public static void main(String[] args) throws Exception { + syncListQuotaGroupsAccountname(); + } + + public static void syncListQuotaGroupsAccountname() 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) { + AccountName parent = AccountName.of("[ACCOUNT]"); + for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_Accountname_sync] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroupsString.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroupsString.java new file mode 100644 index 000000000000..06727076361b --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservice/listquotagroups/SyncListQuotaGroupsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_String_sync] +import com.google.shopping.merchant.quota.v1beta.AccountName; +import com.google.shopping.merchant.quota.v1beta.QuotaGroup; +import com.google.shopping.merchant.quota.v1beta.QuotaServiceClient; + +public class SyncListQuotaGroupsString { + + public static void main(String[] args) throws Exception { + syncListQuotaGroupsString(); + } + + public static void syncListQuotaGroupsString() 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 (QuotaServiceClient quotaServiceClient = QuotaServiceClient.create()) { + String parent = AccountName.of("[ACCOUNT]").toString(); + for (QuotaGroup element : quotaServiceClient.listQuotaGroups(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END merchantapi_v1beta_generated_QuotaService_ListQuotaGroups_String_sync] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservicesettings/listquotagroups/SyncListQuotaGroups.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservicesettings/listquotagroups/SyncListQuotaGroups.java new file mode 100644 index 000000000000..a40f4b67be18 --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/quotaservicesettings/listquotagroups/SyncListQuotaGroups.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 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.quota.v1beta.samples; + +// [START merchantapi_v1beta_generated_QuotaServiceSettings_ListQuotaGroups_sync] +import com.google.shopping.merchant.quota.v1beta.QuotaServiceSettings; +import java.time.Duration; + +public class SyncListQuotaGroups { + + public static void main(String[] args) throws Exception { + syncListQuotaGroups(); + } + + public static void syncListQuotaGroups() 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 + QuotaServiceSettings.Builder quotaServiceSettingsBuilder = QuotaServiceSettings.newBuilder(); + quotaServiceSettingsBuilder + .listQuotaGroupsSettings() + .setRetrySettings( + quotaServiceSettingsBuilder + .listQuotaGroupsSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + QuotaServiceSettings quotaServiceSettings = quotaServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_QuotaServiceSettings_ListQuotaGroups_sync] diff --git a/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/stub/quotaservicestubsettings/listquotagroups/SyncListQuotaGroups.java b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/stub/quotaservicestubsettings/listquotagroups/SyncListQuotaGroups.java new file mode 100644 index 000000000000..562a53bbd79c --- /dev/null +++ b/java-shopping-merchant-quota/samples/snippets/generated/com/google/shopping/merchant/quota/v1beta/stub/quotaservicestubsettings/listquotagroups/SyncListQuotaGroups.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 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.quota.v1beta.stub.samples; + +// [START merchantapi_v1beta_generated_QuotaServiceStubSettings_ListQuotaGroups_sync] +import com.google.shopping.merchant.quota.v1beta.stub.QuotaServiceStubSettings; +import java.time.Duration; + +public class SyncListQuotaGroups { + + public static void main(String[] args) throws Exception { + syncListQuotaGroups(); + } + + public static void syncListQuotaGroups() 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 + QuotaServiceStubSettings.Builder quotaServiceSettingsBuilder = + QuotaServiceStubSettings.newBuilder(); + quotaServiceSettingsBuilder + .listQuotaGroupsSettings() + .setRetrySettings( + quotaServiceSettingsBuilder + .listQuotaGroupsSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + QuotaServiceStubSettings quotaServiceSettings = quotaServiceSettingsBuilder.build(); + } +} +// [END merchantapi_v1beta_generated_QuotaServiceStubSettings_ListQuotaGroups_sync] diff --git a/pom.xml b/pom.xml index 72f8af0834b6..23d233bcc42f 100644 --- a/pom.xml +++ b/pom.xml @@ -165,6 +165,7 @@ java-shell java-shopping-css java-shopping-merchant-inventories + java-shopping-merchant-quota java-shopping-merchant-reports java-speech java-storage-transfer diff --git a/versions.txt b/versions.txt index e943e101db78..d3a457547217 100644 --- a/versions.txt +++ b/versions.txt @@ -744,3 +744,6 @@ grpc-google-cloud-apphub-v1:0.1.0:0.2.0-SNAPSHOT google-cloud-chat:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-chat-v1:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-chat-v1:0.1.0:0.2.0-SNAPSHOT +google-shopping-merchant-quota:0.0.0:0.0.1-SNAPSHOT +proto-google-shopping-merchant-quota-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-shopping-merchant-quota-v1beta:0.0.0:0.0.1-SNAPSHOT