diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 0f029cd6ecd6..b5f781610306 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -301,6 +301,13 @@ pom import + + com.google.cloud + google-cloud-cloudquotas-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-cloudsupport-bom diff --git a/java-cloudquotas/.OwlBot.yaml b/java-cloudquotas/.OwlBot.yaml new file mode 100644 index 000000000000..0c9361da963e --- /dev/null +++ b/java-cloudquotas/.OwlBot.yaml @@ -0,0 +1,36 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +deep-remove-regex: +- "/java-cloudquotas/grpc-google-.*/src" +- "/java-cloudquotas/proto-google-.*/src" +- "/java-cloudquotas/google-.*/src" +- "/java-cloudquotas/samples/snippets/generated" + +deep-preserve-regex: +- "/java-cloudquotas/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/api/cloudquotas/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-cloudquotas/$1/proto-google-cloud-cloudquotas-$1/src" +- source: "/google/api/cloudquotas/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-cloudquotas/$1/grpc-google-cloud-cloudquotas-$1/src" +- source: "/google/api/cloudquotas/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-cloudquotas/$1/google-cloud-cloudquotas/src" +- source: "/google/api/cloudquotas/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-cloudquotas/$1/samples/snippets/generated" + + +api-name: cloudquotas \ No newline at end of file diff --git a/java-cloudquotas/.repo-metadata.json b/java-cloudquotas/.repo-metadata.json new file mode 100644 index 000000000000..189d8f8a98e0 --- /dev/null +++ b/java-cloudquotas/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "cloudquotas", + "name_pretty": "Cloud Quotas API", + "product_documentation": "https://cloud.google.com/cloudquotas/docs/", + "api_description": "Cloud Quotas API provides GCP service consumers with management and\n observability for resource usage, quotas, and restrictions of the services\n they consume.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-cloudquotas/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-cloudquotas", + "repo_short": "java-cloudquotas", + "distribution_name": "com.google.cloud:google-cloud-cloudquotas", + "api_id": "cloudquotas.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-cloudquotas/README.md b/java-cloudquotas/README.md new file mode 100644 index 000000000000..8f5f80f6422a --- /dev/null +++ b/java-cloudquotas/README.md @@ -0,0 +1,227 @@ +# Google Cloud Quotas API Client for Java + +Java idiomatic client for [Cloud Quotas 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.25.0 + pom + import + + + + + + + com.google.cloud + google-cloud-cloudquotas + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-cloudquotas + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-cloudquotas:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-cloudquotas" % "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 Cloud Quotas API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Quotas API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Quotas API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud Quotas 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-cloud-cloudquotas` library. See the [Quickstart](#quickstart) section +to add `google-cloud-cloudquotas` as a dependency in your code. + +## About Cloud Quotas API + + +[Cloud Quotas API][product-docs] Cloud Quotas API provides GCP service consumers with management and + observability for resource usage, quotas, and restrictions of the services + they consume. + +See the [Cloud Quotas API client library docs][javadocs] to learn how to +use this Cloud Quotas API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud Quotas API uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/cloudquotas/docs/ +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-cloudquotas/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudquotas/java11.html +[stability-image]: https://img.shields.io/badge/stability-preview-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-cloudquotas.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-cloudquotas/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-cloudquotas/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-cloudquotas/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-cloudquotas/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=cloudquotas.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-cloudquotas/google-cloud-cloudquotas-bom/pom.xml b/java-cloudquotas/google-cloud-cloudquotas-bom/pom.xml new file mode 100644 index 000000000000..c5983ce91755 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudquotas-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.27.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Cloud Quotas API BOM + + BOM for Cloud Quotas API + + + + true + + + + + + com.google.cloud + google-cloud-cloudquotas + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudquotas-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-cloudquotas-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-cloudquotas/google-cloud-cloudquotas/pom.xml b/java-cloudquotas/google-cloud-cloudquotas/pom.xml new file mode 100644 index 000000000000..93b9bd99ab0c --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/pom.xml @@ -0,0 +1,115 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudquotas + 0.0.1-SNAPSHOT + jar + Google Cloud Quotas API + Cloud Quotas API Cloud Quotas API provides GCP service consumers with management and + observability for resource usage, quotas, and restrictions of the services + they consume. + + com.google.cloud + google-cloud-cloudquotas-parent + 0.0.1-SNAPSHOT + + + google-cloud-cloudquotas + + + + 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.api.grpc + proto-google-cloud-cloudquotas-v1 + + + 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.api.grpc + grpc-google-cloud-cloudquotas-v1 + 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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasClient.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasClient.java new file mode 100644 index 000000000000..1ba608da5afa --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasClient.java @@ -0,0 +1,1294 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import com.google.api.cloudquotas.v1.stub.CloudQuotasStub; +import com.google.api.cloudquotas.v1.stub.CloudQuotasStubSettings; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: The Cloud Quotas API is an infrastructure service for Google Cloud that lets + * service consumers list and manage their resource usage limits. + * + *

- List/Get the metadata and current status of the quotas for a service. - Create/Update quota + * preferencess that declare the preferred quota values. - Check the status of a quota preference + * request. - List/Get pending and historical quota preference. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+ *   QuotaInfoName name =
+ *       QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+ *           "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]");
+ *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(name);
+ * }
+ * }
+ * + *

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

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

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

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

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

This class can be customized by passing in a custom instance of CloudQuotasSettings 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
+ * CloudQuotasSettings cloudQuotasSettings =
+ *     CloudQuotasSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings);
+ * }
+ * + *

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
+ * CloudQuotasSettings cloudQuotasSettings =
+ *     CloudQuotasSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings);
+ * }
+ * + *

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
+ * CloudQuotasSettings cloudQuotasSettings = CloudQuotasSettings.newHttpJsonBuilder().build();
+ * CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CloudQuotasClient implements BackgroundResource { + private final CloudQuotasSettings settings; + private final CloudQuotasStub stub; + + /** Constructs an instance of CloudQuotasClient with default settings. */ + public static final CloudQuotasClient create() throws IOException { + return create(CloudQuotasSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudQuotasClient, 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 CloudQuotasClient create(CloudQuotasSettings settings) throws IOException { + return new CloudQuotasClient(settings); + } + + /** + * Constructs an instance of CloudQuotasClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(CloudQuotasSettings). + */ + public static final CloudQuotasClient create(CloudQuotasStub stub) { + return new CloudQuotasClient(stub); + } + + /** + * Constructs an instance of CloudQuotasClient, 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 CloudQuotasClient(CloudQuotasSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudQuotasStubSettings) settings.getStubSettings()).createStub(); + } + + protected CloudQuotasClient(CloudQuotasStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CloudQuotasSettings getSettings() { + return settings; + } + + public CloudQuotasStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ServiceName parent =
+   *       ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]");
+   *   for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value of QuotaInfo resources. Listing across different resource + * containers (such as 'projects/-') is not allowed. + *

Example names: `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaInfosPagedResponse listQuotaInfos(ServiceName parent) { + ListQuotaInfosRequest request = + ListQuotaInfosRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listQuotaInfos(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String parent =
+   *       ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]")
+   *           .toString();
+   *   for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value of QuotaInfo resources. Listing across different resource + * containers (such as 'projects/-') is not allowed. + *

Example names: `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaInfosPagedResponse listQuotaInfos(String parent) { + ListQuotaInfosRequest request = ListQuotaInfosRequest.newBuilder().setParent(parent).build(); + return listQuotaInfos(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaInfosRequest request =
+   *       ListQuotaInfosRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(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 ListQuotaInfosPagedResponse listQuotaInfos(ListQuotaInfosRequest request) { + return listQuotaInfosPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaInfosRequest request =
+   *       ListQuotaInfosRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.listQuotaInfosPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (QuotaInfo element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listQuotaInfosPagedCallable() { + return stub.listQuotaInfosPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaInfosRequest request =
+   *       ListQuotaInfosRequest.newBuilder()
+   *           .setParent(
+   *               ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListQuotaInfosResponse response = cloudQuotasClient.listQuotaInfosCallable().call(request);
+   *     for (QuotaInfo element : response.getQuotaInfosList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listQuotaInfosCallable() { + return stub.listQuotaInfosCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   QuotaInfoName name =
+   *       QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+   *           "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]");
+   *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the quota info. + *

An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaInfo getQuotaInfo(QuotaInfoName name) { + GetQuotaInfoRequest request = + GetQuotaInfoRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getQuotaInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String name =
+   *       QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+   *               "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]")
+   *           .toString();
+   *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the quota info. + *

An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaInfo getQuotaInfo(String name) { + GetQuotaInfoRequest request = GetQuotaInfoRequest.newBuilder().setName(name).build(); + return getQuotaInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   GetQuotaInfoRequest request =
+   *       GetQuotaInfoRequest.newBuilder()
+   *           .setName(
+   *               QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+   *                       "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]")
+   *                   .toString())
+   *           .build();
+   *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaInfo getQuotaInfo(GetQuotaInfoRequest request) { + return getQuotaInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   GetQuotaInfoRequest request =
+   *       GetQuotaInfoRequest.newBuilder()
+   *           .setName(
+   *               QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+   *                       "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = cloudQuotasClient.getQuotaInfoCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaInfo response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getQuotaInfoCallable() { + return stub.getQuotaInfoCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
+   *   for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value of QuotaPreference resources. Listing across different + * resource containers (such as 'projects/-') is not allowed. + *

When the value starts with 'folders' or 'organizations', it lists the QuotaPreferences + * for org quotas in the container. It does not list the QuotaPreferences in the descendant + * projects of the container. + *

Example parents: `projects/123/locations/global` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaPreferencesPagedResponse listQuotaPreferences(LocationName parent) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listQuotaPreferences(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString();
+   *   for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value of QuotaPreference resources. Listing across different + * resource containers (such as 'projects/-') is not allowed. + *

When the value starts with 'folders' or 'organizations', it lists the QuotaPreferences + * for org quotas in the container. It does not list the QuotaPreferences in the descendant + * projects of the container. + *

Example parents: `projects/123/locations/global` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListQuotaPreferencesPagedResponse listQuotaPreferences(String parent) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder().setParent(parent).build(); + return listQuotaPreferences(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaPreferencesRequest request =
+   *       ListQuotaPreferencesRequest.newBuilder()
+   *           .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(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 ListQuotaPreferencesPagedResponse listQuotaPreferences( + ListQuotaPreferencesRequest request) { + return listQuotaPreferencesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaPreferencesRequest request =
+   *       ListQuotaPreferencesRequest.newBuilder()
+   *           .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.listQuotaPreferencesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (QuotaPreference element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listQuotaPreferencesPagedCallable() { + return stub.listQuotaPreferencesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   ListQuotaPreferencesRequest request =
+   *       ListQuotaPreferencesRequest.newBuilder()
+   *           .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListQuotaPreferencesResponse response =
+   *         cloudQuotasClient.listQuotaPreferencesCallable().call(request);
+   *     for (QuotaPreference element : response.getQuotaPreferencesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listQuotaPreferencesCallable() { + return stub.listQuotaPreferencesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single QuotaPreference. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   QuotaPreferenceName name =
+   *       QuotaPreferenceName.ofProjectLocationQuotaPreferenceName(
+   *           "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]");
+   *   QuotaPreference response = cloudQuotasClient.getQuotaPreference(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + *

Example name: `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference getQuotaPreference(QuotaPreferenceName name) { + GetQuotaPreferenceRequest request = + GetQuotaPreferenceRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single QuotaPreference. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String name =
+   *       QuotaPreferenceName.ofProjectLocationQuotaPreferenceName(
+   *               "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]")
+   *           .toString();
+   *   QuotaPreference response = cloudQuotasClient.getQuotaPreference(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource + *

Example name: `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference getQuotaPreference(String name) { + GetQuotaPreferenceRequest request = + GetQuotaPreferenceRequest.newBuilder().setName(name).build(); + return getQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single QuotaPreference. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   GetQuotaPreferenceRequest request =
+   *       GetQuotaPreferenceRequest.newBuilder()
+   *           .setName(
+   *               QuotaPreferenceName.ofProjectLocationQuotaPreferenceName(
+   *                       "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]")
+   *                   .toString())
+   *           .build();
+   *   QuotaPreference response = cloudQuotasClient.getQuotaPreference(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference getQuotaPreference(GetQuotaPreferenceRequest request) { + return getQuotaPreferenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single QuotaPreference. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   GetQuotaPreferenceRequest request =
+   *       GetQuotaPreferenceRequest.newBuilder()
+   *           .setName(
+   *               QuotaPreferenceName.ofProjectLocationQuotaPreferenceName(
+   *                       "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.getQuotaPreferenceCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaPreference response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getQuotaPreferenceCallable() { + return stub.getQuotaPreferenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   QuotaPreference response = cloudQuotasClient.createQuotaPreference(parent, quotaPreference);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + *

Example: `projects/123/locations/global` + * @param quotaPreference Required. The resource being created + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference( + LocationName parent, QuotaPreference quotaPreference) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuotaPreference(quotaPreference) + .build(); + return createQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString();
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   QuotaPreference response = cloudQuotasClient.createQuotaPreference(parent, quotaPreference);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + *

Example: `projects/123/locations/global` + * @param quotaPreference Required. The resource being created + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference( + String parent, QuotaPreference quotaPreference) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(parent) + .setQuotaPreference(quotaPreference) + .build(); + return createQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   String quotaPreferenceId = "quotaPreferenceId-948332050";
+   *   QuotaPreference response =
+   *       cloudQuotasClient.createQuotaPreference(parent, quotaPreference, quotaPreferenceId);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + *

Example: `projects/123/locations/global` + * @param quotaPreference Required. The resource being created + * @param quotaPreferenceId Optional. Id of the requesting object, must be unique under its + * parent. If client does not set this field, the service will generate one. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference( + LocationName parent, QuotaPreference quotaPreference, String quotaPreferenceId) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuotaPreference(quotaPreference) + .setQuotaPreferenceId(quotaPreferenceId) + .build(); + return createQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString();
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   String quotaPreferenceId = "quotaPreferenceId-948332050";
+   *   QuotaPreference response =
+   *       cloudQuotasClient.createQuotaPreference(parent, quotaPreference, quotaPreferenceId);
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + *

Example: `projects/123/locations/global` + * @param quotaPreference Required. The resource being created + * @param quotaPreferenceId Optional. Id of the requesting object, must be unique under its + * parent. If client does not set this field, the service will generate one. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference( + String parent, QuotaPreference quotaPreference, String quotaPreferenceId) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(parent) + .setQuotaPreference(quotaPreference) + .setQuotaPreferenceId(quotaPreferenceId) + .build(); + return createQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   CreateQuotaPreferenceRequest request =
+   *       CreateQuotaPreferenceRequest.newBuilder()
+   *           .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
+   *           .setQuotaPreferenceId("quotaPreferenceId-948332050")
+   *           .setQuotaPreference(QuotaPreference.newBuilder().build())
+   *           .addAllIgnoreSafetyChecks(new ArrayList())
+   *           .build();
+   *   QuotaPreference response = cloudQuotasClient.createQuotaPreference(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference createQuotaPreference(CreateQuotaPreferenceRequest request) { + return createQuotaPreferenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   CreateQuotaPreferenceRequest request =
+   *       CreateQuotaPreferenceRequest.newBuilder()
+   *           .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
+   *           .setQuotaPreferenceId("quotaPreferenceId-948332050")
+   *           .setQuotaPreference(QuotaPreference.newBuilder().build())
+   *           .addAllIgnoreSafetyChecks(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.createQuotaPreferenceCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaPreference response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createQuotaPreferenceCallable() { + return stub.createQuotaPreferenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single QuotaPreference. It can updates the config in any states, + * not just the ones pending approval. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   QuotaPreference quotaPreference = QuotaPreference.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   QuotaPreference response =
+   *       cloudQuotasClient.updateQuotaPreference(quotaPreference, updateMask);
+   * }
+   * }
+ * + * @param quotaPreference Required. The resource being updated + * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference updateQuotaPreference( + QuotaPreference quotaPreference, FieldMask updateMask) { + UpdateQuotaPreferenceRequest request = + UpdateQuotaPreferenceRequest.newBuilder() + .setQuotaPreference(quotaPreference) + .setUpdateMask(updateMask) + .build(); + return updateQuotaPreference(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single QuotaPreference. It can updates the config in any states, + * not just the ones pending approval. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   UpdateQuotaPreferenceRequest request =
+   *       UpdateQuotaPreferenceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setQuotaPreference(QuotaPreference.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .setValidateOnly(true)
+   *           .addAllIgnoreSafetyChecks(new ArrayList())
+   *           .build();
+   *   QuotaPreference response = cloudQuotasClient.updateQuotaPreference(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QuotaPreference updateQuotaPreference(UpdateQuotaPreferenceRequest request) { + return updateQuotaPreferenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single QuotaPreference. It can updates the config in any states, + * not just the ones pending approval. + * + *

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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+   *   UpdateQuotaPreferenceRequest request =
+   *       UpdateQuotaPreferenceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setQuotaPreference(QuotaPreference.newBuilder().build())
+   *           .setAllowMissing(true)
+   *           .setValidateOnly(true)
+   *           .addAllIgnoreSafetyChecks(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudQuotasClient.updateQuotaPreferenceCallable().futureCall(request);
+   *   // Do something.
+   *   QuotaPreference response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updateQuotaPreferenceCallable() { + return stub.updateQuotaPreferenceCallable(); + } + + @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 ListQuotaInfosPagedResponse + extends AbstractPagedListResponse< + ListQuotaInfosRequest, + ListQuotaInfosResponse, + QuotaInfo, + ListQuotaInfosPage, + ListQuotaInfosFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListQuotaInfosPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListQuotaInfosPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListQuotaInfosPagedResponse(ListQuotaInfosPage page) { + super(page, ListQuotaInfosFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListQuotaInfosPage + extends AbstractPage< + ListQuotaInfosRequest, ListQuotaInfosResponse, QuotaInfo, ListQuotaInfosPage> { + + private ListQuotaInfosPage( + PageContext context, + ListQuotaInfosResponse response) { + super(context, response); + } + + private static ListQuotaInfosPage createEmptyPage() { + return new ListQuotaInfosPage(null, null); + } + + @Override + protected ListQuotaInfosPage createPage( + PageContext context, + ListQuotaInfosResponse response) { + return new ListQuotaInfosPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListQuotaInfosFixedSizeCollection + extends AbstractFixedSizeCollection< + ListQuotaInfosRequest, + ListQuotaInfosResponse, + QuotaInfo, + ListQuotaInfosPage, + ListQuotaInfosFixedSizeCollection> { + + private ListQuotaInfosFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListQuotaInfosFixedSizeCollection createEmptyCollection() { + return new ListQuotaInfosFixedSizeCollection(null, 0); + } + + @Override + protected ListQuotaInfosFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListQuotaInfosFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListQuotaPreferencesPagedResponse + extends AbstractPagedListResponse< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + QuotaPreference, + ListQuotaPreferencesPage, + ListQuotaPreferencesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListQuotaPreferencesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListQuotaPreferencesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListQuotaPreferencesPagedResponse(ListQuotaPreferencesPage page) { + super(page, ListQuotaPreferencesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListQuotaPreferencesPage + extends AbstractPage< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + QuotaPreference, + ListQuotaPreferencesPage> { + + private ListQuotaPreferencesPage( + PageContext + context, + ListQuotaPreferencesResponse response) { + super(context, response); + } + + private static ListQuotaPreferencesPage createEmptyPage() { + return new ListQuotaPreferencesPage(null, null); + } + + @Override + protected ListQuotaPreferencesPage createPage( + PageContext + context, + ListQuotaPreferencesResponse response) { + return new ListQuotaPreferencesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListQuotaPreferencesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + QuotaPreference, + ListQuotaPreferencesPage, + ListQuotaPreferencesFixedSizeCollection> { + + private ListQuotaPreferencesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListQuotaPreferencesFixedSizeCollection createEmptyCollection() { + return new ListQuotaPreferencesFixedSizeCollection(null, 0); + } + + @Override + protected ListQuotaPreferencesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListQuotaPreferencesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasSettings.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasSettings.java new file mode 100644 index 000000000000..578948a61505 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasSettings.java @@ -0,0 +1,275 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1.stub.CloudQuotasStubSettings; +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 java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link CloudQuotasClient}. + * + *

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

    + *
  • The default service address (cloudquotas.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 getQuotaInfo 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
+ * CloudQuotasSettings.Builder cloudQuotasSettingsBuilder = CloudQuotasSettings.newBuilder();
+ * cloudQuotasSettingsBuilder
+ *     .getQuotaInfoSettings()
+ *     .setRetrySettings(
+ *         cloudQuotasSettingsBuilder
+ *             .getQuotaInfoSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudQuotasSettings cloudQuotasSettings = cloudQuotasSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudQuotasSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listQuotaInfos. */ + public PagedCallSettings< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).listQuotaInfosSettings(); + } + + /** Returns the object with the settings used for calls to getQuotaInfo. */ + public UnaryCallSettings getQuotaInfoSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).getQuotaInfoSettings(); + } + + /** Returns the object with the settings used for calls to listQuotaPreferences. */ + public PagedCallSettings< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).listQuotaPreferencesSettings(); + } + + /** Returns the object with the settings used for calls to getQuotaPreference. */ + public UnaryCallSettings + getQuotaPreferenceSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).getQuotaPreferenceSettings(); + } + + /** Returns the object with the settings used for calls to createQuotaPreference. */ + public UnaryCallSettings + createQuotaPreferenceSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).createQuotaPreferenceSettings(); + } + + /** Returns the object with the settings used for calls to updateQuotaPreference. */ + public UnaryCallSettings + updateQuotaPreferenceSettings() { + return ((CloudQuotasStubSettings) getStubSettings()).updateQuotaPreferenceSettings(); + } + + public static final CloudQuotasSettings create(CloudQuotasStubSettings stub) throws IOException { + return new CloudQuotasSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudQuotasStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudQuotasStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudQuotasStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudQuotasStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudQuotasStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudQuotasStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudQuotasStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudQuotasStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudQuotasSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudQuotasSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudQuotasStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudQuotasSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudQuotasStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudQuotasStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(CloudQuotasStubSettings.newHttpJsonBuilder()); + } + + public CloudQuotasStubSettings.Builder getStubSettingsBuilder() { + return ((CloudQuotasStubSettings.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 listQuotaInfos. */ + public PagedCallSettings.Builder< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings() { + return getStubSettingsBuilder().listQuotaInfosSettings(); + } + + /** Returns the builder for the settings used for calls to getQuotaInfo. */ + public UnaryCallSettings.Builder getQuotaInfoSettings() { + return getStubSettingsBuilder().getQuotaInfoSettings(); + } + + /** Returns the builder for the settings used for calls to listQuotaPreferences. */ + public PagedCallSettings.Builder< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings() { + return getStubSettingsBuilder().listQuotaPreferencesSettings(); + } + + /** Returns the builder for the settings used for calls to getQuotaPreference. */ + public UnaryCallSettings.Builder + getQuotaPreferenceSettings() { + return getStubSettingsBuilder().getQuotaPreferenceSettings(); + } + + /** Returns the builder for the settings used for calls to createQuotaPreference. */ + public UnaryCallSettings.Builder + createQuotaPreferenceSettings() { + return getStubSettingsBuilder().createQuotaPreferenceSettings(); + } + + /** Returns the builder for the settings used for calls to updateQuotaPreference. */ + public UnaryCallSettings.Builder + updateQuotaPreferenceSettings() { + return getStubSettingsBuilder().updateQuotaPreferenceSettings(); + } + + @Override + public CloudQuotasSettings build() throws IOException { + return new CloudQuotasSettings(this); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/gapic_metadata.json b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/gapic_metadata.json new file mode 100644 index 000000000000..948f97f79e54 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.api.cloudquotas.v1", + "libraryPackage": "com.google.api.cloudquotas.v1", + "services": { + "CloudQuotas": { + "clients": { + "grpc": { + "libraryClient": "CloudQuotasClient", + "rpcs": { + "CreateQuotaPreference": { + "methods": ["createQuotaPreference", "createQuotaPreference", "createQuotaPreference", "createQuotaPreference", "createQuotaPreference", "createQuotaPreferenceCallable"] + }, + "GetQuotaInfo": { + "methods": ["getQuotaInfo", "getQuotaInfo", "getQuotaInfo", "getQuotaInfoCallable"] + }, + "GetQuotaPreference": { + "methods": ["getQuotaPreference", "getQuotaPreference", "getQuotaPreference", "getQuotaPreferenceCallable"] + }, + "ListQuotaInfos": { + "methods": ["listQuotaInfos", "listQuotaInfos", "listQuotaInfos", "listQuotaInfosPagedCallable", "listQuotaInfosCallable"] + }, + "ListQuotaPreferences": { + "methods": ["listQuotaPreferences", "listQuotaPreferences", "listQuotaPreferences", "listQuotaPreferencesPagedCallable", "listQuotaPreferencesCallable"] + }, + "UpdateQuotaPreference": { + "methods": ["updateQuotaPreference", "updateQuotaPreference", "updateQuotaPreferenceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/package-info.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/package-info.java new file mode 100644 index 000000000000..8452aa27a2cd --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/package-info.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Quotas API + * + *

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

======================= CloudQuotasClient ======================= + * + *

Service Description: The Cloud Quotas API is an infrastructure service for Google Cloud that + * lets service consumers list and manage their resource usage limits. + * + *

- List/Get the metadata and current status of the quotas for a service. - Create/Update quota + * preferencess that declare the preferred quota values. - Check the status of a quota preference + * request. - List/Get pending and historical quota preference. + * + *

Sample for CloudQuotasClient: + * + *

{@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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) {
+ *   QuotaInfoName name =
+ *       QuotaInfoName.ofProjectLocationServiceQuotaInfoName(
+ *           "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]");
+ *   QuotaInfo response = cloudQuotasClient.getQuotaInfo(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.api.cloudquotas.v1; + +import javax.annotation.Generated; diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/CloudQuotasStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/CloudQuotasStub.java new file mode 100644 index 000000000000..a699f000b7e3 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/CloudQuotasStub.java @@ -0,0 +1,84 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.stub; + +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudQuotas service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CloudQuotasStub implements BackgroundResource { + + public UnaryCallable + listQuotaInfosPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaInfosPagedCallable()"); + } + + public UnaryCallable listQuotaInfosCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaInfosCallable()"); + } + + public UnaryCallable getQuotaInfoCallable() { + throw new UnsupportedOperationException("Not implemented: getQuotaInfoCallable()"); + } + + public UnaryCallable + listQuotaPreferencesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaPreferencesPagedCallable()"); + } + + public UnaryCallable + listQuotaPreferencesCallable() { + throw new UnsupportedOperationException("Not implemented: listQuotaPreferencesCallable()"); + } + + public UnaryCallable getQuotaPreferenceCallable() { + throw new UnsupportedOperationException("Not implemented: getQuotaPreferenceCallable()"); + } + + public UnaryCallable + createQuotaPreferenceCallable() { + throw new UnsupportedOperationException("Not implemented: createQuotaPreferenceCallable()"); + } + + public UnaryCallable + updateQuotaPreferenceCallable() { + throw new UnsupportedOperationException("Not implemented: updateQuotaPreferenceCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/CloudQuotasStubSettings.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/CloudQuotasStubSettings.java new file mode 100644 index 000000000000..3bc84277a266 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/CloudQuotasStubSettings.java @@ -0,0 +1,611 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.stub; + +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest; +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 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 CloudQuotasStub}. + * + *

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

    + *
  • The default service address (cloudquotas.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 getQuotaInfo 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
+ * CloudQuotasStubSettings.Builder cloudQuotasSettingsBuilder =
+ *     CloudQuotasStubSettings.newBuilder();
+ * cloudQuotasSettingsBuilder
+ *     .getQuotaInfoSettings()
+ *     .setRetrySettings(
+ *         cloudQuotasSettingsBuilder
+ *             .getQuotaInfoSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudQuotasStubSettings cloudQuotasSettings = cloudQuotasSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudQuotasStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings; + private final UnaryCallSettings getQuotaInfoSettings; + private final PagedCallSettings< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings; + private final UnaryCallSettings + getQuotaPreferenceSettings; + private final UnaryCallSettings + createQuotaPreferenceSettings; + private final UnaryCallSettings + updateQuotaPreferenceSettings; + + private static final PagedListDescriptor + LIST_QUOTA_INFOS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListQuotaInfosRequest injectToken(ListQuotaInfosRequest payload, String token) { + return ListQuotaInfosRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListQuotaInfosRequest injectPageSize( + ListQuotaInfosRequest payload, int pageSize) { + return ListQuotaInfosRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListQuotaInfosRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListQuotaInfosResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListQuotaInfosResponse payload) { + return payload.getQuotaInfosList() == null + ? ImmutableList.of() + : payload.getQuotaInfosList(); + } + }; + + private static final PagedListDescriptor< + ListQuotaPreferencesRequest, ListQuotaPreferencesResponse, QuotaPreference> + LIST_QUOTA_PREFERENCES_PAGE_STR_DESC = + new PagedListDescriptor< + ListQuotaPreferencesRequest, ListQuotaPreferencesResponse, QuotaPreference>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListQuotaPreferencesRequest injectToken( + ListQuotaPreferencesRequest payload, String token) { + return ListQuotaPreferencesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListQuotaPreferencesRequest injectPageSize( + ListQuotaPreferencesRequest payload, int pageSize) { + return ListQuotaPreferencesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListQuotaPreferencesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListQuotaPreferencesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListQuotaPreferencesResponse payload) { + return payload.getQuotaPreferencesList() == null + ? ImmutableList.of() + : payload.getQuotaPreferencesList(); + } + }; + + private static final PagedListResponseFactory< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + LIST_QUOTA_INFOS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListQuotaInfosRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_QUOTA_INFOS_PAGE_STR_DESC, request, context); + return ListQuotaInfosPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + LIST_QUOTA_PREFERENCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListQuotaPreferencesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListQuotaPreferencesRequest, ListQuotaPreferencesResponse, QuotaPreference> + pageContext = + PageContext.create( + callable, LIST_QUOTA_PREFERENCES_PAGE_STR_DESC, request, context); + return ListQuotaPreferencesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listQuotaInfos. */ + public PagedCallSettings< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings() { + return listQuotaInfosSettings; + } + + /** Returns the object with the settings used for calls to getQuotaInfo. */ + public UnaryCallSettings getQuotaInfoSettings() { + return getQuotaInfoSettings; + } + + /** Returns the object with the settings used for calls to listQuotaPreferences. */ + public PagedCallSettings< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings() { + return listQuotaPreferencesSettings; + } + + /** Returns the object with the settings used for calls to getQuotaPreference. */ + public UnaryCallSettings + getQuotaPreferenceSettings() { + return getQuotaPreferenceSettings; + } + + /** Returns the object with the settings used for calls to createQuotaPreference. */ + public UnaryCallSettings + createQuotaPreferenceSettings() { + return createQuotaPreferenceSettings; + } + + /** Returns the object with the settings used for calls to updateQuotaPreference. */ + public UnaryCallSettings + updateQuotaPreferenceSettings() { + return updateQuotaPreferenceSettings; + } + + public CloudQuotasStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudQuotasStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudQuotasStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudquotas.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudquotas.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudQuotasStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudQuotasStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudQuotasStubSettings.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 CloudQuotasStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listQuotaInfosSettings = settingsBuilder.listQuotaInfosSettings().build(); + getQuotaInfoSettings = settingsBuilder.getQuotaInfoSettings().build(); + listQuotaPreferencesSettings = settingsBuilder.listQuotaPreferencesSettings().build(); + getQuotaPreferenceSettings = settingsBuilder.getQuotaPreferenceSettings().build(); + createQuotaPreferenceSettings = settingsBuilder.createQuotaPreferenceSettings().build(); + updateQuotaPreferenceSettings = settingsBuilder.updateQuotaPreferenceSettings().build(); + } + + /** Builder for CloudQuotasStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings; + private final UnaryCallSettings.Builder getQuotaInfoSettings; + private final PagedCallSettings.Builder< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings; + private final UnaryCallSettings.Builder + getQuotaPreferenceSettings; + private final UnaryCallSettings.Builder + createQuotaPreferenceSettings; + private final UnaryCallSettings.Builder + updateQuotaPreferenceSettings; + 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); + + listQuotaInfosSettings = PagedCallSettings.newBuilder(LIST_QUOTA_INFOS_PAGE_STR_FACT); + getQuotaInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listQuotaPreferencesSettings = + PagedCallSettings.newBuilder(LIST_QUOTA_PREFERENCES_PAGE_STR_FACT); + getQuotaPreferenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createQuotaPreferenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateQuotaPreferenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listQuotaInfosSettings, + getQuotaInfoSettings, + listQuotaPreferencesSettings, + getQuotaPreferenceSettings, + createQuotaPreferenceSettings, + updateQuotaPreferenceSettings); + initDefaults(this); + } + + protected Builder(CloudQuotasStubSettings settings) { + super(settings); + + listQuotaInfosSettings = settings.listQuotaInfosSettings.toBuilder(); + getQuotaInfoSettings = settings.getQuotaInfoSettings.toBuilder(); + listQuotaPreferencesSettings = settings.listQuotaPreferencesSettings.toBuilder(); + getQuotaPreferenceSettings = settings.getQuotaPreferenceSettings.toBuilder(); + createQuotaPreferenceSettings = settings.createQuotaPreferenceSettings.toBuilder(); + updateQuotaPreferenceSettings = settings.updateQuotaPreferenceSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listQuotaInfosSettings, + getQuotaInfoSettings, + listQuotaPreferencesSettings, + getQuotaPreferenceSettings, + createQuotaPreferenceSettings, + updateQuotaPreferenceSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listQuotaInfosSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getQuotaInfoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listQuotaPreferencesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getQuotaPreferenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createQuotaPreferenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updateQuotaPreferenceSettings() + .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 listQuotaInfos. */ + public PagedCallSettings.Builder< + ListQuotaInfosRequest, ListQuotaInfosResponse, ListQuotaInfosPagedResponse> + listQuotaInfosSettings() { + return listQuotaInfosSettings; + } + + /** Returns the builder for the settings used for calls to getQuotaInfo. */ + public UnaryCallSettings.Builder getQuotaInfoSettings() { + return getQuotaInfoSettings; + } + + /** Returns the builder for the settings used for calls to listQuotaPreferences. */ + public PagedCallSettings.Builder< + ListQuotaPreferencesRequest, + ListQuotaPreferencesResponse, + ListQuotaPreferencesPagedResponse> + listQuotaPreferencesSettings() { + return listQuotaPreferencesSettings; + } + + /** Returns the builder for the settings used for calls to getQuotaPreference. */ + public UnaryCallSettings.Builder + getQuotaPreferenceSettings() { + return getQuotaPreferenceSettings; + } + + /** Returns the builder for the settings used for calls to createQuotaPreference. */ + public UnaryCallSettings.Builder + createQuotaPreferenceSettings() { + return createQuotaPreferenceSettings; + } + + /** Returns the builder for the settings used for calls to updateQuotaPreference. */ + public UnaryCallSettings.Builder + updateQuotaPreferenceSettings() { + return updateQuotaPreferenceSettings; + } + + @Override + public CloudQuotasStubSettings build() throws IOException { + return new CloudQuotasStubSettings(this); + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/GrpcCloudQuotasCallableFactory.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/GrpcCloudQuotasCallableFactory.java new file mode 100644 index 000000000000..7114190414c6 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/GrpcCloudQuotasCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.stub; + +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 CloudQuotas service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudQuotasCallableFactory 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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/GrpcCloudQuotasStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/GrpcCloudQuotasStub.java new file mode 100644 index 000000000000..02e593908cf4 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/GrpcCloudQuotasStub.java @@ -0,0 +1,363 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.stub; + +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest; +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 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 CloudQuotas service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudQuotasStub extends CloudQuotasStub { + private static final MethodDescriptor + listQuotaInfosMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/ListQuotaInfos") + .setRequestMarshaller( + ProtoUtils.marshaller(ListQuotaInfosRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListQuotaInfosResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getQuotaInfoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/GetQuotaInfo") + .setRequestMarshaller(ProtoUtils.marshaller(GetQuotaInfoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QuotaInfo.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listQuotaPreferencesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/ListQuotaPreferences") + .setRequestMarshaller( + ProtoUtils.marshaller(ListQuotaPreferencesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListQuotaPreferencesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getQuotaPreferenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/GetQuotaPreference") + .setRequestMarshaller( + ProtoUtils.marshaller(GetQuotaPreferenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QuotaPreference.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createQuotaPreferenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/CreateQuotaPreference") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateQuotaPreferenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QuotaPreference.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateQuotaPreferenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/UpdateQuotaPreference") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateQuotaPreferenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(QuotaPreference.getDefaultInstance())) + .build(); + + private final UnaryCallable listQuotaInfosCallable; + private final UnaryCallable + listQuotaInfosPagedCallable; + private final UnaryCallable getQuotaInfoCallable; + private final UnaryCallable + listQuotaPreferencesCallable; + private final UnaryCallable + listQuotaPreferencesPagedCallable; + private final UnaryCallable + getQuotaPreferenceCallable; + private final UnaryCallable + createQuotaPreferenceCallable; + private final UnaryCallable + updateQuotaPreferenceCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudQuotasStub create(CloudQuotasStubSettings settings) + throws IOException { + return new GrpcCloudQuotasStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudQuotasStub create(ClientContext clientContext) throws IOException { + return new GrpcCloudQuotasStub(CloudQuotasStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudQuotasStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudQuotasStub( + CloudQuotasStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudQuotasStub, 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 GrpcCloudQuotasStub(CloudQuotasStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCloudQuotasCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudQuotasStub, 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 GrpcCloudQuotasStub( + CloudQuotasStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listQuotaInfosTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listQuotaInfosMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getQuotaInfoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getQuotaInfoMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listQuotaPreferencesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listQuotaPreferencesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getQuotaPreferenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getQuotaPreferenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + createQuotaPreferenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createQuotaPreferenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + updateQuotaPreferenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateQuotaPreferenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "quota_preference.name", + String.valueOf(request.getQuotaPreference().getName())); + return builder.build(); + }) + .build(); + + this.listQuotaInfosCallable = + callableFactory.createUnaryCallable( + listQuotaInfosTransportSettings, settings.listQuotaInfosSettings(), clientContext); + this.listQuotaInfosPagedCallable = + callableFactory.createPagedCallable( + listQuotaInfosTransportSettings, settings.listQuotaInfosSettings(), clientContext); + this.getQuotaInfoCallable = + callableFactory.createUnaryCallable( + getQuotaInfoTransportSettings, settings.getQuotaInfoSettings(), clientContext); + this.listQuotaPreferencesCallable = + callableFactory.createUnaryCallable( + listQuotaPreferencesTransportSettings, + settings.listQuotaPreferencesSettings(), + clientContext); + this.listQuotaPreferencesPagedCallable = + callableFactory.createPagedCallable( + listQuotaPreferencesTransportSettings, + settings.listQuotaPreferencesSettings(), + clientContext); + this.getQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + getQuotaPreferenceTransportSettings, + settings.getQuotaPreferenceSettings(), + clientContext); + this.createQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + createQuotaPreferenceTransportSettings, + settings.createQuotaPreferenceSettings(), + clientContext); + this.updateQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + updateQuotaPreferenceTransportSettings, + settings.updateQuotaPreferenceSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listQuotaInfosCallable() { + return listQuotaInfosCallable; + } + + @Override + public UnaryCallable + listQuotaInfosPagedCallable() { + return listQuotaInfosPagedCallable; + } + + @Override + public UnaryCallable getQuotaInfoCallable() { + return getQuotaInfoCallable; + } + + @Override + public UnaryCallable + listQuotaPreferencesCallable() { + return listQuotaPreferencesCallable; + } + + @Override + public UnaryCallable + listQuotaPreferencesPagedCallable() { + return listQuotaPreferencesPagedCallable; + } + + @Override + public UnaryCallable getQuotaPreferenceCallable() { + return getQuotaPreferenceCallable; + } + + @Override + public UnaryCallable + createQuotaPreferenceCallable() { + return createQuotaPreferenceCallable; + } + + @Override + public UnaryCallable + updateQuotaPreferenceCallable() { + return updateQuotaPreferenceCallable; + } + + @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-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/HttpJsonCloudQuotasCallableFactory.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/HttpJsonCloudQuotasCallableFactory.java new file mode 100644 index 000000000000..1ee888ebe9ab --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/HttpJsonCloudQuotasCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.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 CloudQuotas service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCloudQuotasCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/HttpJsonCloudQuotasStub.java b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/HttpJsonCloudQuotasStub.java new file mode 100644 index 000000000000..103ddd2018ab --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/java/com/google/api/cloudquotas/v1/stub/HttpJsonCloudQuotasStub.java @@ -0,0 +1,578 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.stub; + +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest; +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 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 CloudQuotas service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCloudQuotasStub extends CloudQuotasStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listQuotaInfosMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/ListQuotaInfos") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*/services/*}/quotaInfos", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1/{parent=organizations/*/locations/*/services/*}/quotaInfos", + "/v1/{parent=folders/*/locations/*/services/*}/quotaInfos") + .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(ListQuotaInfosResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getQuotaInfoMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/GetQuotaInfo") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/services/*/quotaInfos/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=organizations/*/locations/*/services/*/quotaInfos/*}", + "/v1/{name=folders/*/locations/*/services/*/quotaInfos/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QuotaInfo.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListQuotaPreferencesRequest, ListQuotaPreferencesResponse> + listQuotaPreferencesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/ListQuotaPreferences") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/quotaPreferences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1/{parent=folders/*/locations/*}/quotaPreferences", + "/v1/{parent=organizations/*/locations/*}/quotaPreferences") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + 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(ListQuotaPreferencesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getQuotaPreferenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/GetQuotaPreference") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/quotaPreferences/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=organizations/*/locations/*/quotaPreferences/*}", + "/v1/{name=folders/*/locations/*/quotaPreferences/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QuotaPreference.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createQuotaPreferenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/CreateQuotaPreference") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/quotaPreferences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1/{parent=folders/*/locations/*}/quotaPreferences", + "/v1/{parent=organizations/*/locations/*}/quotaPreferences") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "ignoreSafetyChecks", request.getIgnoreSafetyChecksList()); + serializer.putQueryParam( + fields, "quotaPreferenceId", request.getQuotaPreferenceId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("quotaPreference", request.getQuotaPreference(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QuotaPreference.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateQuotaPreferenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.api.cloudquotas.v1.CloudQuotas/UpdateQuotaPreference") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{quotaPreference.name=projects/*/locations/*/quotaPreferences/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "quotaPreference.name", + request.getQuotaPreference().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{quotaPreference.name=folders/*/locations/*/quotaPreferences/*}", + "/v1/{quotaPreference.name=organizations/*/locations/*/quotaPreferences/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam( + fields, "ignoreSafetyChecks", request.getIgnoreSafetyChecksList()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("quotaPreference", request.getQuotaPreference(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(QuotaPreference.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listQuotaInfosCallable; + private final UnaryCallable + listQuotaInfosPagedCallable; + private final UnaryCallable getQuotaInfoCallable; + private final UnaryCallable + listQuotaPreferencesCallable; + private final UnaryCallable + listQuotaPreferencesPagedCallable; + private final UnaryCallable + getQuotaPreferenceCallable; + private final UnaryCallable + createQuotaPreferenceCallable; + private final UnaryCallable + updateQuotaPreferenceCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudQuotasStub create(CloudQuotasStubSettings settings) + throws IOException { + return new HttpJsonCloudQuotasStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudQuotasStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudQuotasStub( + CloudQuotasStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudQuotasStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudQuotasStub( + CloudQuotasStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudQuotasStub, 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 HttpJsonCloudQuotasStub(CloudQuotasStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonCloudQuotasCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudQuotasStub, 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 HttpJsonCloudQuotasStub( + CloudQuotasStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listQuotaInfosTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listQuotaInfosMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getQuotaInfoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getQuotaInfoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listQuotaPreferencesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listQuotaPreferencesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getQuotaPreferenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getQuotaPreferenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createQuotaPreferenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createQuotaPreferenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updateQuotaPreferenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateQuotaPreferenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "quota_preference.name", + String.valueOf(request.getQuotaPreference().getName())); + return builder.build(); + }) + .build(); + + this.listQuotaInfosCallable = + callableFactory.createUnaryCallable( + listQuotaInfosTransportSettings, settings.listQuotaInfosSettings(), clientContext); + this.listQuotaInfosPagedCallable = + callableFactory.createPagedCallable( + listQuotaInfosTransportSettings, settings.listQuotaInfosSettings(), clientContext); + this.getQuotaInfoCallable = + callableFactory.createUnaryCallable( + getQuotaInfoTransportSettings, settings.getQuotaInfoSettings(), clientContext); + this.listQuotaPreferencesCallable = + callableFactory.createUnaryCallable( + listQuotaPreferencesTransportSettings, + settings.listQuotaPreferencesSettings(), + clientContext); + this.listQuotaPreferencesPagedCallable = + callableFactory.createPagedCallable( + listQuotaPreferencesTransportSettings, + settings.listQuotaPreferencesSettings(), + clientContext); + this.getQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + getQuotaPreferenceTransportSettings, + settings.getQuotaPreferenceSettings(), + clientContext); + this.createQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + createQuotaPreferenceTransportSettings, + settings.createQuotaPreferenceSettings(), + clientContext); + this.updateQuotaPreferenceCallable = + callableFactory.createUnaryCallable( + updateQuotaPreferenceTransportSettings, + settings.updateQuotaPreferenceSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listQuotaInfosMethodDescriptor); + methodDescriptors.add(getQuotaInfoMethodDescriptor); + methodDescriptors.add(listQuotaPreferencesMethodDescriptor); + methodDescriptors.add(getQuotaPreferenceMethodDescriptor); + methodDescriptors.add(createQuotaPreferenceMethodDescriptor); + methodDescriptors.add(updateQuotaPreferenceMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listQuotaInfosCallable() { + return listQuotaInfosCallable; + } + + @Override + public UnaryCallable + listQuotaInfosPagedCallable() { + return listQuotaInfosPagedCallable; + } + + @Override + public UnaryCallable getQuotaInfoCallable() { + return getQuotaInfoCallable; + } + + @Override + public UnaryCallable + listQuotaPreferencesCallable() { + return listQuotaPreferencesCallable; + } + + @Override + public UnaryCallable + listQuotaPreferencesPagedCallable() { + return listQuotaPreferencesPagedCallable; + } + + @Override + public UnaryCallable getQuotaPreferenceCallable() { + return getQuotaPreferenceCallable; + } + + @Override + public UnaryCallable + createQuotaPreferenceCallable() { + return createQuotaPreferenceCallable; + } + + @Override + public UnaryCallable + updateQuotaPreferenceCallable() { + return updateQuotaPreferenceCallable; + } + + @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-cloudquotas/google-cloud-cloudquotas/src/main/resources/META-INF/native-image/com.google.api.cloudquotas.v1/reflect-config.json b/java-cloudquotas/google-cloud-cloudquotas/src/main/resources/META-INF/native-image/com.google.api.cloudquotas.v1/reflect-config.json new file mode 100644 index 000000000000..44ca7bba3d17 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/main/resources/META-INF/native-image/com.google.api.cloudquotas.v1/reflect-config.json @@ -0,0 +1,1478 @@ +[ + { + "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.api.cloudquotas.v1.CreateQuotaPreferenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.DimensionsInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.DimensionsInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.GetQuotaInfoRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.GetQuotaInfoRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.ListQuotaInfosRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.ListQuotaInfosRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.ListQuotaInfosResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.ListQuotaInfosResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaConfig$Origin", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaIncreaseEligibility", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaIncreaseEligibility$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaIncreaseEligibility$IneligibilityReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaInfo$ContainerType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaPreference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaPreference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.QuotaSafetyCheck", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BoolValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.BytesValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DoubleValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FloatValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Int64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.StringValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt32Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.UInt64Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/CloudQuotasClientHttpJsonTest.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/CloudQuotasClientHttpJsonTest.java new file mode 100644 index 000000000000..c508d8a30c94 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/CloudQuotasClientHttpJsonTest.java @@ -0,0 +1,856 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.cloudquotas.v1.stub.HttpJsonCloudQuotasStub; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.common.collect.Lists; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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 CloudQuotasClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudQuotasClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudQuotasStub.getMethodDescriptors(), + CloudQuotasSettings.getDefaultEndpoint()); + CloudQuotasSettings settings = + CloudQuotasSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudQuotasSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudQuotasClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listQuotaInfosTest() throws Exception { + QuotaInfo responsesElement = QuotaInfo.newBuilder().build(); + ListQuotaInfosResponse expectedResponse = + ListQuotaInfosResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaInfos(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + + ListQuotaInfosPagedResponse pagedListResponse = client.listQuotaInfos(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaInfosList().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 listQuotaInfosExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + client.listQuotaInfos(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaInfosTest2() throws Exception { + QuotaInfo responsesElement = QuotaInfo.newBuilder().build(); + ListQuotaInfosResponse expectedResponse = + ListQuotaInfosResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaInfos(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-4913/locations/location-4913/services/service-4913"; + + ListQuotaInfosPagedResponse pagedListResponse = client.listQuotaInfos(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaInfosList().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 listQuotaInfosExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-4913/locations/location-4913/services/service-4913"; + client.listQuotaInfos(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaInfoTest() throws Exception { + QuotaInfo expectedResponse = + QuotaInfo.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .setQuotaId("quotaId664373683") + .setMetric("metric-1077545552") + .setService("service1984153269") + .setIsPrecise(true) + .setRefreshInterval("refreshInterval1919275200") + .addAllDimensions(new ArrayList()) + .setMetricDisplayName("metricDisplayName974527133") + .setQuotaDisplayName("quotaDisplayName1494811861") + .setMetricUnit("metricUnit-610538668") + .setQuotaIncreaseEligibility(QuotaIncreaseEligibility.newBuilder().build()) + .setIsFixed(true) + .addAllDimensionsInfos(new ArrayList()) + .setIsConcurrent(true) + .setServiceRequestQuotaUri("serviceRequestQuotaUri1402291214") + .build(); + mockService.addResponse(expectedResponse); + + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + + QuotaInfo actualResponse = client.getQuotaInfo(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getQuotaInfoExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + client.getQuotaInfo(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaInfoTest2() throws Exception { + QuotaInfo expectedResponse = + QuotaInfo.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .setQuotaId("quotaId664373683") + .setMetric("metric-1077545552") + .setService("service1984153269") + .setIsPrecise(true) + .setRefreshInterval("refreshInterval1919275200") + .addAllDimensions(new ArrayList()) + .setMetricDisplayName("metricDisplayName974527133") + .setQuotaDisplayName("quotaDisplayName1494811861") + .setMetricUnit("metricUnit-610538668") + .setQuotaIncreaseEligibility(QuotaIncreaseEligibility.newBuilder().build()) + .setIsFixed(true) + .addAllDimensionsInfos(new ArrayList()) + .setIsConcurrent(true) + .setServiceRequestQuotaUri("serviceRequestQuotaUri1402291214") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-4073/locations/location-4073/services/service-4073/quotaInfos/quotaInfo-4073"; + + QuotaInfo actualResponse = client.getQuotaInfo(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getQuotaInfoExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-4073/locations/location-4073/services/service-4073/quotaInfos/quotaInfo-4073"; + client.getQuotaInfo(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaPreferencesTest() throws Exception { + QuotaPreference responsesElement = QuotaPreference.newBuilder().build(); + ListQuotaPreferencesResponse expectedResponse = + ListQuotaPreferencesResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaPreferences(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + + ListQuotaPreferencesPagedResponse pagedListResponse = client.listQuotaPreferences(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaPreferencesList().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 listQuotaPreferencesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + client.listQuotaPreferences(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaPreferencesTest2() throws Exception { + QuotaPreference responsesElement = QuotaPreference.newBuilder().build(); + ListQuotaPreferencesResponse expectedResponse = + ListQuotaPreferencesResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaPreferences(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListQuotaPreferencesPagedResponse pagedListResponse = client.listQuotaPreferences(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaPreferencesList().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 listQuotaPreferencesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listQuotaPreferences(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockService.addResponse(expectedResponse); + + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + + QuotaPreference actualResponse = client.getQuotaPreference(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getQuotaPreferenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + client.getQuotaPreference(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaPreferenceTest2() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-3280/locations/location-3280/quotaPreferences/quotaPreference-3280"; + + QuotaPreference actualResponse = client.getQuotaPreference(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getQuotaPreferenceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-3280/locations/location-3280/quotaPreferences/quotaPreference-3280"; + client.getQuotaPreference(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + + QuotaPreference actualResponse = client.createQuotaPreference(parent, quotaPreference); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createQuotaPreferenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + client.createQuotaPreference(parent, quotaPreference); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest2() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + + QuotaPreference actualResponse = client.createQuotaPreference(parent, quotaPreference); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createQuotaPreferenceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + client.createQuotaPreference(parent, quotaPreference); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest3() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + + QuotaPreference actualResponse = + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createQuotaPreferenceExceptionTest3() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest4() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + + QuotaPreference actualResponse = + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createQuotaPreferenceExceptionTest4() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockService.addResponse(expectedResponse); + + QuotaPreference quotaPreference = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + QuotaPreference actualResponse = client.updateQuotaPreference(quotaPreference, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateQuotaPreferenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + QuotaPreference quotaPreference = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateQuotaPreference(quotaPreference, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/CloudQuotasClientTest.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/CloudQuotasClientTest.java new file mode 100644 index 000000000000..3c735659a963 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/CloudQuotasClientTest.java @@ -0,0 +1,761 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaInfosPagedResponse; +import static com.google.api.cloudquotas.v1.CloudQuotasClient.ListQuotaPreferencesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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 CloudQuotasClientTest { + private static MockCloudQuotas mockCloudQuotas; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudQuotasClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudQuotas = new MockCloudQuotas(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockCloudQuotas)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudQuotasSettings settings = + CloudQuotasSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudQuotasClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listQuotaInfosTest() throws Exception { + QuotaInfo responsesElement = QuotaInfo.newBuilder().build(); + ListQuotaInfosResponse expectedResponse = + ListQuotaInfosResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaInfos(Arrays.asList(responsesElement)) + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + + ListQuotaInfosPagedResponse pagedListResponse = client.listQuotaInfos(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaInfosList().get(0), resources.get(0)); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaInfosRequest actualRequest = ((ListQuotaInfosRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaInfosExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + client.listQuotaInfos(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaInfosTest2() throws Exception { + QuotaInfo responsesElement = QuotaInfo.newBuilder().build(); + ListQuotaInfosResponse expectedResponse = + ListQuotaInfosResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaInfos(Arrays.asList(responsesElement)) + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListQuotaInfosPagedResponse pagedListResponse = client.listQuotaInfos(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaInfosList().get(0), resources.get(0)); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaInfosRequest actualRequest = ((ListQuotaInfosRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaInfosExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String parent = "parent-995424086"; + client.listQuotaInfos(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaInfoTest() throws Exception { + QuotaInfo expectedResponse = + QuotaInfo.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .setQuotaId("quotaId664373683") + .setMetric("metric-1077545552") + .setService("service1984153269") + .setIsPrecise(true) + .setRefreshInterval("refreshInterval1919275200") + .addAllDimensions(new ArrayList()) + .setMetricDisplayName("metricDisplayName974527133") + .setQuotaDisplayName("quotaDisplayName1494811861") + .setMetricUnit("metricUnit-610538668") + .setQuotaIncreaseEligibility(QuotaIncreaseEligibility.newBuilder().build()) + .setIsFixed(true) + .addAllDimensionsInfos(new ArrayList()) + .setIsConcurrent(true) + .setServiceRequestQuotaUri("serviceRequestQuotaUri1402291214") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + + QuotaInfo actualResponse = client.getQuotaInfo(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaInfoRequest actualRequest = ((GetQuotaInfoRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaInfoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + client.getQuotaInfo(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaInfoTest2() throws Exception { + QuotaInfo expectedResponse = + QuotaInfo.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .setQuotaId("quotaId664373683") + .setMetric("metric-1077545552") + .setService("service1984153269") + .setIsPrecise(true) + .setRefreshInterval("refreshInterval1919275200") + .addAllDimensions(new ArrayList()) + .setMetricDisplayName("metricDisplayName974527133") + .setQuotaDisplayName("quotaDisplayName1494811861") + .setMetricUnit("metricUnit-610538668") + .setQuotaIncreaseEligibility(QuotaIncreaseEligibility.newBuilder().build()) + .setIsFixed(true) + .addAllDimensionsInfos(new ArrayList()) + .setIsConcurrent(true) + .setServiceRequestQuotaUri("serviceRequestQuotaUri1402291214") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String name = "name3373707"; + + QuotaInfo actualResponse = client.getQuotaInfo(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaInfoRequest actualRequest = ((GetQuotaInfoRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaInfoExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String name = "name3373707"; + client.getQuotaInfo(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaPreferencesTest() throws Exception { + QuotaPreference responsesElement = QuotaPreference.newBuilder().build(); + ListQuotaPreferencesResponse expectedResponse = + ListQuotaPreferencesResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaPreferences(Arrays.asList(responsesElement)) + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + + ListQuotaPreferencesPagedResponse pagedListResponse = client.listQuotaPreferences(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaPreferencesList().get(0), resources.get(0)); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaPreferencesRequest actualRequest = + ((ListQuotaPreferencesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaPreferencesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + client.listQuotaPreferences(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listQuotaPreferencesTest2() throws Exception { + QuotaPreference responsesElement = QuotaPreference.newBuilder().build(); + ListQuotaPreferencesResponse expectedResponse = + ListQuotaPreferencesResponse.newBuilder() + .setNextPageToken("") + .addAllQuotaPreferences(Arrays.asList(responsesElement)) + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListQuotaPreferencesPagedResponse pagedListResponse = client.listQuotaPreferences(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getQuotaPreferencesList().get(0), resources.get(0)); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListQuotaPreferencesRequest actualRequest = + ((ListQuotaPreferencesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listQuotaPreferencesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String parent = "parent-995424086"; + client.listQuotaPreferences(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + + QuotaPreference actualResponse = client.getQuotaPreference(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaPreferenceRequest actualRequest = ((GetQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaPreferenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + client.getQuotaPreference(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getQuotaPreferenceTest2() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String name = "name3373707"; + + QuotaPreference actualResponse = client.getQuotaPreference(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetQuotaPreferenceRequest actualRequest = ((GetQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getQuotaPreferenceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String name = "name3373707"; + client.getQuotaPreference(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + + QuotaPreference actualResponse = client.createQuotaPreference(parent, quotaPreference); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQuotaPreferenceRequest actualRequest = + ((CreateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQuotaPreferenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + client.createQuotaPreference(parent, quotaPreference); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest2() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String parent = "parent-995424086"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + + QuotaPreference actualResponse = client.createQuotaPreference(parent, quotaPreference); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQuotaPreferenceRequest actualRequest = + ((CreateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQuotaPreferenceExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String parent = "parent-995424086"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + client.createQuotaPreference(parent, quotaPreference); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest3() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + + QuotaPreference actualResponse = + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQuotaPreferenceRequest actualRequest = + ((CreateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertEquals(quotaPreferenceId, actualRequest.getQuotaPreferenceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQuotaPreferenceExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createQuotaPreferenceTest4() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + String parent = "parent-995424086"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + + QuotaPreference actualResponse = + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateQuotaPreferenceRequest actualRequest = + ((CreateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertEquals(quotaPreferenceId, actualRequest.getQuotaPreferenceId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createQuotaPreferenceExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + String parent = "parent-995424086"; + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + client.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateQuotaPreferenceTest() throws Exception { + QuotaPreference expectedResponse = + QuotaPreference.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .putAllDimensions(new HashMap()) + .setQuotaConfig(QuotaConfig.newBuilder().build()) + .setEtag("etag3123477") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setService("service1984153269") + .setQuotaId("quotaId664373683") + .setReconciling(true) + .setJustification("justification1864993522") + .build(); + mockCloudQuotas.addResponse(expectedResponse); + + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + QuotaPreference actualResponse = client.updateQuotaPreference(quotaPreference, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudQuotas.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateQuotaPreferenceRequest actualRequest = + ((UpdateQuotaPreferenceRequest) actualRequests.get(0)); + + Assert.assertEquals(quotaPreference, actualRequest.getQuotaPreference()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateQuotaPreferenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudQuotas.addException(exception); + + try { + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateQuotaPreference(quotaPreference, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/MockCloudQuotas.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/MockCloudQuotas.java new file mode 100644 index 000000000000..58077c1ee083 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/MockCloudQuotas.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +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 MockCloudQuotas implements MockGrpcService { + private final MockCloudQuotasImpl serviceImpl; + + public MockCloudQuotas() { + serviceImpl = new MockCloudQuotasImpl(); + } + + @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-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/MockCloudQuotasImpl.java b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/MockCloudQuotasImpl.java new file mode 100644 index 000000000000..1eb337b35648 --- /dev/null +++ b/java-cloudquotas/google-cloud-cloudquotas/src/test/java/com/google/api/cloudquotas/v1/MockCloudQuotasImpl.java @@ -0,0 +1,187 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import com.google.api.cloudquotas.v1.CloudQuotasGrpc.CloudQuotasImplBase; +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +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 MockCloudQuotasImpl extends CloudQuotasImplBase { + private List requests; + private Queue responses; + + public MockCloudQuotasImpl() { + 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 listQuotaInfos( + ListQuotaInfosRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListQuotaInfosResponse) { + requests.add(request); + responseObserver.onNext(((ListQuotaInfosResponse) 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 ListQuotaInfos, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListQuotaInfosResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getQuotaInfo( + GetQuotaInfoRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaInfo) { + requests.add(request); + responseObserver.onNext(((QuotaInfo) 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 GetQuotaInfo, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaInfo.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listQuotaPreferences( + ListQuotaPreferencesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListQuotaPreferencesResponse) { + requests.add(request); + responseObserver.onNext(((ListQuotaPreferencesResponse) 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 ListQuotaPreferences, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListQuotaPreferencesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getQuotaPreference( + GetQuotaPreferenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaPreference) { + requests.add(request); + responseObserver.onNext(((QuotaPreference) 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 GetQuotaPreference, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaPreference.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createQuotaPreference( + CreateQuotaPreferenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaPreference) { + requests.add(request); + responseObserver.onNext(((QuotaPreference) 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 CreateQuotaPreference, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaPreference.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateQuotaPreference( + UpdateQuotaPreferenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof QuotaPreference) { + requests.add(request); + responseObserver.onNext(((QuotaPreference) 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 UpdateQuotaPreference, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QuotaPreference.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudquotas/grpc-google-cloud-cloudquotas-v1/pom.xml b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1/pom.xml new file mode 100644 index 000000000000..69dcfe0bfa64 --- /dev/null +++ b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-cloudquotas-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-cloudquotas-v1 + GRPC library for google-cloud-cloudquotas + + com.google.cloud + google-cloud-cloudquotas-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.api.grpc + proto-google-cloud-cloudquotas-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-cloudquotas/grpc-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasGrpc.java b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasGrpc.java new file mode 100644 index 000000000000..cf9c366caf6c --- /dev/null +++ b/java-cloudquotas/grpc-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CloudQuotasGrpc.java @@ -0,0 +1,1015 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.api.cloudquotas.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+ * service consumers list and manage their resource usage limits.
+ * - List/Get the metadata and current status of the quotas for a service.
+ * - Create/Update quota preferencess that declare the preferred quota values.
+ * - Check the status of a quota preference request.
+ * - List/Get pending and historical quota preference.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/api/cloudquotas/v1/cloudquotas.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudQuotasGrpc { + + private CloudQuotasGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.api.cloudquotas.v1.CloudQuotas"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.ListQuotaInfosRequest, + com.google.api.cloudquotas.v1.ListQuotaInfosResponse> + getListQuotaInfosMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListQuotaInfos", + requestType = com.google.api.cloudquotas.v1.ListQuotaInfosRequest.class, + responseType = com.google.api.cloudquotas.v1.ListQuotaInfosResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.ListQuotaInfosRequest, + com.google.api.cloudquotas.v1.ListQuotaInfosResponse> + getListQuotaInfosMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.ListQuotaInfosRequest, + com.google.api.cloudquotas.v1.ListQuotaInfosResponse> + getListQuotaInfosMethod; + if ((getListQuotaInfosMethod = CloudQuotasGrpc.getListQuotaInfosMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getListQuotaInfosMethod = CloudQuotasGrpc.getListQuotaInfosMethod) == null) { + CloudQuotasGrpc.getListQuotaInfosMethod = + getListQuotaInfosMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListQuotaInfos")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.ListQuotaInfosRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.ListQuotaInfosResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("ListQuotaInfos")) + .build(); + } + } + } + return getListQuotaInfosMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.GetQuotaInfoRequest, + com.google.api.cloudquotas.v1.QuotaInfo> + getGetQuotaInfoMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetQuotaInfo", + requestType = com.google.api.cloudquotas.v1.GetQuotaInfoRequest.class, + responseType = com.google.api.cloudquotas.v1.QuotaInfo.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.GetQuotaInfoRequest, + com.google.api.cloudquotas.v1.QuotaInfo> + getGetQuotaInfoMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.GetQuotaInfoRequest, + com.google.api.cloudquotas.v1.QuotaInfo> + getGetQuotaInfoMethod; + if ((getGetQuotaInfoMethod = CloudQuotasGrpc.getGetQuotaInfoMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getGetQuotaInfoMethod = CloudQuotasGrpc.getGetQuotaInfoMethod) == null) { + CloudQuotasGrpc.getGetQuotaInfoMethod = + getGetQuotaInfoMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetQuotaInfo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.GetQuotaInfoRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.QuotaInfo.getDefaultInstance())) + .setSchemaDescriptor(new CloudQuotasMethodDescriptorSupplier("GetQuotaInfo")) + .build(); + } + } + } + return getGetQuotaInfoMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest, + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse> + getListQuotaPreferencesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListQuotaPreferences", + requestType = com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest.class, + responseType = com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest, + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse> + getListQuotaPreferencesMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest, + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse> + getListQuotaPreferencesMethod; + if ((getListQuotaPreferencesMethod = CloudQuotasGrpc.getListQuotaPreferencesMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getListQuotaPreferencesMethod = CloudQuotasGrpc.getListQuotaPreferencesMethod) + == null) { + CloudQuotasGrpc.getListQuotaPreferencesMethod = + getListQuotaPreferencesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListQuotaPreferences")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("ListQuotaPreferences")) + .build(); + } + } + } + return getListQuotaPreferencesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getGetQuotaPreferenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetQuotaPreference", + requestType = com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest.class, + responseType = com.google.api.cloudquotas.v1.QuotaPreference.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getGetQuotaPreferenceMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getGetQuotaPreferenceMethod; + if ((getGetQuotaPreferenceMethod = CloudQuotasGrpc.getGetQuotaPreferenceMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getGetQuotaPreferenceMethod = CloudQuotasGrpc.getGetQuotaPreferenceMethod) == null) { + CloudQuotasGrpc.getGetQuotaPreferenceMethod = + getGetQuotaPreferenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetQuotaPreference")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("GetQuotaPreference")) + .build(); + } + } + } + return getGetQuotaPreferenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getCreateQuotaPreferenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateQuotaPreference", + requestType = com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest.class, + responseType = com.google.api.cloudquotas.v1.QuotaPreference.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getCreateQuotaPreferenceMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getCreateQuotaPreferenceMethod; + if ((getCreateQuotaPreferenceMethod = CloudQuotasGrpc.getCreateQuotaPreferenceMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getCreateQuotaPreferenceMethod = CloudQuotasGrpc.getCreateQuotaPreferenceMethod) + == null) { + CloudQuotasGrpc.getCreateQuotaPreferenceMethod = + getCreateQuotaPreferenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateQuotaPreference")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("CreateQuotaPreference")) + .build(); + } + } + } + return getCreateQuotaPreferenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getUpdateQuotaPreferenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateQuotaPreference", + requestType = com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest.class, + responseType = com.google.api.cloudquotas.v1.QuotaPreference.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getUpdateQuotaPreferenceMethod() { + io.grpc.MethodDescriptor< + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference> + getUpdateQuotaPreferenceMethod; + if ((getUpdateQuotaPreferenceMethod = CloudQuotasGrpc.getUpdateQuotaPreferenceMethod) == null) { + synchronized (CloudQuotasGrpc.class) { + if ((getUpdateQuotaPreferenceMethod = CloudQuotasGrpc.getUpdateQuotaPreferenceMethod) + == null) { + CloudQuotasGrpc.getUpdateQuotaPreferenceMethod = + getUpdateQuotaPreferenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdateQuotaPreference")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance())) + .setSchemaDescriptor( + new CloudQuotasMethodDescriptorSupplier("UpdateQuotaPreference")) + .build(); + } + } + } + return getUpdateQuotaPreferenceMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudQuotasStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudQuotasStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasStub(channel, callOptions); + } + }; + return CloudQuotasStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudQuotasBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudQuotasBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasBlockingStub(channel, callOptions); + } + }; + return CloudQuotasBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudQuotasFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudQuotasFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasFutureStub(channel, callOptions); + } + }; + return CloudQuotasFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists QuotaInfos of all quotas for a given project, folder or organization.
+     * 
+ */ + default void listQuotaInfos( + com.google.api.cloudquotas.v1.ListQuotaInfosRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListQuotaInfosMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieve the QuotaInfo of a quota for a project, folder or organization.
+     * 
+ */ + default void getQuotaInfo( + com.google.api.cloudquotas.v1.GetQuotaInfoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetQuotaInfoMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists QuotaPreferences in a given project, folder or organization.
+     * 
+ */ + default void listQuotaPreferences( + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListQuotaPreferencesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single QuotaPreference.
+     * 
+ */ + default void getQuotaPreference( + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetQuotaPreferenceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new QuotaPreference that declares the desired value for a quota.
+     * 
+ */ + default void createQuotaPreference( + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateQuotaPreferenceMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single QuotaPreference. It can updates the
+     * config in any states, not just the ones pending approval.
+     * 
+ */ + default void updateQuotaPreference( + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateQuotaPreferenceMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudQuotas. + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public abstract static class CloudQuotasImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudQuotasGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudQuotas. + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public static final class CloudQuotasStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudQuotasStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudQuotasStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists QuotaInfos of all quotas for a given project, folder or organization.
+     * 
+ */ + public void listQuotaInfos( + com.google.api.cloudquotas.v1.ListQuotaInfosRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListQuotaInfosMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieve the QuotaInfo of a quota for a project, folder or organization.
+     * 
+ */ + public void getQuotaInfo( + com.google.api.cloudquotas.v1.GetQuotaInfoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetQuotaInfoMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists QuotaPreferences in a given project, folder or organization.
+     * 
+ */ + public void listQuotaPreferences( + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListQuotaPreferencesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single QuotaPreference.
+     * 
+ */ + public void getQuotaPreference( + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetQuotaPreferenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new QuotaPreference that declares the desired value for a quota.
+     * 
+ */ + public void createQuotaPreference( + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateQuotaPreferenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single QuotaPreference. It can updates the
+     * config in any states, not just the ones pending approval.
+     * 
+ */ + public void updateQuotaPreference( + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateQuotaPreferenceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudQuotas. + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public static final class CloudQuotasBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudQuotasBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudQuotasBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists QuotaInfos of all quotas for a given project, folder or organization.
+     * 
+ */ + public com.google.api.cloudquotas.v1.ListQuotaInfosResponse listQuotaInfos( + com.google.api.cloudquotas.v1.ListQuotaInfosRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListQuotaInfosMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieve the QuotaInfo of a quota for a project, folder or organization.
+     * 
+ */ + public com.google.api.cloudquotas.v1.QuotaInfo getQuotaInfo( + com.google.api.cloudquotas.v1.GetQuotaInfoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetQuotaInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists QuotaPreferences in a given project, folder or organization.
+     * 
+ */ + public com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse listQuotaPreferences( + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListQuotaPreferencesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single QuotaPreference.
+     * 
+ */ + public com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreference( + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetQuotaPreferenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new QuotaPreference that declares the desired value for a quota.
+     * 
+ */ + public com.google.api.cloudquotas.v1.QuotaPreference createQuotaPreference( + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateQuotaPreferenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single QuotaPreference. It can updates the
+     * config in any states, not just the ones pending approval.
+     * 
+ */ + public com.google.api.cloudquotas.v1.QuotaPreference updateQuotaPreference( + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateQuotaPreferenceMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service CloudQuotas. + * + *
+   * The Cloud Quotas API is an infrastructure service for Google Cloud that lets
+   * service consumers list and manage their resource usage limits.
+   * - List/Get the metadata and current status of the quotas for a service.
+   * - Create/Update quota preferencess that declare the preferred quota values.
+   * - Check the status of a quota preference request.
+   * - List/Get pending and historical quota preference.
+   * 
+ */ + public static final class CloudQuotasFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudQuotasFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudQuotasFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudQuotasFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists QuotaInfos of all quotas for a given project, folder or organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1.ListQuotaInfosResponse> + listQuotaInfos(com.google.api.cloudquotas.v1.ListQuotaInfosRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListQuotaInfosMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieve the QuotaInfo of a quota for a project, folder or organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1.QuotaInfo> + getQuotaInfo(com.google.api.cloudquotas.v1.GetQuotaInfoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetQuotaInfoMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists QuotaPreferences in a given project, folder or organization.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse> + listQuotaPreferences(com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListQuotaPreferencesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single QuotaPreference.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1.QuotaPreference> + getQuotaPreference(com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetQuotaPreferenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new QuotaPreference that declares the desired value for a quota.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1.QuotaPreference> + createQuotaPreference(com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateQuotaPreferenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single QuotaPreference. It can updates the
+     * config in any states, not just the ones pending approval.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.api.cloudquotas.v1.QuotaPreference> + updateQuotaPreference(com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateQuotaPreferenceMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_QUOTA_INFOS = 0; + private static final int METHODID_GET_QUOTA_INFO = 1; + private static final int METHODID_LIST_QUOTA_PREFERENCES = 2; + private static final int METHODID_GET_QUOTA_PREFERENCE = 3; + private static final int METHODID_CREATE_QUOTA_PREFERENCE = 4; + private static final int METHODID_UPDATE_QUOTA_PREFERENCE = 5; + + 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_INFOS: + serviceImpl.listQuotaInfos( + (com.google.api.cloudquotas.v1.ListQuotaInfosRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_QUOTA_INFO: + serviceImpl.getQuotaInfo( + (com.google.api.cloudquotas.v1.GetQuotaInfoRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_QUOTA_PREFERENCES: + serviceImpl.listQuotaPreferences( + (com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse>) + responseObserver); + break; + case METHODID_GET_QUOTA_PREFERENCE: + serviceImpl.getQuotaPreference( + (com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_QUOTA_PREFERENCE: + serviceImpl.createQuotaPreference( + (com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_QUOTA_PREFERENCE: + serviceImpl.updateQuotaPreference( + (com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListQuotaInfosMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1.ListQuotaInfosRequest, + com.google.api.cloudquotas.v1.ListQuotaInfosResponse>( + service, METHODID_LIST_QUOTA_INFOS))) + .addMethod( + getGetQuotaInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1.GetQuotaInfoRequest, + com.google.api.cloudquotas.v1.QuotaInfo>(service, METHODID_GET_QUOTA_INFO))) + .addMethod( + getListQuotaPreferencesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest, + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse>( + service, METHODID_LIST_QUOTA_PREFERENCES))) + .addMethod( + getGetQuotaPreferenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference>( + service, METHODID_GET_QUOTA_PREFERENCE))) + .addMethod( + getCreateQuotaPreferenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference>( + service, METHODID_CREATE_QUOTA_PREFERENCE))) + .addMethod( + getUpdateQuotaPreferenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest, + com.google.api.cloudquotas.v1.QuotaPreference>( + service, METHODID_UPDATE_QUOTA_PREFERENCE))) + .build(); + } + + private abstract static class CloudQuotasBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudQuotasBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudQuotas"); + } + } + + private static final class CloudQuotasFileDescriptorSupplier + extends CloudQuotasBaseDescriptorSupplier { + CloudQuotasFileDescriptorSupplier() {} + } + + private static final class CloudQuotasMethodDescriptorSupplier + extends CloudQuotasBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudQuotasMethodDescriptorSupplier(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 (CloudQuotasGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudQuotasFileDescriptorSupplier()) + .addMethod(getListQuotaInfosMethod()) + .addMethod(getGetQuotaInfoMethod()) + .addMethod(getListQuotaPreferencesMethod()) + .addMethod(getGetQuotaPreferenceMethod()) + .addMethod(getCreateQuotaPreferenceMethod()) + .addMethod(getUpdateQuotaPreferenceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudquotas/owlbot.py b/java-cloudquotas/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-cloudquotas/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates(monorepo=True, excludes=[ + ".github/*", + ".kokoro/*", + "samples/*", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "SECURITY.md", + "java.header", + "license-checks.xml", + "renovate.json", + ".gitignore" +]) \ No newline at end of file diff --git a/java-cloudquotas/pom.xml b/java-cloudquotas/pom.xml new file mode 100644 index 000000000000..bbfce4076b62 --- /dev/null +++ b/java-cloudquotas/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudquotas-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Quotas API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.27.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-cloudquotas-parent + + + + + + com.google.cloud + google-cloud-cloudquotas + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudquotas-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-cloudquotas-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-cloudquotas + grpc-google-cloud-cloudquotas-v1 + proto-google-cloud-cloudquotas-v1 + google-cloud-cloudquotas-bom + + + diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/clirr-ignored-differences.xml b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..a23e90164d79 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/api/cloudquotas/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/api/cloudquotas/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/api/cloudquotas/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/pom.xml b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/pom.xml new file mode 100644 index 000000000000..12e6c76ceab2 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-cloudquotas-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-cloudquotas-v1 + Proto library for google-cloud-cloudquotas + + com.google.cloud + google-cloud-cloudquotas-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-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CloudquotasProto.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CloudquotasProto.java new file mode 100644 index 000000000000..fd11bca1c1c5 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CloudquotasProto.java @@ -0,0 +1,280 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public final class CloudquotasProto { + private CloudquotasProto() {} + + 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_api_cloudquotas_v1_ListQuotaInfosRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n+google/api/cloudquotas/v1/cloudquotas." + + "proto\022\031google.api.cloudquotas.v1\032\034google" + + "/api/annotations.proto\032\027google/api/clien" + + "t.proto\032)google/api/cloudquotas/v1/resou" + + "rces.proto\032\037google/api/field_behavior.pr" + + "oto\032\031google/api/resource.proto\032 google/p" + + "rotobuf/field_mask.proto\"\211\001\n\025ListQuotaIn" + + "fosRequest\022=\n\006parent\030\001 \001(\tB-\342A\001\002\372A&\022$clo" + + "udquotas.googleapis.com/QuotaInfo\022\027\n\tpag" + + "e_size\030\002 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\003 \001(\tB\004" + + "\342A\001\001\"l\n\026ListQuotaInfosResponse\0229\n\013quota_" + + "infos\030\001 \003(\0132$.google.api.cloudquotas.v1." + + "QuotaInfo\022\027\n\017next_page_token\030\002 \001(\t\"R\n\023Ge" + + "tQuotaInfoRequest\022;\n\004name\030\001 \001(\tB-\342A\001\002\372A&" + + "\n$cloudquotas.googleapis.com/QuotaInfo\"\303" + + "\001\n\033ListQuotaPreferencesRequest\022C\n\006parent" + + "\030\001 \001(\tB3\342A\001\002\372A,\022*cloudquotas.googleapis." + + "com/QuotaPreference\022\027\n\tpage_size\030\002 \001(\005B\004" + + "\342A\001\001\022\030\n\npage_token\030\003 \001(\tB\004\342A\001\001\022\024\n\006filter" + + "\030\004 \001(\tB\004\342A\001\001\022\026\n\010order_by\030\005 \001(\tB\004\342A\001\001\"\223\001\n" + + "\034ListQuotaPreferencesResponse\022E\n\021quota_p" + + "references\030\001 \003(\0132*.google.api.cloudquota" + + "s.v1.QuotaPreference\022\027\n\017next_page_token\030" + + "\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"^\n\031GetQuotaPr" + + "eferenceRequest\022A\n\004name\030\001 \001(\tB3\342A\001\002\372A,\n*" + + "cloudquotas.googleapis.com/QuotaPreferen" + + "ce\"\235\002\n\034CreateQuotaPreferenceRequest\022C\n\006p" + + "arent\030\001 \001(\tB3\342A\001\002\372A,\022*cloudquotas.google" + + "apis.com/QuotaPreference\022!\n\023quota_prefer" + + "ence_id\030\002 \001(\tB\004\342A\001\001\022J\n\020quota_preference\030" + + "\003 \001(\0132*.google.api.cloudquotas.v1.QuotaP" + + "referenceB\004\342A\001\002\022I\n\024ignore_safety_checks\030" + + "\004 \003(\0162+.google.api.cloudquotas.v1.QuotaS" + + "afetyCheck\"\246\002\n\034UpdateQuotaPreferenceRequ" + + "est\0225\n\013update_mask\030\001 \001(\0132\032.google.protob" + + "uf.FieldMaskB\004\342A\001\001\022J\n\020quota_preference\030\002" + + " \001(\0132*.google.api.cloudquotas.v1.QuotaPr" + + "eferenceB\004\342A\001\002\022\033\n\rallow_missing\030\003 \001(\010B\004\342" + + "A\001\001\022\033\n\rvalidate_only\030\004 \001(\010B\004\342A\001\001\022I\n\024igno" + + "re_safety_checks\030\005 \003(\0162+.google.api.clou" + + "dquotas.v1.QuotaSafetyCheck2\271\021\n\013CloudQuo" + + "tas\022\301\002\n\016ListQuotaInfos\0220.google.api.clou" + + "dquotas.v1.ListQuotaInfosRequest\0321.googl" + + "e.api.cloudquotas.v1.ListQuotaInfosRespo" + + "nse\"\311\001\332A\006parent\202\323\344\223\002\271\001\0229/v1/{parent=proj" + + "ects/*/locations/*/services/*}/quotaInfo" + + "sZ@\022>/v1/{parent=organizations/*/locatio" + + "ns/*/services/*}/quotaInfosZ:\0228/v1/{pare" + + "nt=folders/*/locations/*/services/*}/quo" + + "taInfos\022\256\002\n\014GetQuotaInfo\022..google.api.cl" + + "oudquotas.v1.GetQuotaInfoRequest\032$.googl" + + "e.api.cloudquotas.v1.QuotaInfo\"\307\001\332A\004name" + + "\202\323\344\223\002\271\001\0229/v1/{name=projects/*/locations/" + + "*/services/*/quotaInfos/*}Z@\022>/v1/{name=" + + "organizations/*/locations/*/services/*/q" + + "uotaInfos/*}Z:\0228/v1/{name=folders/*/loca" + + "tions/*/services/*/quotaInfos/*}\022\304\002\n\024Lis" + + "tQuotaPreferences\0226.google.api.cloudquot" + + "as.v1.ListQuotaPreferencesRequest\0327.goog" + + "le.api.cloudquotas.v1.ListQuotaPreferenc" + + "esResponse\"\272\001\332A\006parent\202\323\344\223\002\252\001\0224/v1/{pare" + + "nt=projects/*/locations/*}/quotaPreferen" + + "cesZ5\0223/v1/{parent=folders/*/locations/*" + + "}/quotaPreferencesZ;\0229/v1/{parent=organi" + + "zations/*/locations/*}/quotaPreferences\022" + + "\261\002\n\022GetQuotaPreference\0224.google.api.clou" + + "dquotas.v1.GetQuotaPreferenceRequest\032*.g" + + "oogle.api.cloudquotas.v1.QuotaPreference" + + "\"\270\001\332A\004name\202\323\344\223\002\252\001\0224/v1/{name=projects/*/" + + "locations/*/quotaPreferences/*}Z;\0229/v1/{" + + "name=organizations/*/locations/*/quotaPr" + + "eferences/*}Z5\0223/v1/{name=folders/*/loca" + + "tions/*/quotaPreferences/*}\022\256\003\n\025CreateQu" + + "otaPreference\0227.google.api.cloudquotas.v" + + "1.CreateQuotaPreferenceRequest\032*.google." + + "api.cloudquotas.v1.QuotaPreference\"\257\002\332A+" + + "parent,quota_preference,quota_preference" + + "_id\332A\027parent,quota_preference\202\323\344\223\002\340\001\"4/v" + + "1/{parent=projects/*/locations/*}/quotaP" + + "references:\020quota_preferenceZG\"3/v1/{par" + + "ent=folders/*/locations/*}/quotaPreferen" + + "ces:\020quota_preferenceZM\"9/v1/{parent=org" + + "anizations/*/locations/*}/quotaPreferenc" + + "es:\020quota_preference\022\270\003\n\025UpdateQuotaPref" + + "erence\0227.google.api.cloudquotas.v1.Updat" + + "eQuotaPreferenceRequest\032*.google.api.clo" + + "udquotas.v1.QuotaPreference\"\271\002\332A\034quota_p" + + "reference,update_mask\202\323\344\223\002\223\0022E/v1/{quota" + + "_preference.name=projects/*/locations/*/" + + "quotaPreferences/*}:\020quota_preferenceZX2" + + "D/v1/{quota_preference.name=folders/*/lo" + + "cations/*/quotaPreferences/*}:\020quota_pre" + + "ferenceZ^2J/v1/{quota_preference.name=or" + + "ganizations/*/locations/*/quotaPreferenc" + + "es/*}:\020quota_preference\032N\312A\032cloudquotas." + + "googleapis.com\322A.https://www.googleapis." + + "com/auth/cloud-platformB\346\004\n\035com.google.a" + + "pi.cloudquotas.v1B\020CloudquotasProtoP\001ZDg" + + "oogle.golang.org/genproto/googleapis/api" + + "/cloudquotas/v1;cloudquotas\252\002\033Google.Clo" + + "ud.CloudQuotas.V1\312\002\033Google\\Cloud\\CloudQu" + + "otas\\V1\352\002\036Google::Cloud::CloudQuotas::V1" + + "\352A\340\001\n\"cloudquotas.googleapis.com/Service" + + "\022:projects/{project}/locations/{location" + + "}/services/{service}\0228folders/{folder}/l" + + "ocations/{location}/services/{service}\022D" + + "organizations/{organization}/locations/{" + + "location}/services/{service}\352A\250\001\n#cloudq" + + "uotas.googleapis.com/Location\022\'projects/" + + "{project}/locations/{location}\022%folders/" + + "{folder}/locations/{location}\0221organizat" + + "ions/{organization}/locations/{location}" + + "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.cloudquotas.v1.ResourcesProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_descriptor, + new java.lang.String[] { + "QuotaInfos", "NextPageToken", + }); + internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_descriptor, + new java.lang.String[] { + "QuotaPreferences", "NextPageToken", "Unreachable", + }); + internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_descriptor, + new java.lang.String[] { + "Parent", "QuotaPreferenceId", "QuotaPreference", "IgnoreSafetyChecks", + }); + internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "QuotaPreference", "AllowMissing", "ValidateOnly", "IgnoreSafetyChecks", + }); + 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.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.cloudquotas.v1.ResourcesProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CreateQuotaPreferenceRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CreateQuotaPreferenceRequest.java new file mode 100644 index 000000000000..dd05a410e8ad --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CreateQuotaPreferenceRequest.java @@ -0,0 +1,1533 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Message for creating a QuotaPreference
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.CreateQuotaPreferenceRequest} + */ +public final class CreateQuotaPreferenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.CreateQuotaPreferenceRequest) + CreateQuotaPreferenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateQuotaPreferenceRequest.newBuilder() to construct. + private CreateQuotaPreferenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateQuotaPreferenceRequest() { + parent_ = ""; + quotaPreferenceId_ = ""; + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateQuotaPreferenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   *
+   * Example:
+   * `projects/123/locations/global`
+   * 
+ * + * + * 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. Value for parent.
+   *
+   * Example:
+   * `projects/123/locations/global`
+   * 
+ * + * + * 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 QUOTA_PREFERENCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaPreferenceId_ = ""; + /** + * + * + *
+   * Optional. Id of the requesting object, must be unique under its parent.
+   * If client does not set this field, the service will generate one.
+   * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quotaPreferenceId. + */ + @java.lang.Override + public java.lang.String getQuotaPreferenceId() { + java.lang.Object ref = quotaPreferenceId_; + 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(); + quotaPreferenceId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Id of the requesting object, must be unique under its parent.
+   * If client does not set this field, the service will generate one.
+   * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for quotaPreferenceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaPreferenceIdBytes() { + java.lang.Object ref = quotaPreferenceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaPreferenceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_PREFERENCE_FIELD_NUMBER = 3; + private com.google.api.cloudquotas.v1.QuotaPreference quotaPreference_; + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + @java.lang.Override + public boolean hasQuotaPreference() { + return quotaPreference_ != null; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreference() { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder() { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + + public static final int IGNORE_SAFETY_CHECKS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List ignoreSafetyChecks_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.api.cloudquotas.v1.QuotaSafetyCheck> + ignoreSafetyChecks_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.api.cloudquotas.v1.QuotaSafetyCheck>() { + public com.google.api.cloudquotas.v1.QuotaSafetyCheck convert(java.lang.Integer from) { + com.google.api.cloudquotas.v1.QuotaSafetyCheck result = + com.google.api.cloudquotas.v1.QuotaSafetyCheck.forNumber(from); + return result == null + ? com.google.api.cloudquotas.v1.QuotaSafetyCheck.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the ignoreSafetyChecks. + */ + @java.lang.Override + public java.util.List + getIgnoreSafetyChecksList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.api.cloudquotas.v1.QuotaSafetyCheck>( + ignoreSafetyChecks_, ignoreSafetyChecks_converter_); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return The count of ignoreSafetyChecks. + */ + @java.lang.Override + public int getIgnoreSafetyChecksCount() { + return ignoreSafetyChecks_.size(); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaSafetyCheck getIgnoreSafetyChecks(int index) { + return ignoreSafetyChecks_converter_.convert(ignoreSafetyChecks_.get(index)); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + @java.lang.Override + public java.util.List getIgnoreSafetyChecksValueList() { + return ignoreSafetyChecks_; + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + @java.lang.Override + public int getIgnoreSafetyChecksValue(int index) { + return ignoreSafetyChecks_.get(index); + } + + private int ignoreSafetyChecksMemoizedSerializedSize; + + 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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaPreferenceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, quotaPreferenceId_); + } + if (quotaPreference_ != null) { + output.writeMessage(3, getQuotaPreference()); + } + if (getIgnoreSafetyChecksList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(ignoreSafetyChecksMemoizedSerializedSize); + } + for (int i = 0; i < ignoreSafetyChecks_.size(); i++) { + output.writeEnumNoTag(ignoreSafetyChecks_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaPreferenceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, quotaPreferenceId_); + } + if (quotaPreference_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQuotaPreference()); + } + { + int dataSize = 0; + for (int i = 0; i < ignoreSafetyChecks_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(ignoreSafetyChecks_.get(i)); + } + size += dataSize; + if (!getIgnoreSafetyChecksList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + ignoreSafetyChecksMemoizedSerializedSize = dataSize; + } + 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.api.cloudquotas.v1.CreateQuotaPreferenceRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest other = + (com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getQuotaPreferenceId().equals(other.getQuotaPreferenceId())) return false; + if (hasQuotaPreference() != other.hasQuotaPreference()) return false; + if (hasQuotaPreference()) { + if (!getQuotaPreference().equals(other.getQuotaPreference())) return false; + } + if (!ignoreSafetyChecks_.equals(other.ignoreSafetyChecks_)) 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) + QUOTA_PREFERENCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getQuotaPreferenceId().hashCode(); + if (hasQuotaPreference()) { + hash = (37 * hash) + QUOTA_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getQuotaPreference().hashCode(); + } + if (getIgnoreSafetyChecksCount() > 0) { + hash = (37 * hash) + IGNORE_SAFETY_CHECKS_FIELD_NUMBER; + hash = (53 * hash) + ignoreSafetyChecks_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest 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.api.cloudquotas.v1.CreateQuotaPreferenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest 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.api.cloudquotas.v1.CreateQuotaPreferenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest 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.api.cloudquotas.v1.CreateQuotaPreferenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest 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.api.cloudquotas.v1.CreateQuotaPreferenceRequest 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; + } + /** + * + * + *
+   * Message for creating a QuotaPreference
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.CreateQuotaPreferenceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.CreateQuotaPreferenceRequest) + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + quotaPreferenceId_ = ""; + quotaPreference_ = null; + if (quotaPreferenceBuilder_ != null) { + quotaPreferenceBuilder_.dispose(); + quotaPreferenceBuilder_ = null; + } + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_CreateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest build() { + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest buildPartial() { + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest result = + new com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest result) { + if (((bitField0_ & 0x00000008) != 0)) { + ignoreSafetyChecks_ = java.util.Collections.unmodifiableList(ignoreSafetyChecks_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.ignoreSafetyChecks_ = ignoreSafetyChecks_; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.quotaPreferenceId_ = quotaPreferenceId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.quotaPreference_ = + quotaPreferenceBuilder_ == null ? quotaPreference_ : quotaPreferenceBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest) { + return mergeFrom((com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest other) { + if (other == com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getQuotaPreferenceId().isEmpty()) { + quotaPreferenceId_ = other.quotaPreferenceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasQuotaPreference()) { + mergeQuotaPreference(other.getQuotaPreference()); + } + if (!other.ignoreSafetyChecks_.isEmpty()) { + if (ignoreSafetyChecks_.isEmpty()) { + ignoreSafetyChecks_ = other.ignoreSafetyChecks_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.addAll(other.ignoreSafetyChecks_); + } + 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 18: + { + quotaPreferenceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getQuotaPreferenceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + int tmpRaw = input.readEnum(); + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(tmpRaw); + break; + } // case 32 + case 34: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(tmpRaw); + } + input.popLimit(oldLimit); + 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 parent_ = ""; + /** + * + * + *
+     * Required. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Value for parent.
+     *
+     * Example:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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 java.lang.Object quotaPreferenceId_ = ""; + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quotaPreferenceId. + */ + public java.lang.String getQuotaPreferenceId() { + java.lang.Object ref = quotaPreferenceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaPreferenceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for quotaPreferenceId. + */ + public com.google.protobuf.ByteString getQuotaPreferenceIdBytes() { + java.lang.Object ref = quotaPreferenceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaPreferenceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The quotaPreferenceId to set. + * @return This builder for chaining. + */ + public Builder setQuotaPreferenceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaPreferenceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearQuotaPreferenceId() { + quotaPreferenceId_ = getDefaultInstance().getQuotaPreferenceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Id of the requesting object, must be unique under its parent.
+     * If client does not set this field, the service will generate one.
+     * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for quotaPreferenceId to set. + * @return This builder for chaining. + */ + public Builder setQuotaPreferenceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaPreferenceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.api.cloudquotas.v1.QuotaPreference quotaPreference_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder> + quotaPreferenceBuilder_; + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + public boolean hasQuotaPreference() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + public com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreference() { + if (quotaPreferenceBuilder_ == null) { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } else { + return quotaPreferenceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaPreference(com.google.api.cloudquotas.v1.QuotaPreference value) { + if (quotaPreferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaPreference_ = value; + } else { + quotaPreferenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaPreference( + com.google.api.cloudquotas.v1.QuotaPreference.Builder builderForValue) { + if (quotaPreferenceBuilder_ == null) { + quotaPreference_ = builderForValue.build(); + } else { + quotaPreferenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuotaPreference(com.google.api.cloudquotas.v1.QuotaPreference value) { + if (quotaPreferenceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && quotaPreference_ != null + && quotaPreference_ + != com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance()) { + getQuotaPreferenceBuilder().mergeFrom(value); + } else { + quotaPreference_ = value; + } + } else { + quotaPreferenceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuotaPreference() { + bitField0_ = (bitField0_ & ~0x00000004); + quotaPreference_ = null; + if (quotaPreferenceBuilder_ != null) { + quotaPreferenceBuilder_.dispose(); + quotaPreferenceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1.QuotaPreference.Builder getQuotaPreferenceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getQuotaPreferenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder() { + if (quotaPreferenceBuilder_ != null) { + return quotaPreferenceBuilder_.getMessageOrBuilder(); + } else { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + } + /** + * + * + *
+     * Required. The resource being created
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder> + getQuotaPreferenceFieldBuilder() { + if (quotaPreferenceBuilder_ == null) { + quotaPreferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder>( + getQuotaPreference(), getParentForChildren(), isClean()); + quotaPreference_ = null; + } + return quotaPreferenceBuilder_; + } + + private java.util.List ignoreSafetyChecks_ = + java.util.Collections.emptyList(); + + private void ensureIgnoreSafetyChecksIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + ignoreSafetyChecks_ = new java.util.ArrayList(ignoreSafetyChecks_); + bitField0_ |= 0x00000008; + } + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the ignoreSafetyChecks. + */ + public java.util.List + getIgnoreSafetyChecksList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.api.cloudquotas.v1.QuotaSafetyCheck>( + ignoreSafetyChecks_, ignoreSafetyChecks_converter_); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return The count of ignoreSafetyChecks. + */ + public int getIgnoreSafetyChecksCount() { + return ignoreSafetyChecks_.size(); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + public com.google.api.cloudquotas.v1.QuotaSafetyCheck getIgnoreSafetyChecks(int index) { + return ignoreSafetyChecks_converter_.convert(ignoreSafetyChecks_.get(index)); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index to set the value at. + * @param value The ignoreSafetyChecks to set. + * @return This builder for chaining. + */ + public Builder setIgnoreSafetyChecks( + int index, com.google.api.cloudquotas.v1.QuotaSafetyCheck value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param value The ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addIgnoreSafetyChecks(com.google.api.cloudquotas.v1.QuotaSafetyCheck value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param values The ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreSafetyChecks( + java.lang.Iterable values) { + ensureIgnoreSafetyChecksIsMutable(); + for (com.google.api.cloudquotas.v1.QuotaSafetyCheck value : values) { + ignoreSafetyChecks_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreSafetyChecks() { + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + public java.util.List getIgnoreSafetyChecksValueList() { + return java.util.Collections.unmodifiableList(ignoreSafetyChecks_); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + public int getIgnoreSafetyChecksValue(int index) { + return ignoreSafetyChecks_.get(index); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for ignoreSafetyChecks to set. + * @return This builder for chaining. + */ + public Builder setIgnoreSafetyChecksValue(int index, int value) { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param value The enum numeric value on the wire for ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addIgnoreSafetyChecksValue(int value) { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param values The enum numeric values on the wire for ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreSafetyChecksValue(java.lang.Iterable values) { + ensureIgnoreSafetyChecksIsMutable(); + for (int value : values) { + ignoreSafetyChecks_.add(value); + } + 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.api.cloudquotas.v1.CreateQuotaPreferenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.CreateQuotaPreferenceRequest) + private static final com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest(); + } + + public static com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateQuotaPreferenceRequest 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.api.cloudquotas.v1.CreateQuotaPreferenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CreateQuotaPreferenceRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CreateQuotaPreferenceRequestOrBuilder.java new file mode 100644 index 000000000000..fb32de85b2d9 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/CreateQuotaPreferenceRequestOrBuilder.java @@ -0,0 +1,191 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public interface CreateQuotaPreferenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.CreateQuotaPreferenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   *
+   * Example:
+   * `projects/123/locations/global`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   *
+   * Example:
+   * `projects/123/locations/global`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Id of the requesting object, must be unique under its parent.
+   * If client does not set this field, the service will generate one.
+   * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The quotaPreferenceId. + */ + java.lang.String getQuotaPreferenceId(); + /** + * + * + *
+   * Optional. Id of the requesting object, must be unique under its parent.
+   * If client does not set this field, the service will generate one.
+   * 
+ * + * string quota_preference_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for quotaPreferenceId. + */ + com.google.protobuf.ByteString getQuotaPreferenceIdBytes(); + + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + boolean hasQuotaPreference(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreference(); + /** + * + * + *
+   * Required. The resource being created
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder(); + + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the ignoreSafetyChecks. + */ + java.util.List getIgnoreSafetyChecksList(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return The count of ignoreSafetyChecks. + */ + int getIgnoreSafetyChecksCount(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + com.google.api.cloudquotas.v1.QuotaSafetyCheck getIgnoreSafetyChecks(int index); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + java.util.List getIgnoreSafetyChecksValueList(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 4; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + int getIgnoreSafetyChecksValue(int index); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/DimensionsInfo.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/DimensionsInfo.java new file mode 100644 index 000000000000..f766e680a839 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/DimensionsInfo.java @@ -0,0 +1,1435 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * The detailed quota information such as effective quota value for a
+ * combination of dimensions.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.DimensionsInfo} + */ +public final class DimensionsInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.DimensionsInfo) + DimensionsInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use DimensionsInfo.newBuilder() to construct. + private DimensionsInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DimensionsInfo() { + applicableLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DimensionsInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_DimensionsInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_DimensionsInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.DimensionsInfo.class, + com.google.api.cloudquotas.v1.DimensionsInfo.Builder.class); + } + + public static final int DIMENSIONS_FIELD_NUMBER = 1; + + private static final class DimensionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_DimensionsInfo_DimensionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField dimensions_; + + private com.google.protobuf.MapField internalGetDimensions() { + if (dimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField(DimensionsDefaultEntryHolder.defaultEntry); + } + return dimensions_; + } + + public int getDimensionsCount() { + return internalGetDimensions().getMap().size(); + } + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public boolean containsDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDimensions().getMap().containsKey(key); + } + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDimensions() { + return getDimensionsMap(); + } + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public java.util.Map getDimensionsMap() { + return internalGetDimensions().getMap(); + } + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public java.lang.String getDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DETAILS_FIELD_NUMBER = 2; + private com.google.api.cloudquotas.v1.QuotaDetails details_; + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return details_ != null; + } + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + * + * @return The details. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaDetails getDetails() { + return details_ == null + ? com.google.api.cloudquotas.v1.QuotaDetails.getDefaultInstance() + : details_; + } + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaDetailsOrBuilder getDetailsOrBuilder() { + return details_ == null + ? com.google.api.cloudquotas.v1.QuotaDetails.getDefaultInstance() + : details_; + } + + public static final int APPLICABLE_LOCATIONS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList applicableLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @return A list containing the applicableLocations. + */ + public com.google.protobuf.ProtocolStringList getApplicableLocationsList() { + return applicableLocations_; + } + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @return The count of applicableLocations. + */ + public int getApplicableLocationsCount() { + return applicableLocations_.size(); + } + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the element to return. + * @return The applicableLocations at the given index. + */ + public java.lang.String getApplicableLocations(int index) { + return applicableLocations_.get(index); + } + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the applicableLocations at the given index. + */ + public com.google.protobuf.ByteString getApplicableLocationsBytes(int index) { + return applicableLocations_.getByteString(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 { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDimensions(), DimensionsDefaultEntryHolder.defaultEntry, 1); + if (details_ != null) { + output.writeMessage(2, getDetails()); + } + for (int i = 0; i < applicableLocations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, applicableLocations_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetDimensions().getMap().entrySet()) { + com.google.protobuf.MapEntry dimensions__ = + DimensionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, dimensions__); + } + if (details_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDetails()); + } + { + int dataSize = 0; + for (int i = 0; i < applicableLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(applicableLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getApplicableLocationsList().size(); + } + 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.api.cloudquotas.v1.DimensionsInfo)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.DimensionsInfo other = + (com.google.api.cloudquotas.v1.DimensionsInfo) obj; + + if (!internalGetDimensions().equals(other.internalGetDimensions())) return false; + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) return false; + } + if (!getApplicableLocationsList().equals(other.getApplicableLocationsList())) 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 (!internalGetDimensions().getMap().isEmpty()) { + hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDimensions().hashCode(); + } + if (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + if (getApplicableLocationsCount() > 0) { + hash = (37 * hash) + APPLICABLE_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getApplicableLocationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo 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.api.cloudquotas.v1.DimensionsInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo 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.api.cloudquotas.v1.DimensionsInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo 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.api.cloudquotas.v1.DimensionsInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo 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.api.cloudquotas.v1.DimensionsInfo 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 detailed quota information such as effective quota value for a
+   * combination of dimensions.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.DimensionsInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.DimensionsInfo) + com.google.api.cloudquotas.v1.DimensionsInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_DimensionsInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_DimensionsInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.DimensionsInfo.class, + com.google.api.cloudquotas.v1.DimensionsInfo.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.DimensionsInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableDimensions().clear(); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + applicableLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_DimensionsInfo_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.DimensionsInfo getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.DimensionsInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.DimensionsInfo build() { + com.google.api.cloudquotas.v1.DimensionsInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.DimensionsInfo buildPartial() { + com.google.api.cloudquotas.v1.DimensionsInfo result = + new com.google.api.cloudquotas.v1.DimensionsInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.DimensionsInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.dimensions_ = internalGetDimensions(); + result.dimensions_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.details_ = detailsBuilder_ == null ? details_ : detailsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + applicableLocations_.makeImmutable(); + result.applicableLocations_ = applicableLocations_; + } + } + + @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.api.cloudquotas.v1.DimensionsInfo) { + return mergeFrom((com.google.api.cloudquotas.v1.DimensionsInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.DimensionsInfo other) { + if (other == com.google.api.cloudquotas.v1.DimensionsInfo.getDefaultInstance()) return this; + internalGetMutableDimensions().mergeFrom(other.internalGetDimensions()); + bitField0_ |= 0x00000001; + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + if (!other.applicableLocations_.isEmpty()) { + if (applicableLocations_.isEmpty()) { + applicableLocations_ = other.applicableLocations_; + bitField0_ |= 0x00000004; + } else { + ensureApplicableLocationsIsMutable(); + applicableLocations_.addAll(other.applicableLocations_); + } + 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.protobuf.MapEntry dimensions__ = + input.readMessage( + DimensionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableDimensions() + .getMutableMap() + .put(dimensions__.getKey(), dimensions__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getDetailsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureApplicableLocationsIsMutable(); + applicableLocations_.add(s); + 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 com.google.protobuf.MapField dimensions_; + + private com.google.protobuf.MapField + internalGetDimensions() { + if (dimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DimensionsDefaultEntryHolder.defaultEntry); + } + return dimensions_; + } + + private com.google.protobuf.MapField + internalGetMutableDimensions() { + if (dimensions_ == null) { + dimensions_ = + com.google.protobuf.MapField.newMapField(DimensionsDefaultEntryHolder.defaultEntry); + } + if (!dimensions_.isMutable()) { + dimensions_ = dimensions_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return dimensions_; + } + + public int getDimensionsCount() { + return internalGetDimensions().getMap().size(); + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public boolean containsDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDimensions().getMap().containsKey(key); + } + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDimensions() { + return getDimensionsMap(); + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public java.util.Map getDimensionsMap() { + return internalGetDimensions().getMap(); + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + @java.lang.Override + public java.lang.String getDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDimensions() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableDimensions().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + public Builder removeDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableDimensions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDimensions() { + bitField0_ |= 0x00000001; + return internalGetMutableDimensions().getMutableMap(); + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + public Builder putDimensions(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableDimensions().getMutableMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * + * + *
+     * The map of dimensions for this dimensions info. The key of a map entry
+     * is "region", "zone" or the name of a service specific dimension, and the
+     * value of a map entry is the value of the dimension.  If a dimension does
+     * not appear in the map of dimensions, the dimensions info applies to all
+     * the dimension values except for those that have another DimenisonInfo
+     * instance configured for the specific value.
+     * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+     * dimension of a quota.
+     * 
+ * + * map<string, string> dimensions = 1; + */ + public Builder putAllDimensions(java.util.Map values) { + internalGetMutableDimensions().getMutableMap().putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + private com.google.api.cloudquotas.v1.QuotaDetails details_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaDetails, + com.google.api.cloudquotas.v1.QuotaDetails.Builder, + com.google.api.cloudquotas.v1.QuotaDetailsOrBuilder> + detailsBuilder_; + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + * + * @return The details. + */ + public com.google.api.cloudquotas.v1.QuotaDetails getDetails() { + if (detailsBuilder_ == null) { + return details_ == null + ? com.google.api.cloudquotas.v1.QuotaDetails.getDefaultInstance() + : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + public Builder setDetails(com.google.api.cloudquotas.v1.QuotaDetails value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + } else { + detailsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + public Builder setDetails(com.google.api.cloudquotas.v1.QuotaDetails.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + public Builder mergeDetails(com.google.api.cloudquotas.v1.QuotaDetails value) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && details_ != null + && details_ != com.google.api.cloudquotas.v1.QuotaDetails.getDefaultInstance()) { + getDetailsBuilder().mergeFrom(value); + } else { + details_ = value; + } + } else { + detailsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + public Builder clearDetails() { + bitField0_ = (bitField0_ & ~0x00000002); + details_ = null; + if (detailsBuilder_ != null) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + public com.google.api.cloudquotas.v1.QuotaDetails.Builder getDetailsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + public com.google.api.cloudquotas.v1.QuotaDetailsOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null + ? com.google.api.cloudquotas.v1.QuotaDetails.getDefaultInstance() + : details_; + } + } + /** + * + * + *
+     * Quota details for the specified dimensions.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaDetails, + com.google.api.cloudquotas.v1.QuotaDetails.Builder, + com.google.api.cloudquotas.v1.QuotaDetailsOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaDetails, + com.google.api.cloudquotas.v1.QuotaDetails.Builder, + com.google.api.cloudquotas.v1.QuotaDetailsOrBuilder>( + getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList applicableLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureApplicableLocationsIsMutable() { + if (!applicableLocations_.isModifiable()) { + applicableLocations_ = new com.google.protobuf.LazyStringArrayList(applicableLocations_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @return A list containing the applicableLocations. + */ + public com.google.protobuf.ProtocolStringList getApplicableLocationsList() { + applicableLocations_.makeImmutable(); + return applicableLocations_; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @return The count of applicableLocations. + */ + public int getApplicableLocationsCount() { + return applicableLocations_.size(); + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the element to return. + * @return The applicableLocations at the given index. + */ + public java.lang.String getApplicableLocations(int index) { + return applicableLocations_.get(index); + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the applicableLocations at the given index. + */ + public com.google.protobuf.ByteString getApplicableLocationsBytes(int index) { + return applicableLocations_.getByteString(index); + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index to set the value at. + * @param value The applicableLocations to set. + * @return This builder for chaining. + */ + public Builder setApplicableLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApplicableLocationsIsMutable(); + applicableLocations_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param value The applicableLocations to add. + * @return This builder for chaining. + */ + public Builder addApplicableLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureApplicableLocationsIsMutable(); + applicableLocations_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param values The applicableLocations to add. + * @return This builder for chaining. + */ + public Builder addAllApplicableLocations(java.lang.Iterable values) { + ensureApplicableLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, applicableLocations_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @return This builder for chaining. + */ + public Builder clearApplicableLocations() { + applicableLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The applicable regions or zones of this dimensions info. The field will be
+     * set to ['global'] for quotas that are not per region or per zone.
+     * Otherwise, it will be set to the list of locations this dimension info is
+     * applicable to.
+     * 
+ * + * repeated string applicable_locations = 3; + * + * @param value The bytes of the applicableLocations to add. + * @return This builder for chaining. + */ + public Builder addApplicableLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureApplicableLocationsIsMutable(); + applicableLocations_.add(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.api.cloudquotas.v1.DimensionsInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.DimensionsInfo) + private static final com.google.api.cloudquotas.v1.DimensionsInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.DimensionsInfo(); + } + + public static com.google.api.cloudquotas.v1.DimensionsInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DimensionsInfo 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.api.cloudquotas.v1.DimensionsInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/DimensionsInfoOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/DimensionsInfoOrBuilder.java new file mode 100644 index 000000000000..ee10134cdafb --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/DimensionsInfoOrBuilder.java @@ -0,0 +1,216 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +public interface DimensionsInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.DimensionsInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + int getDimensionsCount(); + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + boolean containsDimensions(java.lang.String key); + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDimensions(); + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + java.util.Map getDimensionsMap(); + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + /* nullable */ + java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The map of dimensions for this dimensions info. The key of a map entry
+   * is "region", "zone" or the name of a service specific dimension, and the
+   * value of a map entry is the value of the dimension.  If a dimension does
+   * not appear in the map of dimensions, the dimensions info applies to all
+   * the dimension values except for those that have another DimenisonInfo
+   * instance configured for the specific value.
+   * Example: {"provider" : "Foo Inc"} where "provider" is a service specific
+   * dimension of a quota.
+   * 
+ * + * map<string, string> dimensions = 1; + */ + java.lang.String getDimensionsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + * + * @return The details. + */ + com.google.api.cloudquotas.v1.QuotaDetails getDetails(); + /** + * + * + *
+   * Quota details for the specified dimensions.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaDetails details = 2; + */ + com.google.api.cloudquotas.v1.QuotaDetailsOrBuilder getDetailsOrBuilder(); + + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @return A list containing the applicableLocations. + */ + java.util.List getApplicableLocationsList(); + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @return The count of applicableLocations. + */ + int getApplicableLocationsCount(); + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the element to return. + * @return The applicableLocations at the given index. + */ + java.lang.String getApplicableLocations(int index); + /** + * + * + *
+   * The applicable regions or zones of this dimensions info. The field will be
+   * set to ['global'] for quotas that are not per region or per zone.
+   * Otherwise, it will be set to the list of locations this dimension info is
+   * applicable to.
+   * 
+ * + * repeated string applicable_locations = 3; + * + * @param index The index of the value to return. + * @return The bytes of the applicableLocations at the given index. + */ + com.google.protobuf.ByteString getApplicableLocationsBytes(int index); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaInfoRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaInfoRequest.java new file mode 100644 index 000000000000..21254d781b0d --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaInfoRequest.java @@ -0,0 +1,659 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Message for getting a QuotaInfo
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.GetQuotaInfoRequest} + */ +public final class GetQuotaInfoRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.GetQuotaInfoRequest) + GetQuotaInfoRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetQuotaInfoRequest.newBuilder() to construct. + private GetQuotaInfoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetQuotaInfoRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetQuotaInfoRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.GetQuotaInfoRequest.class, + com.google.api.cloudquotas.v1.GetQuotaInfoRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The resource name of the quota info.
+   *
+   * An example name:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the quota info.
+   *
+   * An example name:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.cloudquotas.v1.GetQuotaInfoRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.GetQuotaInfoRequest other = + (com.google.api.cloudquotas.v1.GetQuotaInfoRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest 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.api.cloudquotas.v1.GetQuotaInfoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest 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.api.cloudquotas.v1.GetQuotaInfoRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest 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.api.cloudquotas.v1.GetQuotaInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest 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.api.cloudquotas.v1.GetQuotaInfoRequest 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; + } + /** + * + * + *
+   * Message for getting a QuotaInfo
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.GetQuotaInfoRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.GetQuotaInfoRequest) + com.google.api.cloudquotas.v1.GetQuotaInfoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.GetQuotaInfoRequest.class, + com.google.api.cloudquotas.v1.GetQuotaInfoRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.GetQuotaInfoRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaInfoRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.GetQuotaInfoRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.GetQuotaInfoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.GetQuotaInfoRequest build() { + com.google.api.cloudquotas.v1.GetQuotaInfoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.GetQuotaInfoRequest buildPartial() { + com.google.api.cloudquotas.v1.GetQuotaInfoRequest result = + new com.google.api.cloudquotas.v1.GetQuotaInfoRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.GetQuotaInfoRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.cloudquotas.v1.GetQuotaInfoRequest) { + return mergeFrom((com.google.api.cloudquotas.v1.GetQuotaInfoRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.GetQuotaInfoRequest other) { + if (other == com.google.api.cloudquotas.v1.GetQuotaInfoRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the quota info.
+     *
+     * An example name:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.api.cloudquotas.v1.GetQuotaInfoRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.GetQuotaInfoRequest) + private static final com.google.api.cloudquotas.v1.GetQuotaInfoRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.GetQuotaInfoRequest(); + } + + public static com.google.api.cloudquotas.v1.GetQuotaInfoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetQuotaInfoRequest 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.api.cloudquotas.v1.GetQuotaInfoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaInfoRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaInfoRequestOrBuilder.java new file mode 100644 index 000000000000..edf6b1102a02 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaInfoRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public interface GetQuotaInfoRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.GetQuotaInfoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the quota info.
+   *
+   * An example name:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the quota info.
+   *
+   * An example name:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaPreferenceRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaPreferenceRequest.java new file mode 100644 index 000000000000..267a3c51c399 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaPreferenceRequest.java @@ -0,0 +1,660 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Message for getting a QuotaPreference
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.GetQuotaPreferenceRequest} + */ +public final class GetQuotaPreferenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.GetQuotaPreferenceRequest) + GetQuotaPreferenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetQuotaPreferenceRequest.newBuilder() to construct. + private GetQuotaPreferenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetQuotaPreferenceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetQuotaPreferenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource
+   *
+   * Example name:
+   * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the resource
+   *
+   * Example name:
+   * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest other = + (com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest 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.api.cloudquotas.v1.GetQuotaPreferenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest 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.api.cloudquotas.v1.GetQuotaPreferenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest 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.api.cloudquotas.v1.GetQuotaPreferenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest 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.api.cloudquotas.v1.GetQuotaPreferenceRequest 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; + } + /** + * + * + *
+   * Message for getting a QuotaPreference
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.GetQuotaPreferenceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.GetQuotaPreferenceRequest) + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_GetQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest build() { + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest buildPartial() { + com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest result = + new com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest) { + return mergeFrom((com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest other) { + if (other == com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the resource
+     *
+     * Example name:
+     * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.api.cloudquotas.v1.GetQuotaPreferenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.GetQuotaPreferenceRequest) + private static final com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest(); + } + + public static com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetQuotaPreferenceRequest 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.api.cloudquotas.v1.GetQuotaPreferenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaPreferenceRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaPreferenceRequestOrBuilder.java new file mode 100644 index 000000000000..9f78d168f372 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/GetQuotaPreferenceRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public interface GetQuotaPreferenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.GetQuotaPreferenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource
+   *
+   * Example name:
+   * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource
+   *
+   * Example name:
+   * `projects/123/locations/global/quota_preferences/my-config-for-us-east1`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosRequest.java new file mode 100644 index 000000000000..5e2e2d57f194 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosRequest.java @@ -0,0 +1,966 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Message for requesting list of QuotaInfos
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.ListQuotaInfosRequest} + */ +public final class ListQuotaInfosRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.ListQuotaInfosRequest) + ListQuotaInfosRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaInfosRequest.newBuilder() to construct. + private ListQuotaInfosRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaInfosRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaInfosRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.ListQuotaInfosRequest.class, + com.google.api.cloudquotas.v1.ListQuotaInfosRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value of QuotaInfo resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * Example names:
+   * `projects/123/locations/global/services/compute.googleapis.com`
+   * `folders/234/locations/global/services/compute.googleapis.com`
+   * `organizations/345/locations/global/services/compute.googleapis.com`
+   * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * Example names:
+   * `projects/123/locations/global/services/compute.googleapis.com`
+   * `folders/234/locations/global/services/compute.googleapis.com`
+   * `organizations/345/locations/global/services/compute.googleapis.com`
+   * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * 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. A token identifying a page of results the server should return.
+   * 
+ * + * 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. A token identifying a page of results the server should return.
+   * 
+ * + * 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.api.cloudquotas.v1.ListQuotaInfosRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.ListQuotaInfosRequest other = + (com.google.api.cloudquotas.v1.ListQuotaInfosRequest) 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.api.cloudquotas.v1.ListQuotaInfosRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest 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.api.cloudquotas.v1.ListQuotaInfosRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest 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.api.cloudquotas.v1.ListQuotaInfosRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest 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.api.cloudquotas.v1.ListQuotaInfosRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest 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.api.cloudquotas.v1.ListQuotaInfosRequest 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; + } + /** + * + * + *
+   * Message for requesting list of QuotaInfos
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.ListQuotaInfosRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.ListQuotaInfosRequest) + com.google.api.cloudquotas.v1.ListQuotaInfosRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.ListQuotaInfosRequest.class, + com.google.api.cloudquotas.v1.ListQuotaInfosRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.ListQuotaInfosRequest.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.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaInfosRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.ListQuotaInfosRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaInfosRequest build() { + com.google.api.cloudquotas.v1.ListQuotaInfosRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaInfosRequest buildPartial() { + com.google.api.cloudquotas.v1.ListQuotaInfosRequest result = + new com.google.api.cloudquotas.v1.ListQuotaInfosRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.ListQuotaInfosRequest 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.api.cloudquotas.v1.ListQuotaInfosRequest) { + return mergeFrom((com.google.api.cloudquotas.v1.ListQuotaInfosRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.ListQuotaInfosRequest other) { + if (other == com.google.api.cloudquotas.v1.ListQuotaInfosRequest.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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Parent value of QuotaInfo resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * Example names:
+     * `projects/123/locations/global/services/compute.googleapis.com`
+     * `folders/234/locations/global/services/compute.googleapis.com`
+     * `organizations/345/locations/global/services/compute.googleapis.com`
+     * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * 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. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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.api.cloudquotas.v1.ListQuotaInfosRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.ListQuotaInfosRequest) + private static final com.google.api.cloudquotas.v1.ListQuotaInfosRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.ListQuotaInfosRequest(); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaInfosRequest 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.api.cloudquotas.v1.ListQuotaInfosRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosRequestOrBuilder.java new file mode 100644 index 000000000000..839c999b567a --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public interface ListQuotaInfosRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.ListQuotaInfosRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value of QuotaInfo resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * Example names:
+   * `projects/123/locations/global/services/compute.googleapis.com`
+   * `folders/234/locations/global/services/compute.googleapis.com`
+   * `organizations/345/locations/global/services/compute.googleapis.com`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value of QuotaInfo resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * Example names:
+   * `projects/123/locations/global/services/compute.googleapis.com`
+   * `folders/234/locations/global/services/compute.googleapis.com`
+   * `organizations/345/locations/global/services/compute.googleapis.com`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosResponse.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosResponse.java new file mode 100644 index 000000000000..a86ec80fb10c --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosResponse.java @@ -0,0 +1,1124 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Message for response to listing QuotaInfos
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.ListQuotaInfosResponse} + */ +public final class ListQuotaInfosResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.ListQuotaInfosResponse) + ListQuotaInfosResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaInfosResponse.newBuilder() to construct. + private ListQuotaInfosResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaInfosResponse() { + quotaInfos_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaInfosResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.ListQuotaInfosResponse.class, + com.google.api.cloudquotas.v1.ListQuotaInfosResponse.Builder.class); + } + + public static final int QUOTA_INFOS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List quotaInfos_; + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public java.util.List getQuotaInfosList() { + return quotaInfos_; + } + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public java.util.List + getQuotaInfosOrBuilderList() { + return quotaInfos_; + } + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public int getQuotaInfosCount() { + return quotaInfos_.size(); + } + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaInfo getQuotaInfos(int index) { + return quotaInfos_.get(index); + } + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaInfoOrBuilder getQuotaInfosOrBuilder(int index) { + return quotaInfos_.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 < quotaInfos_.size(); i++) { + output.writeMessage(1, quotaInfos_.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 < quotaInfos_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, quotaInfos_.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.api.cloudquotas.v1.ListQuotaInfosResponse)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.ListQuotaInfosResponse other = + (com.google.api.cloudquotas.v1.ListQuotaInfosResponse) obj; + + if (!getQuotaInfosList().equals(other.getQuotaInfosList())) 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 (getQuotaInfosCount() > 0) { + hash = (37 * hash) + QUOTA_INFOS_FIELD_NUMBER; + hash = (53 * hash) + getQuotaInfosList().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.api.cloudquotas.v1.ListQuotaInfosResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse 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.api.cloudquotas.v1.ListQuotaInfosResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse 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.api.cloudquotas.v1.ListQuotaInfosResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse 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.api.cloudquotas.v1.ListQuotaInfosResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse 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.api.cloudquotas.v1.ListQuotaInfosResponse 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; + } + /** + * + * + *
+   * Message for response to listing QuotaInfos
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.ListQuotaInfosResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.ListQuotaInfosResponse) + com.google.api.cloudquotas.v1.ListQuotaInfosResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.ListQuotaInfosResponse.class, + com.google.api.cloudquotas.v1.ListQuotaInfosResponse.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.ListQuotaInfosResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (quotaInfosBuilder_ == null) { + quotaInfos_ = java.util.Collections.emptyList(); + } else { + quotaInfos_ = null; + quotaInfosBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaInfosResponse_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaInfosResponse getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.ListQuotaInfosResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaInfosResponse build() { + com.google.api.cloudquotas.v1.ListQuotaInfosResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaInfosResponse buildPartial() { + com.google.api.cloudquotas.v1.ListQuotaInfosResponse result = + new com.google.api.cloudquotas.v1.ListQuotaInfosResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.api.cloudquotas.v1.ListQuotaInfosResponse result) { + if (quotaInfosBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + quotaInfos_ = java.util.Collections.unmodifiableList(quotaInfos_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.quotaInfos_ = quotaInfos_; + } else { + result.quotaInfos_ = quotaInfosBuilder_.build(); + } + } + + private void buildPartial0(com.google.api.cloudquotas.v1.ListQuotaInfosResponse 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.api.cloudquotas.v1.ListQuotaInfosResponse) { + return mergeFrom((com.google.api.cloudquotas.v1.ListQuotaInfosResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.ListQuotaInfosResponse other) { + if (other == com.google.api.cloudquotas.v1.ListQuotaInfosResponse.getDefaultInstance()) + return this; + if (quotaInfosBuilder_ == null) { + if (!other.quotaInfos_.isEmpty()) { + if (quotaInfos_.isEmpty()) { + quotaInfos_ = other.quotaInfos_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQuotaInfosIsMutable(); + quotaInfos_.addAll(other.quotaInfos_); + } + onChanged(); + } + } else { + if (!other.quotaInfos_.isEmpty()) { + if (quotaInfosBuilder_.isEmpty()) { + quotaInfosBuilder_.dispose(); + quotaInfosBuilder_ = null; + quotaInfos_ = other.quotaInfos_; + bitField0_ = (bitField0_ & ~0x00000001); + quotaInfosBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQuotaInfosFieldBuilder() + : null; + } else { + quotaInfosBuilder_.addAllMessages(other.quotaInfos_); + } + } + } + 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.api.cloudquotas.v1.QuotaInfo m = + input.readMessage( + com.google.api.cloudquotas.v1.QuotaInfo.parser(), extensionRegistry); + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.add(m); + } else { + quotaInfosBuilder_.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 quotaInfos_ = + java.util.Collections.emptyList(); + + private void ensureQuotaInfosIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + quotaInfos_ = new java.util.ArrayList(quotaInfos_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaInfo, + com.google.api.cloudquotas.v1.QuotaInfo.Builder, + com.google.api.cloudquotas.v1.QuotaInfoOrBuilder> + quotaInfosBuilder_; + + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public java.util.List getQuotaInfosList() { + if (quotaInfosBuilder_ == null) { + return java.util.Collections.unmodifiableList(quotaInfos_); + } else { + return quotaInfosBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public int getQuotaInfosCount() { + if (quotaInfosBuilder_ == null) { + return quotaInfos_.size(); + } else { + return quotaInfosBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1.QuotaInfo getQuotaInfos(int index) { + if (quotaInfosBuilder_ == null) { + return quotaInfos_.get(index); + } else { + return quotaInfosBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder setQuotaInfos(int index, com.google.api.cloudquotas.v1.QuotaInfo value) { + if (quotaInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaInfosIsMutable(); + quotaInfos_.set(index, value); + onChanged(); + } else { + quotaInfosBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder setQuotaInfos( + int index, com.google.api.cloudquotas.v1.QuotaInfo.Builder builderForValue) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.set(index, builderForValue.build()); + onChanged(); + } else { + quotaInfosBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder addQuotaInfos(com.google.api.cloudquotas.v1.QuotaInfo value) { + if (quotaInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaInfosIsMutable(); + quotaInfos_.add(value); + onChanged(); + } else { + quotaInfosBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder addQuotaInfos(int index, com.google.api.cloudquotas.v1.QuotaInfo value) { + if (quotaInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaInfosIsMutable(); + quotaInfos_.add(index, value); + onChanged(); + } else { + quotaInfosBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder addQuotaInfos(com.google.api.cloudquotas.v1.QuotaInfo.Builder builderForValue) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.add(builderForValue.build()); + onChanged(); + } else { + quotaInfosBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder addQuotaInfos( + int index, com.google.api.cloudquotas.v1.QuotaInfo.Builder builderForValue) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.add(index, builderForValue.build()); + onChanged(); + } else { + quotaInfosBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder addAllQuotaInfos( + java.lang.Iterable values) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, quotaInfos_); + onChanged(); + } else { + quotaInfosBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder clearQuotaInfos() { + if (quotaInfosBuilder_ == null) { + quotaInfos_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + quotaInfosBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public Builder removeQuotaInfos(int index) { + if (quotaInfosBuilder_ == null) { + ensureQuotaInfosIsMutable(); + quotaInfos_.remove(index); + onChanged(); + } else { + quotaInfosBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1.QuotaInfo.Builder getQuotaInfosBuilder(int index) { + return getQuotaInfosFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1.QuotaInfoOrBuilder getQuotaInfosOrBuilder(int index) { + if (quotaInfosBuilder_ == null) { + return quotaInfos_.get(index); + } else { + return quotaInfosBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public java.util.List + getQuotaInfosOrBuilderList() { + if (quotaInfosBuilder_ != null) { + return quotaInfosBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(quotaInfos_); + } + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1.QuotaInfo.Builder addQuotaInfosBuilder() { + return getQuotaInfosFieldBuilder() + .addBuilder(com.google.api.cloudquotas.v1.QuotaInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public com.google.api.cloudquotas.v1.QuotaInfo.Builder addQuotaInfosBuilder(int index) { + return getQuotaInfosFieldBuilder() + .addBuilder(index, com.google.api.cloudquotas.v1.QuotaInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The list of QuotaInfo
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + public java.util.List + getQuotaInfosBuilderList() { + return getQuotaInfosFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaInfo, + com.google.api.cloudquotas.v1.QuotaInfo.Builder, + com.google.api.cloudquotas.v1.QuotaInfoOrBuilder> + getQuotaInfosFieldBuilder() { + if (quotaInfosBuilder_ == null) { + quotaInfosBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaInfo, + com.google.api.cloudquotas.v1.QuotaInfo.Builder, + com.google.api.cloudquotas.v1.QuotaInfoOrBuilder>( + quotaInfos_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + quotaInfos_ = null; + } + return quotaInfosBuilder_; + } + + 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.api.cloudquotas.v1.ListQuotaInfosResponse) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.ListQuotaInfosResponse) + private static final com.google.api.cloudquotas.v1.ListQuotaInfosResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.ListQuotaInfosResponse(); + } + + public static com.google.api.cloudquotas.v1.ListQuotaInfosResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaInfosResponse 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.api.cloudquotas.v1.ListQuotaInfosResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosResponseOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosResponseOrBuilder.java new file mode 100644 index 000000000000..5d27e665f8af --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaInfosResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public interface ListQuotaInfosResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.ListQuotaInfosResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + java.util.List getQuotaInfosList(); + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + com.google.api.cloudquotas.v1.QuotaInfo getQuotaInfos(int index); + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + int getQuotaInfosCount(); + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + java.util.List + getQuotaInfosOrBuilderList(); + /** + * + * + *
+   * The list of QuotaInfo
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaInfo quota_infos = 1; + */ + com.google.api.cloudquotas.v1.QuotaInfoOrBuilder getQuotaInfosOrBuilder(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-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesRequest.java new file mode 100644 index 000000000000..85fcb321cd44 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesRequest.java @@ -0,0 +1,1436 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Message for requesting list of QuotaPreferences
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.ListQuotaPreferencesRequest} + */ +public final class ListQuotaPreferencesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.ListQuotaPreferencesRequest) + ListQuotaPreferencesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaPreferencesRequest.newBuilder() to construct. + private ListQuotaPreferencesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaPreferencesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaPreferencesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest.class, + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value of QuotaPreference resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * When the value starts with 'folders' or 'organizations', it lists the
+   * QuotaPreferences for org quotas in the container. It does not list the
+   * QuotaPreferences in the descendant projects of the container.
+   *
+   * Example parents:
+   * `projects/123/locations/global`
+   * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * When the value starts with 'folders' or 'organizations', it lists the
+   * QuotaPreferences for org quotas in the container. It does not list the
+   * QuotaPreferences in the descendant projects of the container.
+   *
+   * Example parents:
+   * `projects/123/locations/global`
+   * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * 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. A token identifying a page of results the server should return.
+   * 
+ * + * 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. A token identifying a page of results the server should return.
+   * 
+ * + * 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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filter result QuotaPreferences by their state, type,
+   * create/update time range.
+   *
+   * Example filters:
+   * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+   * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+   *  creation_time>2022-12-03T10:30:00`
+   *
+   * If no filter is provided, returns all pending quota preferences.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filter result QuotaPreferences by their state, type,
+   * create/update time range.
+   *
+   * Example filters:
+   * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+   * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+   *  creation_time>2022-12-03T10:30:00`
+   *
+   * If no filter is provided, returns all pending quota preferences.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. How to order of the results. By default, the results are ordered
+   * by create time.
+   *
+   * Example orders:
+   * `type`
+   * `state, create_time`
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. How to order of the results. By default, the results are ordered
+   * by create time.
+   *
+   * Example orders:
+   * `type`
+   * `state, create_time`
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.api.cloudquotas.v1.ListQuotaPreferencesRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest other = + (com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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 = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest 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.api.cloudquotas.v1.ListQuotaPreferencesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest 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.api.cloudquotas.v1.ListQuotaPreferencesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest 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.api.cloudquotas.v1.ListQuotaPreferencesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest 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.api.cloudquotas.v1.ListQuotaPreferencesRequest 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; + } + /** + * + * + *
+   * Message for requesting list of QuotaPreferences
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.ListQuotaPreferencesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.ListQuotaPreferencesRequest) + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest.class, + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest.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_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest build() { + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest buildPartial() { + com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest result = + new com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest 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_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @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.api.cloudquotas.v1.ListQuotaPreferencesRequest) { + return mergeFrom((com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest other) { + if (other == com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + 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 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Parent value of QuotaPreference resources.
+     * Listing across different resource containers (such as 'projects/-') is not
+     * allowed.
+     *
+     * When the value starts with 'folders' or 'organizations', it lists the
+     * QuotaPreferences for org quotas in the container. It does not list the
+     * QuotaPreferences in the descendant projects of the container.
+     *
+     * Example parents:
+     * `projects/123/locations/global`
+     * 
+ * + * + * 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. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * 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. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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. A token identifying a page of results the server should return.
+     * 
+ * + * 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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+     *  creation_time>2022-12-03T10:30:00`
+     *
+     * If no filter is provided, returns all pending quota preferences.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+     *  creation_time>2022-12-03T10:30:00`
+     *
+     * If no filter is provided, returns all pending quota preferences.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+     *  creation_time>2022-12-03T10:30:00`
+     *
+     * If no filter is provided, returns all pending quota preferences.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+     *  creation_time>2022-12-03T10:30:00`
+     *
+     * If no filter is provided, returns all pending quota preferences.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter result QuotaPreferences by their state, type,
+     * create/update time range.
+     *
+     * Example filters:
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+     * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+     *  creation_time>2022-12-03T10:30:00`
+     *
+     * If no filter is provided, returns all pending quota preferences.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `type`
+     * `state, create_time`
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `type`
+     * `state, create_time`
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `type`
+     * `state, create_time`
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `type`
+     * `state, create_time`
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. How to order of the results. By default, the results are ordered
+     * by create time.
+     *
+     * Example orders:
+     * `type`
+     * `state, create_time`
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + 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.api.cloudquotas.v1.ListQuotaPreferencesRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.ListQuotaPreferencesRequest) + private static final com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest(); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaPreferencesRequest 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.api.cloudquotas.v1.ListQuotaPreferencesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesRequestOrBuilder.java new file mode 100644 index 000000000000..c2108d018eaf --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesRequestOrBuilder.java @@ -0,0 +1,187 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public interface ListQuotaPreferencesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.ListQuotaPreferencesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value of QuotaPreference resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * When the value starts with 'folders' or 'organizations', it lists the
+   * QuotaPreferences for org quotas in the container. It does not list the
+   * QuotaPreferences in the descendant projects of the container.
+   *
+   * Example parents:
+   * `projects/123/locations/global`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value of QuotaPreference resources.
+   * Listing across different resource containers (such as 'projects/-') is not
+   * allowed.
+   *
+   * When the value starts with 'folders' or 'organizations', it lists the
+   * QuotaPreferences for org quotas in the container. It does not list the
+   * QuotaPreferences in the descendant projects of the container.
+   *
+   * Example parents:
+   * `projects/123/locations/global`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filter result QuotaPreferences by their state, type,
+   * create/update time range.
+   *
+   * Example filters:
+   * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+   * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+   *  creation_time>2022-12-03T10:30:00`
+   *
+   * If no filter is provided, returns all pending quota preferences.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filter result QuotaPreferences by their state, type,
+   * create/update time range.
+   *
+   * Example filters:
+   * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
+   * `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
+   *  creation_time>2022-12-03T10:30:00`
+   *
+   * If no filter is provided, returns all pending quota preferences.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. How to order of the results. By default, the results are ordered
+   * by create time.
+   *
+   * Example orders:
+   * `type`
+   * `state, create_time`
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. How to order of the results. By default, the results are ordered
+   * by create time.
+   *
+   * Example orders:
+   * `type`
+   * `state, create_time`
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesResponse.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesResponse.java new file mode 100644 index 000000000000..f5e76cf5aa3f --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesResponse.java @@ -0,0 +1,1414 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Message for response to listing QuotaPreferences
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.ListQuotaPreferencesResponse} + */ +public final class ListQuotaPreferencesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.ListQuotaPreferencesResponse) + ListQuotaPreferencesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListQuotaPreferencesResponse.newBuilder() to construct. + private ListQuotaPreferencesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListQuotaPreferencesResponse() { + quotaPreferences_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListQuotaPreferencesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse.class, + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse.Builder.class); + } + + public static final int QUOTA_PREFERENCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List quotaPreferences_; + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public java.util.List getQuotaPreferencesList() { + return quotaPreferences_; + } + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public java.util.List + getQuotaPreferencesOrBuilderList() { + return quotaPreferences_; + } + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public int getQuotaPreferencesCount() { + return quotaPreferences_.size(); + } + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreferences(int index) { + return quotaPreferences_.get(index); + } + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferencesOrBuilder( + int index) { + return quotaPreferences_.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; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(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 { + for (int i = 0; i < quotaPreferences_.size(); i++) { + output.writeMessage(1, quotaPreferences_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < quotaPreferences_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, quotaPreferences_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + 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.api.cloudquotas.v1.ListQuotaPreferencesResponse)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse other = + (com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse) obj; + + if (!getQuotaPreferencesList().equals(other.getQuotaPreferencesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getQuotaPreferencesCount() > 0) { + hash = (37 * hash) + QUOTA_PREFERENCES_FIELD_NUMBER; + hash = (53 * hash) + getQuotaPreferencesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse 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.api.cloudquotas.v1.ListQuotaPreferencesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse 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.api.cloudquotas.v1.ListQuotaPreferencesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse 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.api.cloudquotas.v1.ListQuotaPreferencesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse 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.api.cloudquotas.v1.ListQuotaPreferencesResponse 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; + } + /** + * + * + *
+   * Message for response to listing QuotaPreferences
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.ListQuotaPreferencesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.ListQuotaPreferencesResponse) + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse.class, + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (quotaPreferencesBuilder_ == null) { + quotaPreferences_ = java.util.Collections.emptyList(); + } else { + quotaPreferences_ = null; + quotaPreferencesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_ListQuotaPreferencesResponse_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse build() { + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse buildPartial() { + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse result = + new com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse result) { + if (quotaPreferencesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + quotaPreferences_ = java.util.Collections.unmodifiableList(quotaPreferences_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.quotaPreferences_ = quotaPreferences_; + } else { + result.quotaPreferences_ = quotaPreferencesBuilder_.build(); + } + } + + private void buildPartial0(com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @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.api.cloudquotas.v1.ListQuotaPreferencesResponse) { + return mergeFrom((com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse other) { + if (other == com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse.getDefaultInstance()) + return this; + if (quotaPreferencesBuilder_ == null) { + if (!other.quotaPreferences_.isEmpty()) { + if (quotaPreferences_.isEmpty()) { + quotaPreferences_ = other.quotaPreferences_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.addAll(other.quotaPreferences_); + } + onChanged(); + } + } else { + if (!other.quotaPreferences_.isEmpty()) { + if (quotaPreferencesBuilder_.isEmpty()) { + quotaPreferencesBuilder_.dispose(); + quotaPreferencesBuilder_ = null; + quotaPreferences_ = other.quotaPreferences_; + bitField0_ = (bitField0_ & ~0x00000001); + quotaPreferencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getQuotaPreferencesFieldBuilder() + : null; + } else { + quotaPreferencesBuilder_.addAllMessages(other.quotaPreferences_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.api.cloudquotas.v1.QuotaPreference m = + input.readMessage( + com.google.api.cloudquotas.v1.QuotaPreference.parser(), extensionRegistry); + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(m); + } else { + quotaPreferencesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + 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.util.List quotaPreferences_ = + java.util.Collections.emptyList(); + + private void ensureQuotaPreferencesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + quotaPreferences_ = + new java.util.ArrayList( + quotaPreferences_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder> + quotaPreferencesBuilder_; + + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public java.util.List getQuotaPreferencesList() { + if (quotaPreferencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(quotaPreferences_); + } else { + return quotaPreferencesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public int getQuotaPreferencesCount() { + if (quotaPreferencesBuilder_ == null) { + return quotaPreferences_.size(); + } else { + return quotaPreferencesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreferences(int index) { + if (quotaPreferencesBuilder_ == null) { + return quotaPreferences_.get(index); + } else { + return quotaPreferencesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder setQuotaPreferences( + int index, com.google.api.cloudquotas.v1.QuotaPreference value) { + if (quotaPreferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.set(index, value); + onChanged(); + } else { + quotaPreferencesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder setQuotaPreferences( + int index, com.google.api.cloudquotas.v1.QuotaPreference.Builder builderForValue) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.set(index, builderForValue.build()); + onChanged(); + } else { + quotaPreferencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder addQuotaPreferences(com.google.api.cloudquotas.v1.QuotaPreference value) { + if (quotaPreferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(value); + onChanged(); + } else { + quotaPreferencesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder addQuotaPreferences( + int index, com.google.api.cloudquotas.v1.QuotaPreference value) { + if (quotaPreferencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(index, value); + onChanged(); + } else { + quotaPreferencesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder addQuotaPreferences( + com.google.api.cloudquotas.v1.QuotaPreference.Builder builderForValue) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(builderForValue.build()); + onChanged(); + } else { + quotaPreferencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder addQuotaPreferences( + int index, com.google.api.cloudquotas.v1.QuotaPreference.Builder builderForValue) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.add(index, builderForValue.build()); + onChanged(); + } else { + quotaPreferencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder addAllQuotaPreferences( + java.lang.Iterable values) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, quotaPreferences_); + onChanged(); + } else { + quotaPreferencesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder clearQuotaPreferences() { + if (quotaPreferencesBuilder_ == null) { + quotaPreferences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + quotaPreferencesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public Builder removeQuotaPreferences(int index) { + if (quotaPreferencesBuilder_ == null) { + ensureQuotaPreferencesIsMutable(); + quotaPreferences_.remove(index); + onChanged(); + } else { + quotaPreferencesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1.QuotaPreference.Builder getQuotaPreferencesBuilder( + int index) { + return getQuotaPreferencesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferencesOrBuilder( + int index) { + if (quotaPreferencesBuilder_ == null) { + return quotaPreferences_.get(index); + } else { + return quotaPreferencesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public java.util.List + getQuotaPreferencesOrBuilderList() { + if (quotaPreferencesBuilder_ != null) { + return quotaPreferencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(quotaPreferences_); + } + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1.QuotaPreference.Builder addQuotaPreferencesBuilder() { + return getQuotaPreferencesFieldBuilder() + .addBuilder(com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance()); + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public com.google.api.cloudquotas.v1.QuotaPreference.Builder addQuotaPreferencesBuilder( + int index) { + return getQuotaPreferencesFieldBuilder() + .addBuilder(index, com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance()); + } + /** + * + * + *
+     * The list of QuotaPreference
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + public java.util.List + getQuotaPreferencesBuilderList() { + return getQuotaPreferencesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder> + getQuotaPreferencesFieldBuilder() { + if (quotaPreferencesBuilder_ == null) { + quotaPreferencesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder>( + quotaPreferences_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + quotaPreferences_ = null; + } + return quotaPreferencesBuilder_; + } + + 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; + } + + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(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.api.cloudquotas.v1.ListQuotaPreferencesResponse) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.ListQuotaPreferencesResponse) + private static final com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse(); + } + + public static com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListQuotaPreferencesResponse 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.api.cloudquotas.v1.ListQuotaPreferencesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesResponseOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesResponseOrBuilder.java new file mode 100644 index 000000000000..67bd6aa0f4f9 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ListQuotaPreferencesResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public interface ListQuotaPreferencesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.ListQuotaPreferencesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + java.util.List getQuotaPreferencesList(); + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreferences(int index); + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + int getQuotaPreferencesCount(); + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + java.util.List + getQuotaPreferencesOrBuilderList(); + /** + * + * + *
+   * The list of QuotaPreference
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaPreference quota_preferences = 1; + */ + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferencesOrBuilder(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(); + + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/LocationName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/LocationName.java new file mode 100644 index 000000000000..991fc6b7b3c1 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/LocationName.java @@ -0,0 +1,371 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private static final PathTemplate FOLDER_LOCATION = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/locations/{location}"); + private static final PathTemplate ORGANIZATION_LOCATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/locations/{location}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String folder; + private final String organization; + + @Deprecated + protected LocationName() { + project = null; + location = null; + folder = null; + organization = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + folder = null; + organization = null; + pathTemplate = PROJECT_LOCATION; + } + + private LocationName(FolderLocationBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + project = null; + organization = null; + pathTemplate = FOLDER_LOCATION; + } + + private LocationName(OrganizationLocationBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_LOCATION; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderLocationBuilder newFolderLocationBuilder() { + return new FolderLocationBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationLocationBuilder newOrganizationLocationBuilder() { + return new OrganizationLocationBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LocationName ofProjectLocationName(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LocationName ofFolderLocationName(String folder, String location) { + return newFolderLocationBuilder().setFolder(folder).setLocation(location).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static LocationName ofOrganizationLocationName(String organization, String location) { + return newOrganizationLocationBuilder() + .setOrganization(organization) + .setLocation(location) + .build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationName(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderLocationName(String folder, String location) { + return newFolderLocationBuilder().setFolder(folder).setLocation(location).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationLocationName(String organization, String location) { + return newOrganizationLocationBuilder() + .setOrganization(organization) + .setLocation(location) + .build() + .toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION.match(formattedString); + return ofProjectLocationName(matchMap.get("project"), matchMap.get("location")); + } else if (FOLDER_LOCATION.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION.match(formattedString); + return ofFolderLocationName(matchMap.get("folder"), matchMap.get("location")); + } else if (ORGANIZATION_LOCATION.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION.match(formattedString); + return ofOrganizationLocationName(matchMap.get("organization"), matchMap.get("location")); + } + throw new ValidationException("LocationName.parse: formattedString not in valid format"); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString) + || FOLDER_LOCATION.matches(formattedString) + || ORGANIZATION_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + Preconditions.checkArgument( + Objects.equals(locationName.pathTemplate, PROJECT_LOCATION), + "toBuilder is only supported when LocationName has the pattern of projects/{project}/locations/{location}"); + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderLocationBuilder { + private String folder; + private String location; + + protected FolderLocationBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public FolderLocationBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationBuilder setLocation(String location) { + this.location = location; + return this; + } + + public LocationName build() { + return new LocationName(this); + } + } + + /** Builder for organizations/{organization}/locations/{location}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationLocationBuilder { + private String organization; + private String location; + + protected OrganizationLocationBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public OrganizationLocationBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationBuilder setLocation(String location) { + this.location = location; + return this; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaConfig.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaConfig.java new file mode 100644 index 000000000000..114d0a6dddf9 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaConfig.java @@ -0,0 +1,1900 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * The preferred quota configuration.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaConfig} + */ +public final class QuotaConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.QuotaConfig) + QuotaConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaConfig.newBuilder() to construct. + private QuotaConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaConfig() { + stateDetail_ = ""; + traceId_ = ""; + requestOrigin_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaConfig.class, + com.google.api.cloudquotas.v1.QuotaConfig.Builder.class); + } + + /** + * + * + *
+   * The enumeration of the origins of quota preference requests.
+   * 
+ * + * Protobuf enum {@code google.api.cloudquotas.v1.QuotaConfig.Origin} + */ + public enum Origin implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The unspecified value.
+     * 
+ * + * ORIGIN_UNSPECIFIED = 0; + */ + ORIGIN_UNSPECIFIED(0), + /** + * + * + *
+     * Created through Cloud Console.
+     * 
+ * + * CLOUD_CONSOLE = 1; + */ + CLOUD_CONSOLE(1), + /** + * + * + *
+     * Generated by automatic quota adjustment.
+     * 
+ * + * AUTO_ADJUSTER = 2; + */ + AUTO_ADJUSTER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The unspecified value.
+     * 
+ * + * ORIGIN_UNSPECIFIED = 0; + */ + public static final int ORIGIN_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Created through Cloud Console.
+     * 
+ * + * CLOUD_CONSOLE = 1; + */ + public static final int CLOUD_CONSOLE_VALUE = 1; + /** + * + * + *
+     * Generated by automatic quota adjustment.
+     * 
+ * + * AUTO_ADJUSTER = 2; + */ + public static final int AUTO_ADJUSTER_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Origin valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Origin forNumber(int value) { + switch (value) { + case 0: + return ORIGIN_UNSPECIFIED; + case 1: + return CLOUD_CONSOLE; + case 2: + return AUTO_ADJUSTER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Origin findValueByNumber(int number) { + return Origin.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.cloudquotas.v1.QuotaConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final Origin[] VALUES = values(); + + public static Origin valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Origin(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1.QuotaConfig.Origin) + } + + public static final int PREFERRED_VALUE_FIELD_NUMBER = 1; + private long preferredValue_ = 0L; + /** + * + * + *
+   * Required. The preferred value. Must be greater than or equal to -1. If set
+   * to -1, it means the value is "unlimited".
+   * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The preferredValue. + */ + @java.lang.Override + public long getPreferredValue() { + return preferredValue_; + } + + public static final int STATE_DETAIL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object stateDetail_ = ""; + /** + * + * + *
+   * Output only. Optional details about the state of this quota preference.
+   * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateDetail. + */ + @java.lang.Override + public java.lang.String getStateDetail() { + java.lang.Object ref = stateDetail_; + 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(); + stateDetail_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Optional details about the state of this quota preference.
+   * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStateDetailBytes() { + java.lang.Object ref = stateDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GRANTED_VALUE_FIELD_NUMBER = 3; + private com.google.protobuf.Int64Value grantedValue_; + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the grantedValue field is set. + */ + @java.lang.Override + public boolean hasGrantedValue() { + return grantedValue_ != null; + } + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The grantedValue. + */ + @java.lang.Override + public com.google.protobuf.Int64Value getGrantedValue() { + return grantedValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : grantedValue_; + } + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.Int64ValueOrBuilder getGrantedValueOrBuilder() { + return grantedValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : grantedValue_; + } + + public static final int TRACE_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object traceId_ = ""; + /** + * + * + *
+   * Output only. The trace id that the GCP uses to provision the requested
+   * quota. This trace id may be used by the client to contact Cloud support to
+   * track the state of a quota preference request. The trace id is only
+   * produced for increase requests and is unique for each request. The
+   * quota decrease requests do not have a trace id.
+   * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The traceId. + */ + @java.lang.Override + public java.lang.String getTraceId() { + java.lang.Object ref = traceId_; + 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(); + traceId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The trace id that the GCP uses to provision the requested
+   * quota. This trace id may be used by the client to contact Cloud support to
+   * track the state of a quota preference request. The trace id is only
+   * produced for increase requests and is unique for each request. The
+   * quota decrease requests do not have a trace id.
+   * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for traceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTraceIdBytes() { + java.lang.Object ref = traceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + traceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 5; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaConfig_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int REQUEST_ORIGIN_FIELD_NUMBER = 6; + private int requestOrigin_ = 0; + /** + * + * + *
+   * Output only. The origin of the quota preference request.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for requestOrigin. + */ + @java.lang.Override + public int getRequestOriginValue() { + return requestOrigin_; + } + /** + * + * + *
+   * Output only. The origin of the quota preference request.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The requestOrigin. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaConfig.Origin getRequestOrigin() { + com.google.api.cloudquotas.v1.QuotaConfig.Origin result = + com.google.api.cloudquotas.v1.QuotaConfig.Origin.forNumber(requestOrigin_); + return result == null ? com.google.api.cloudquotas.v1.QuotaConfig.Origin.UNRECOGNIZED : result; + } + + 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 (preferredValue_ != 0L) { + output.writeInt64(1, preferredValue_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateDetail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, stateDetail_); + } + if (grantedValue_ != null) { + output.writeMessage(3, getGrantedValue()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(traceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, traceId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 5); + if (requestOrigin_ + != com.google.api.cloudquotas.v1.QuotaConfig.Origin.ORIGIN_UNSPECIFIED.getNumber()) { + output.writeEnum(6, requestOrigin_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (preferredValue_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, preferredValue_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stateDetail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, stateDetail_); + } + if (grantedValue_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getGrantedValue()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(traceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, traceId_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, annotations__); + } + if (requestOrigin_ + != com.google.api.cloudquotas.v1.QuotaConfig.Origin.ORIGIN_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, requestOrigin_); + } + 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.api.cloudquotas.v1.QuotaConfig)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.QuotaConfig other = + (com.google.api.cloudquotas.v1.QuotaConfig) obj; + + if (getPreferredValue() != other.getPreferredValue()) return false; + if (!getStateDetail().equals(other.getStateDetail())) return false; + if (hasGrantedValue() != other.hasGrantedValue()) return false; + if (hasGrantedValue()) { + if (!getGrantedValue().equals(other.getGrantedValue())) return false; + } + if (!getTraceId().equals(other.getTraceId())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (requestOrigin_ != other.requestOrigin_) 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) + PREFERRED_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPreferredValue()); + hash = (37 * hash) + STATE_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStateDetail().hashCode(); + if (hasGrantedValue()) { + hash = (37 * hash) + GRANTED_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getGrantedValue().hashCode(); + } + hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTraceId().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + REQUEST_ORIGIN_FIELD_NUMBER; + hash = (53 * hash) + requestOrigin_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.QuotaConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig 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.api.cloudquotas.v1.QuotaConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig 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.api.cloudquotas.v1.QuotaConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig 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.api.cloudquotas.v1.QuotaConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig 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.api.cloudquotas.v1.QuotaConfig 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 preferred quota configuration.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.QuotaConfig) + com.google.api.cloudquotas.v1.QuotaConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 5: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 5: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaConfig.class, + com.google.api.cloudquotas.v1.QuotaConfig.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.QuotaConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + preferredValue_ = 0L; + stateDetail_ = ""; + grantedValue_ = null; + if (grantedValueBuilder_ != null) { + grantedValueBuilder_.dispose(); + grantedValueBuilder_ = null; + } + traceId_ = ""; + internalGetMutableAnnotations().clear(); + requestOrigin_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaConfig_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaConfig getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.QuotaConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaConfig build() { + com.google.api.cloudquotas.v1.QuotaConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaConfig buildPartial() { + com.google.api.cloudquotas.v1.QuotaConfig result = + new com.google.api.cloudquotas.v1.QuotaConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.QuotaConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.preferredValue_ = preferredValue_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stateDetail_ = stateDetail_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.grantedValue_ = + grantedValueBuilder_ == null ? grantedValue_ : grantedValueBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.traceId_ = traceId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestOrigin_ = requestOrigin_; + } + } + + @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.api.cloudquotas.v1.QuotaConfig) { + return mergeFrom((com.google.api.cloudquotas.v1.QuotaConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.QuotaConfig other) { + if (other == com.google.api.cloudquotas.v1.QuotaConfig.getDefaultInstance()) return this; + if (other.getPreferredValue() != 0L) { + setPreferredValue(other.getPreferredValue()); + } + if (!other.getStateDetail().isEmpty()) { + stateDetail_ = other.stateDetail_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasGrantedValue()) { + mergeGrantedValue(other.getGrantedValue()); + } + if (!other.getTraceId().isEmpty()) { + traceId_ = other.traceId_; + bitField0_ |= 0x00000008; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000010; + if (other.requestOrigin_ != 0) { + setRequestOriginValue(other.getRequestOriginValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + preferredValue_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + stateDetail_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getGrantedValueFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + traceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestOrigin_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long preferredValue_; + /** + * + * + *
+     * Required. The preferred value. Must be greater than or equal to -1. If set
+     * to -1, it means the value is "unlimited".
+     * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The preferredValue. + */ + @java.lang.Override + public long getPreferredValue() { + return preferredValue_; + } + /** + * + * + *
+     * Required. The preferred value. Must be greater than or equal to -1. If set
+     * to -1, it means the value is "unlimited".
+     * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The preferredValue to set. + * @return This builder for chaining. + */ + public Builder setPreferredValue(long value) { + + preferredValue_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The preferred value. Must be greater than or equal to -1. If set
+     * to -1, it means the value is "unlimited".
+     * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPreferredValue() { + bitField0_ = (bitField0_ & ~0x00000001); + preferredValue_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object stateDetail_ = ""; + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateDetail. + */ + public java.lang.String getStateDetail() { + java.lang.Object ref = stateDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + stateDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateDetail. + */ + public com.google.protobuf.ByteString getStateDetailBytes() { + java.lang.Object ref = stateDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + stateDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The stateDetail to set. + * @return This builder for chaining. + */ + public Builder setStateDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + stateDetail_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStateDetail() { + stateDetail_ = getDefaultInstance().getStateDetail(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Optional details about the state of this quota preference.
+     * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for stateDetail to set. + * @return This builder for chaining. + */ + public Builder setStateDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + stateDetail_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Int64Value grantedValue_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + grantedValueBuilder_; + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the grantedValue field is set. + */ + public boolean hasGrantedValue() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The grantedValue. + */ + public com.google.protobuf.Int64Value getGrantedValue() { + if (grantedValueBuilder_ == null) { + return grantedValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : grantedValue_; + } else { + return grantedValueBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGrantedValue(com.google.protobuf.Int64Value value) { + if (grantedValueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + grantedValue_ = value; + } else { + grantedValueBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setGrantedValue(com.google.protobuf.Int64Value.Builder builderForValue) { + if (grantedValueBuilder_ == null) { + grantedValue_ = builderForValue.build(); + } else { + grantedValueBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeGrantedValue(com.google.protobuf.Int64Value value) { + if (grantedValueBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && grantedValue_ != null + && grantedValue_ != com.google.protobuf.Int64Value.getDefaultInstance()) { + getGrantedValueBuilder().mergeFrom(value); + } else { + grantedValue_ = value; + } + } else { + grantedValueBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearGrantedValue() { + bitField0_ = (bitField0_ & ~0x00000004); + grantedValue_ = null; + if (grantedValueBuilder_ != null) { + grantedValueBuilder_.dispose(); + grantedValueBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Int64Value.Builder getGrantedValueBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getGrantedValueFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Int64ValueOrBuilder getGrantedValueOrBuilder() { + if (grantedValueBuilder_ != null) { + return grantedValueBuilder_.getMessageOrBuilder(); + } else { + return grantedValue_ == null + ? com.google.protobuf.Int64Value.getDefaultInstance() + : grantedValue_; + } + } + /** + * + * + *
+     * Output only. Granted quota value.
+     * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder> + getGrantedValueFieldBuilder() { + if (grantedValueBuilder_ == null) { + grantedValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int64Value, + com.google.protobuf.Int64Value.Builder, + com.google.protobuf.Int64ValueOrBuilder>( + getGrantedValue(), getParentForChildren(), isClean()); + grantedValue_ = null; + } + return grantedValueBuilder_; + } + + private java.lang.Object traceId_ = ""; + /** + * + * + *
+     * Output only. The trace id that the GCP uses to provision the requested
+     * quota. This trace id may be used by the client to contact Cloud support to
+     * track the state of a quota preference request. The trace id is only
+     * produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The traceId. + */ + public java.lang.String getTraceId() { + java.lang.Object ref = traceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + traceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The trace id that the GCP uses to provision the requested
+     * quota. This trace id may be used by the client to contact Cloud support to
+     * track the state of a quota preference request. The trace id is only
+     * produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for traceId. + */ + public com.google.protobuf.ByteString getTraceIdBytes() { + java.lang.Object ref = traceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + traceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The trace id that the GCP uses to provision the requested
+     * quota. This trace id may be used by the client to contact Cloud support to
+     * track the state of a quota preference request. The trace id is only
+     * produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The traceId to set. + * @return This builder for chaining. + */ + public Builder setTraceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + traceId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The trace id that the GCP uses to provision the requested
+     * quota. This trace id may be used by the client to contact Cloud support to
+     * track the state of a quota preference request. The trace id is only
+     * produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTraceId() { + traceId_ = getDefaultInstance().getTraceId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The trace id that the GCP uses to provision the requested
+     * quota. This trace id may be used by the client to contact Cloud support to
+     * track the state of a quota preference request. The trace id is only
+     * produced for increase requests and is unique for each request. The
+     * quota decrease requests do not have a trace id.
+     * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for traceId to set. + * @return This builder for chaining. + */ + public Builder setTraceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + traceId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * The annotations map for clients to store small amounts of arbitrary data.
+     * Do not put PII or other sensitive information here.
+     * See https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * The annotations map for clients to store small amounts of arbitrary data.
+     * Do not put PII or other sensitive information here.
+     * See https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * The annotations map for clients to store small amounts of arbitrary data.
+     * Do not put PII or other sensitive information here.
+     * See https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The annotations map for clients to store small amounts of arbitrary data.
+     * Do not put PII or other sensitive information here.
+     * See https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5; + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The annotations map for clients to store small amounts of arbitrary data.
+     * Do not put PII or other sensitive information here.
+     * See https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000010; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * The annotations map for clients to store small amounts of arbitrary data.
+     * Do not put PII or other sensitive information here.
+     * See https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * The annotations map for clients to store small amounts of arbitrary data.
+     * Do not put PII or other sensitive information here.
+     * See https://google.aip.dev/128#annotations
+     * 
+ * + * map<string, string> annotations = 5; + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + return this; + } + + private int requestOrigin_ = 0; + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for requestOrigin. + */ + @java.lang.Override + public int getRequestOriginValue() { + return requestOrigin_; + } + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for requestOrigin to set. + * @return This builder for chaining. + */ + public Builder setRequestOriginValue(int value) { + requestOrigin_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The requestOrigin. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaConfig.Origin getRequestOrigin() { + com.google.api.cloudquotas.v1.QuotaConfig.Origin result = + com.google.api.cloudquotas.v1.QuotaConfig.Origin.forNumber(requestOrigin_); + return result == null + ? com.google.api.cloudquotas.v1.QuotaConfig.Origin.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The requestOrigin to set. + * @return This builder for chaining. + */ + public Builder setRequestOrigin(com.google.api.cloudquotas.v1.QuotaConfig.Origin value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + requestOrigin_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The origin of the quota preference request.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRequestOrigin() { + bitField0_ = (bitField0_ & ~0x00000020); + requestOrigin_ = 0; + 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.api.cloudquotas.v1.QuotaConfig) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.QuotaConfig) + private static final com.google.api.cloudquotas.v1.QuotaConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.QuotaConfig(); + } + + public static com.google.api.cloudquotas.v1.QuotaConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaConfig 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.api.cloudquotas.v1.QuotaConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaConfigOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaConfigOrBuilder.java new file mode 100644 index 000000000000..7c624820cb58 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaConfigOrBuilder.java @@ -0,0 +1,235 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +public interface QuotaConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.QuotaConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The preferred value. Must be greater than or equal to -1. If set
+   * to -1, it means the value is "unlimited".
+   * 
+ * + * int64 preferred_value = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The preferredValue. + */ + long getPreferredValue(); + + /** + * + * + *
+   * Output only. Optional details about the state of this quota preference.
+   * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The stateDetail. + */ + java.lang.String getStateDetail(); + /** + * + * + *
+   * Output only. Optional details about the state of this quota preference.
+   * 
+ * + * string state_detail = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for stateDetail. + */ + com.google.protobuf.ByteString getStateDetailBytes(); + + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the grantedValue field is set. + */ + boolean hasGrantedValue(); + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The grantedValue. + */ + com.google.protobuf.Int64Value getGrantedValue(); + /** + * + * + *
+   * Output only. Granted quota value.
+   * 
+ * + * + * .google.protobuf.Int64Value granted_value = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.Int64ValueOrBuilder getGrantedValueOrBuilder(); + + /** + * + * + *
+   * Output only. The trace id that the GCP uses to provision the requested
+   * quota. This trace id may be used by the client to contact Cloud support to
+   * track the state of a quota preference request. The trace id is only
+   * produced for increase requests and is unique for each request. The
+   * quota decrease requests do not have a trace id.
+   * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The traceId. + */ + java.lang.String getTraceId(); + /** + * + * + *
+   * Output only. The trace id that the GCP uses to provision the requested
+   * quota. This trace id may be used by the client to contact Cloud support to
+   * track the state of a quota preference request. The trace id is only
+   * produced for increase requests and is unique for each request. The
+   * quota decrease requests do not have a trace id.
+   * 
+ * + * string trace_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for traceId. + */ + com.google.protobuf.ByteString getTraceIdBytes(); + + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + int getAnnotationsCount(); + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The annotations map for clients to store small amounts of arbitrary data.
+   * Do not put PII or other sensitive information here.
+   * See https://google.aip.dev/128#annotations
+   * 
+ * + * map<string, string> annotations = 5; + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. The origin of the quota preference request.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for requestOrigin. + */ + int getRequestOriginValue(); + /** + * + * + *
+   * Output only. The origin of the quota preference request.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig.Origin request_origin = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The requestOrigin. + */ + com.google.api.cloudquotas.v1.QuotaConfig.Origin getRequestOrigin(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaDetails.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaDetails.java new file mode 100644 index 000000000000..9d43770768f3 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaDetails.java @@ -0,0 +1,533 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * The quota details for a map of dimensions.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaDetails} + */ +public final class QuotaDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.QuotaDetails) + QuotaDetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaDetails.newBuilder() to construct. + private QuotaDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaDetails() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaDetails(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaDetails.class, + com.google.api.cloudquotas.v1.QuotaDetails.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private long value_ = 0L; + /** + * + * + *
+   * The value currently in effect and being enforced.
+   * 
+ * + * int64 value = 1; + * + * @return The value. + */ + @java.lang.Override + public long getValue() { + return value_; + } + + 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 (value_ != 0L) { + output.writeInt64(1, value_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (value_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, value_); + } + 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.api.cloudquotas.v1.QuotaDetails)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.QuotaDetails other = + (com.google.api.cloudquotas.v1.QuotaDetails) obj; + + if (getValue() != other.getValue()) 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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getValue()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.QuotaDetails parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails 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.api.cloudquotas.v1.QuotaDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails 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.api.cloudquotas.v1.QuotaDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails 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.api.cloudquotas.v1.QuotaDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails 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.api.cloudquotas.v1.QuotaDetails 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 quota details for a map of dimensions.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaDetails} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.QuotaDetails) + com.google.api.cloudquotas.v1.QuotaDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaDetails.class, + com.google.api.cloudquotas.v1.QuotaDetails.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.QuotaDetails.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaDetails_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaDetails getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.QuotaDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaDetails build() { + com.google.api.cloudquotas.v1.QuotaDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaDetails buildPartial() { + com.google.api.cloudquotas.v1.QuotaDetails result = + new com.google.api.cloudquotas.v1.QuotaDetails(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.QuotaDetails result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.value_ = value_; + } + } + + @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.api.cloudquotas.v1.QuotaDetails) { + return mergeFrom((com.google.api.cloudquotas.v1.QuotaDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.QuotaDetails other) { + if (other == com.google.api.cloudquotas.v1.QuotaDetails.getDefaultInstance()) return this; + if (other.getValue() != 0L) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + value_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long value_; + /** + * + * + *
+     * The value currently in effect and being enforced.
+     * 
+ * + * int64 value = 1; + * + * @return The value. + */ + @java.lang.Override + public long getValue() { + return value_; + } + /** + * + * + *
+     * The value currently in effect and being enforced.
+     * 
+ * + * int64 value = 1; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(long value) { + + value_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The value currently in effect and being enforced.
+     * 
+ * + * int64 value = 1; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + bitField0_ = (bitField0_ & ~0x00000001); + value_ = 0L; + 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.api.cloudquotas.v1.QuotaDetails) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.QuotaDetails) + private static final com.google.api.cloudquotas.v1.QuotaDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.QuotaDetails(); + } + + public static com.google.api.cloudquotas.v1.QuotaDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaDetails 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.api.cloudquotas.v1.QuotaDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaDetailsOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaDetailsOrBuilder.java new file mode 100644 index 000000000000..38e660fad2df --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaDetailsOrBuilder.java @@ -0,0 +1,38 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +public interface QuotaDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.QuotaDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The value currently in effect and being enforced.
+   * 
+ * + * int64 value = 1; + * + * @return The value. + */ + long getValue(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaIncreaseEligibility.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaIncreaseEligibility.java new file mode 100644 index 000000000000..d33d7675e113 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaIncreaseEligibility.java @@ -0,0 +1,890 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Eligibility information regarding requesting increase adjustment of a quota.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaIncreaseEligibility} + */ +public final class QuotaIncreaseEligibility extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.QuotaIncreaseEligibility) + QuotaIncreaseEligibilityOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaIncreaseEligibility.newBuilder() to construct. + private QuotaIncreaseEligibility(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaIncreaseEligibility() { + ineligibilityReason_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaIncreaseEligibility(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.class, + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.Builder.class); + } + + /** + * + * + *
+   * The enumeration of reasons when it is ineligible to request increase
+   * adjustment.
+   * 
+ * + * Protobuf enum {@code google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason} + */ + public enum IneligibilityReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value when is_eligible is true.
+     * 
+ * + * INELIGIBILITY_REASON_UNSPECIFIED = 0; + */ + INELIGIBILITY_REASON_UNSPECIFIED(0), + /** + * + * + *
+     * The container is not linked with a billing account.
+     * 
+ * + * NO_BILLING_ACCOUNT = 2; + */ + NO_BILLING_ACCOUNT(2), + /** + * + * + *
+     * Other reasons.
+     * 
+ * + * OTHER = 3; + */ + OTHER(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value when is_eligible is true.
+     * 
+ * + * INELIGIBILITY_REASON_UNSPECIFIED = 0; + */ + public static final int INELIGIBILITY_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The container is not linked with a billing account.
+     * 
+ * + * NO_BILLING_ACCOUNT = 2; + */ + public static final int NO_BILLING_ACCOUNT_VALUE = 2; + /** + * + * + *
+     * Other reasons.
+     * 
+ * + * OTHER = 3; + */ + public static final int OTHER_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IneligibilityReason valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static IneligibilityReason forNumber(int value) { + switch (value) { + case 0: + return INELIGIBILITY_REASON_UNSPECIFIED; + case 2: + return NO_BILLING_ACCOUNT; + case 3: + return OTHER; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public IneligibilityReason findValueByNumber(int number) { + return IneligibilityReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final IneligibilityReason[] VALUES = values(); + + public static IneligibilityReason valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private IneligibilityReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason) + } + + public static final int IS_ELIGIBLE_FIELD_NUMBER = 1; + private boolean isEligible_ = false; + /** + * + * + *
+   * Whether a higher quota value can be requested for the quota.
+   * 
+ * + * bool is_eligible = 1; + * + * @return The isEligible. + */ + @java.lang.Override + public boolean getIsEligible() { + return isEligible_; + } + + public static final int INELIGIBILITY_REASON_FIELD_NUMBER = 2; + private int ineligibilityReason_ = 0; + /** + * + * + *
+   * The reason of why it is ineligible to request increased value of the quota.
+   * If the is_eligible field is true, it defaults to
+   * INELIGIBILITY_REASON_UNSPECIFIED.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The enum numeric value on the wire for ineligibilityReason. + */ + @java.lang.Override + public int getIneligibilityReasonValue() { + return ineligibilityReason_; + } + /** + * + * + *
+   * The reason of why it is ineligible to request increased value of the quota.
+   * If the is_eligible field is true, it defaults to
+   * INELIGIBILITY_REASON_UNSPECIFIED.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The ineligibilityReason. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason + getIneligibilityReason() { + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason result = + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason.forNumber( + ineligibilityReason_); + return result == null + ? com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason.UNRECOGNIZED + : result; + } + + 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 (isEligible_ != false) { + output.writeBool(1, isEligible_); + } + if (ineligibilityReason_ + != com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason + .INELIGIBILITY_REASON_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, ineligibilityReason_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (isEligible_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, isEligible_); + } + if (ineligibilityReason_ + != com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason + .INELIGIBILITY_REASON_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, ineligibilityReason_); + } + 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.api.cloudquotas.v1.QuotaIncreaseEligibility)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility other = + (com.google.api.cloudquotas.v1.QuotaIncreaseEligibility) obj; + + if (getIsEligible() != other.getIsEligible()) return false; + if (ineligibilityReason_ != other.ineligibilityReason_) 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) + IS_ELIGIBLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsEligible()); + hash = (37 * hash) + INELIGIBILITY_REASON_FIELD_NUMBER; + hash = (53 * hash) + ineligibilityReason_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility 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.api.cloudquotas.v1.QuotaIncreaseEligibility parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility 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.api.cloudquotas.v1.QuotaIncreaseEligibility parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility 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.api.cloudquotas.v1.QuotaIncreaseEligibility parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility 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.api.cloudquotas.v1.QuotaIncreaseEligibility 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; + } + /** + * + * + *
+   * Eligibility information regarding requesting increase adjustment of a quota.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaIncreaseEligibility} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.QuotaIncreaseEligibility) + com.google.api.cloudquotas.v1.QuotaIncreaseEligibilityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.class, + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + isEligible_ = false; + ineligibilityReason_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibility getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibility build() { + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibility buildPartial() { + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility result = + new com.google.api.cloudquotas.v1.QuotaIncreaseEligibility(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.QuotaIncreaseEligibility result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.isEligible_ = isEligible_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ineligibilityReason_ = ineligibilityReason_; + } + } + + @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.api.cloudquotas.v1.QuotaIncreaseEligibility) { + return mergeFrom((com.google.api.cloudquotas.v1.QuotaIncreaseEligibility) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.QuotaIncreaseEligibility other) { + if (other == com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.getDefaultInstance()) + return this; + if (other.getIsEligible() != false) { + setIsEligible(other.getIsEligible()); + } + if (other.ineligibilityReason_ != 0) { + setIneligibilityReasonValue(other.getIneligibilityReasonValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + isEligible_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + ineligibilityReason_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + 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 boolean isEligible_; + /** + * + * + *
+     * Whether a higher quota value can be requested for the quota.
+     * 
+ * + * bool is_eligible = 1; + * + * @return The isEligible. + */ + @java.lang.Override + public boolean getIsEligible() { + return isEligible_; + } + /** + * + * + *
+     * Whether a higher quota value can be requested for the quota.
+     * 
+ * + * bool is_eligible = 1; + * + * @param value The isEligible to set. + * @return This builder for chaining. + */ + public Builder setIsEligible(boolean value) { + + isEligible_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether a higher quota value can be requested for the quota.
+     * 
+ * + * bool is_eligible = 1; + * + * @return This builder for chaining. + */ + public Builder clearIsEligible() { + bitField0_ = (bitField0_ & ~0x00000001); + isEligible_ = false; + onChanged(); + return this; + } + + private int ineligibilityReason_ = 0; + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The enum numeric value on the wire for ineligibilityReason. + */ + @java.lang.Override + public int getIneligibilityReasonValue() { + return ineligibilityReason_; + } + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @param value The enum numeric value on the wire for ineligibilityReason to set. + * @return This builder for chaining. + */ + public Builder setIneligibilityReasonValue(int value) { + ineligibilityReason_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The ineligibilityReason. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason + getIneligibilityReason() { + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason result = + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason.forNumber( + ineligibilityReason_); + return result == null + ? com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @param value The ineligibilityReason to set. + * @return This builder for chaining. + */ + public Builder setIneligibilityReason( + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + ineligibilityReason_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The reason of why it is ineligible to request increased value of the quota.
+     * If the is_eligible field is true, it defaults to
+     * INELIGIBILITY_REASON_UNSPECIFIED.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearIneligibilityReason() { + bitField0_ = (bitField0_ & ~0x00000002); + ineligibilityReason_ = 0; + 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.api.cloudquotas.v1.QuotaIncreaseEligibility) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.QuotaIncreaseEligibility) + private static final com.google.api.cloudquotas.v1.QuotaIncreaseEligibility DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.QuotaIncreaseEligibility(); + } + + public static com.google.api.cloudquotas.v1.QuotaIncreaseEligibility getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaIncreaseEligibility 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.api.cloudquotas.v1.QuotaIncreaseEligibility getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaIncreaseEligibilityOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaIncreaseEligibilityOrBuilder.java new file mode 100644 index 000000000000..a55d2c580f61 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaIncreaseEligibilityOrBuilder.java @@ -0,0 +1,72 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +public interface QuotaIncreaseEligibilityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.QuotaIncreaseEligibility) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether a higher quota value can be requested for the quota.
+   * 
+ * + * bool is_eligible = 1; + * + * @return The isEligible. + */ + boolean getIsEligible(); + + /** + * + * + *
+   * The reason of why it is ineligible to request increased value of the quota.
+   * If the is_eligible field is true, it defaults to
+   * INELIGIBILITY_REASON_UNSPECIFIED.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The enum numeric value on the wire for ineligibilityReason. + */ + int getIneligibilityReasonValue(); + /** + * + * + *
+   * The reason of why it is ineligible to request increased value of the quota.
+   * If the is_eligible field is true, it defaults to
+   * INELIGIBILITY_REASON_UNSPECIFIED.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason ineligibility_reason = 2; + * + * + * @return The ineligibilityReason. + */ + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.IneligibilityReason + getIneligibilityReason(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfo.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfo.java new file mode 100644 index 000000000000..7bc0970d561f --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfo.java @@ -0,0 +1,3920 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * QuotaInfo represents information about a particular quota for a given
+ * project, folder or organization.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaInfo} + */ +public final class QuotaInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.QuotaInfo) + QuotaInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaInfo.newBuilder() to construct. + private QuotaInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaInfo() { + name_ = ""; + quotaId_ = ""; + metric_ = ""; + service_ = ""; + refreshInterval_ = ""; + containerType_ = 0; + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + metricDisplayName_ = ""; + quotaDisplayName_ = ""; + metricUnit_ = ""; + dimensionsInfos_ = java.util.Collections.emptyList(); + serviceRequestQuotaUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaInfo.class, + com.google.api.cloudquotas.v1.QuotaInfo.Builder.class); + } + + /** + * + * + *
+   * The enumeration of the types of a cloud resource container.
+   * 
+ * + * Protobuf enum {@code google.api.cloudquotas.v1.QuotaInfo.ContainerType} + */ + public enum ContainerType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified container type.
+     * 
+ * + * CONTAINER_TYPE_UNSPECIFIED = 0; + */ + CONTAINER_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * consumer project
+     * 
+ * + * PROJECT = 1; + */ + PROJECT(1), + /** + * + * + *
+     * folder
+     * 
+ * + * FOLDER = 2; + */ + FOLDER(2), + /** + * + * + *
+     * organization
+     * 
+ * + * ORGANIZATION = 3; + */ + ORGANIZATION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified container type.
+     * 
+ * + * CONTAINER_TYPE_UNSPECIFIED = 0; + */ + public static final int CONTAINER_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * consumer project
+     * 
+ * + * PROJECT = 1; + */ + public static final int PROJECT_VALUE = 1; + /** + * + * + *
+     * folder
+     * 
+ * + * FOLDER = 2; + */ + public static final int FOLDER_VALUE = 2; + /** + * + * + *
+     * organization
+     * 
+ * + * ORGANIZATION = 3; + */ + public static final int ORGANIZATION_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContainerType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ContainerType forNumber(int value) { + switch (value) { + case 0: + return CONTAINER_TYPE_UNSPECIFIED; + case 1: + return PROJECT; + case 2: + return FOLDER; + case 3: + return ORGANIZATION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ContainerType findValueByNumber(int number) { + return ContainerType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.cloudquotas.v1.QuotaInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final ContainerType[] VALUES = values(); + + public static ContainerType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ContainerType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1.QuotaInfo.ContainerType) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Resource name of this QuotaInfo.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of this QuotaInfo.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaId_ = ""; + /** + * + * + *
+   * The id of the quota, which is unquie within the service.
+   * Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 2; + * + * @return The quotaId. + */ + @java.lang.Override + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + 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(); + quotaId_ = s; + return s; + } + } + /** + * + * + *
+   * The id of the quota, which is unquie within the service.
+   * Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 2; + * + * @return The bytes for quotaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object metric_ = ""; + /** + * + * + *
+   * The metric of the quota. It specifies the resources consumption the quota
+   * is defined for.
+   * Example: `compute.googleapis.com/cpus`
+   * 
+ * + * string metric = 3; + * + * @return The metric. + */ + @java.lang.Override + public java.lang.String getMetric() { + java.lang.Object ref = metric_; + 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(); + metric_ = s; + return s; + } + } + /** + * + * + *
+   * The metric of the quota. It specifies the resources consumption the quota
+   * is defined for.
+   * Example: `compute.googleapis.com/cpus`
+   * 
+ * + * string metric = 3; + * + * @return The bytes for metric. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricBytes() { + java.lang.Object ref = metric_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** + * + * + *
+   * The name of the service in which the quota is defined.
+   * Example: `compute.googleapis.com`
+   * 
+ * + * string service = 4; + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the service in which the quota is defined.
+   * Example: `compute.googleapis.com`
+   * 
+ * + * string service = 4; + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_PRECISE_FIELD_NUMBER = 5; + private boolean isPrecise_ = false; + /** + * + * + *
+   * Whether this is a precise quota. A precise quota is tracked with absolute
+   * precision. In contrast, an imprecise quota is not tracked with precision.
+   * 
+ * + * bool is_precise = 5; + * + * @return The isPrecise. + */ + @java.lang.Override + public boolean getIsPrecise() { + return isPrecise_; + } + + public static final int REFRESH_INTERVAL_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object refreshInterval_ = ""; + /** + * + * + *
+   * The reset time interval for the quota. Refresh interval applies to rate
+   * quota only.
+   * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+   * every 10 seconds.
+   * 
+ * + * string refresh_interval = 6; + * + * @return The refreshInterval. + */ + @java.lang.Override + public java.lang.String getRefreshInterval() { + java.lang.Object ref = refreshInterval_; + 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(); + refreshInterval_ = s; + return s; + } + } + /** + * + * + *
+   * The reset time interval for the quota. Refresh interval applies to rate
+   * quota only.
+   * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+   * every 10 seconds.
+   * 
+ * + * string refresh_interval = 6; + * + * @return The bytes for refreshInterval. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRefreshIntervalBytes() { + java.lang.Object ref = refreshInterval_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + refreshInterval_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTAINER_TYPE_FIELD_NUMBER = 7; + private int containerType_ = 0; + /** + * + * + *
+   * The container type of the QuotaInfo.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @return The enum numeric value on the wire for containerType. + */ + @java.lang.Override + public int getContainerTypeValue() { + return containerType_; + } + /** + * + * + *
+   * The container type of the QuotaInfo.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @return The containerType. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaInfo.ContainerType getContainerType() { + com.google.api.cloudquotas.v1.QuotaInfo.ContainerType result = + com.google.api.cloudquotas.v1.QuotaInfo.ContainerType.forNumber(containerType_); + return result == null + ? com.google.api.cloudquotas.v1.QuotaInfo.ContainerType.UNRECOGNIZED + : result; + } + + public static final int DIMENSIONS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList dimensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @return A list containing the dimensions. + */ + public com.google.protobuf.ProtocolStringList getDimensionsList() { + return dimensions_; + } + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @return The count of dimensions. + */ + public int getDimensionsCount() { + return dimensions_.size(); + } + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + public java.lang.String getDimensions(int index) { + return dimensions_.get(index); + } + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + public com.google.protobuf.ByteString getDimensionsBytes(int index) { + return dimensions_.getByteString(index); + } + + public static final int METRIC_DISPLAY_NAME_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object metricDisplayName_ = ""; + /** + * + * + *
+   * The display name of the quota metric
+   * 
+ * + * string metric_display_name = 9; + * + * @return The metricDisplayName. + */ + @java.lang.Override + public java.lang.String getMetricDisplayName() { + java.lang.Object ref = metricDisplayName_; + 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(); + metricDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the quota metric
+   * 
+ * + * string metric_display_name = 9; + * + * @return The bytes for metricDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricDisplayNameBytes() { + java.lang.Object ref = metricDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_DISPLAY_NAME_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaDisplayName_ = ""; + /** + * + * + *
+   * The display name of the quota.
+   * 
+ * + * string quota_display_name = 10; + * + * @return The quotaDisplayName. + */ + @java.lang.Override + public java.lang.String getQuotaDisplayName() { + java.lang.Object ref = quotaDisplayName_; + 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(); + quotaDisplayName_ = s; + return s; + } + } + /** + * + * + *
+   * The display name of the quota.
+   * 
+ * + * string quota_display_name = 10; + * + * @return The bytes for quotaDisplayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaDisplayNameBytes() { + java.lang.Object ref = quotaDisplayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_UNIT_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object metricUnit_ = ""; + /** + * + * + *
+   * The unit in which the metric value is reported, e.g., “MByte”.
+   * 
+ * + * string metric_unit = 11; + * + * @return The metricUnit. + */ + @java.lang.Override + public java.lang.String getMetricUnit() { + java.lang.Object ref = metricUnit_; + 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(); + metricUnit_ = s; + return s; + } + } + /** + * + * + *
+   * The unit in which the metric value is reported, e.g., “MByte”.
+   * 
+ * + * string metric_unit = 11; + * + * @return The bytes for metricUnit. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMetricUnitBytes() { + java.lang.Object ref = metricUnit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricUnit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_INCREASE_ELIGIBILITY_FIELD_NUMBER = 12; + private com.google.api.cloudquotas.v1.QuotaIncreaseEligibility quotaIncreaseEligibility_; + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return Whether the quotaIncreaseEligibility field is set. + */ + @java.lang.Override + public boolean hasQuotaIncreaseEligibility() { + return quotaIncreaseEligibility_ != null; + } + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return The quotaIncreaseEligibility. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibility getQuotaIncreaseEligibility() { + return quotaIncreaseEligibility_ == null + ? com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.getDefaultInstance() + : quotaIncreaseEligibility_; + } + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibilityOrBuilder + getQuotaIncreaseEligibilityOrBuilder() { + return quotaIncreaseEligibility_ == null + ? com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.getDefaultInstance() + : quotaIncreaseEligibility_; + } + + public static final int IS_FIXED_FIELD_NUMBER = 13; + private boolean isFixed_ = false; + /** + * + * + *
+   * Whether the quota value is fixed or adjustable
+   * 
+ * + * bool is_fixed = 13; + * + * @return The isFixed. + */ + @java.lang.Override + public boolean getIsFixed() { + return isFixed_; + } + + public static final int DIMENSIONS_INFOS_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private java.util.List dimensionsInfos_; + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public java.util.List getDimensionsInfosList() { + return dimensionsInfos_; + } + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public java.util.List + getDimensionsInfosOrBuilderList() { + return dimensionsInfos_; + } + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public int getDimensionsInfosCount() { + return dimensionsInfos_.size(); + } + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.DimensionsInfo getDimensionsInfos(int index) { + return dimensionsInfos_.get(index); + } + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.DimensionsInfoOrBuilder getDimensionsInfosOrBuilder( + int index) { + return dimensionsInfos_.get(index); + } + + public static final int IS_CONCURRENT_FIELD_NUMBER = 15; + private boolean isConcurrent_ = false; + /** + * + * + *
+   * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+   * on the total number of concurrent operations in flight at any given time.
+   * 
+ * + * bool is_concurrent = 15; + * + * @return The isConcurrent. + */ + @java.lang.Override + public boolean getIsConcurrent() { + return isConcurrent_; + } + + public static final int SERVICE_REQUEST_QUOTA_URI_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceRequestQuotaUri_ = ""; + /** + * + * + *
+   * URI to the page where the user can request more quotas for the cloud
+   * service, such as
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+   * Google Developers Console UI replace {email} with the current
+   * user's e-mail, {id} with the current project number, or organization ID
+   * with "organizations/" prefix. For example,
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+   * or
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+   * 
+ * + * string service_request_quota_uri = 17; + * + * @return The serviceRequestQuotaUri. + */ + @java.lang.Override + public java.lang.String getServiceRequestQuotaUri() { + java.lang.Object ref = serviceRequestQuotaUri_; + 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(); + serviceRequestQuotaUri_ = s; + return s; + } + } + /** + * + * + *
+   * URI to the page where the user can request more quotas for the cloud
+   * service, such as
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+   * Google Developers Console UI replace {email} with the current
+   * user's e-mail, {id} with the current project number, or organization ID
+   * with "organizations/" prefix. For example,
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+   * or
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+   * 
+ * + * string service_request_quota_uri = 17; + * + * @return The bytes for serviceRequestQuotaUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceRequestQuotaUriBytes() { + java.lang.Object ref = serviceRequestQuotaUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceRequestQuotaUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, quotaId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metric_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, metric_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, service_); + } + if (isPrecise_ != false) { + output.writeBool(5, isPrecise_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refreshInterval_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, refreshInterval_); + } + if (containerType_ + != com.google.api.cloudquotas.v1.QuotaInfo.ContainerType.CONTAINER_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, containerType_); + } + for (int i = 0; i < dimensions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, dimensions_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, metricDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaDisplayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, quotaDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricUnit_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, metricUnit_); + } + if (quotaIncreaseEligibility_ != null) { + output.writeMessage(12, getQuotaIncreaseEligibility()); + } + if (isFixed_ != false) { + output.writeBool(13, isFixed_); + } + for (int i = 0; i < dimensionsInfos_.size(); i++) { + output.writeMessage(14, dimensionsInfos_.get(i)); + } + if (isConcurrent_ != false) { + output.writeBool(15, isConcurrent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceRequestQuotaUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, serviceRequestQuotaUri_); + } + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, quotaId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metric_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, metric_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, service_); + } + if (isPrecise_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, isPrecise_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(refreshInterval_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, refreshInterval_); + } + if (containerType_ + != com.google.api.cloudquotas.v1.QuotaInfo.ContainerType.CONTAINER_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, containerType_); + } + { + int dataSize = 0; + for (int i = 0; i < dimensions_.size(); i++) { + dataSize += computeStringSizeNoTag(dimensions_.getRaw(i)); + } + size += dataSize; + size += 1 * getDimensionsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricDisplayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, metricDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaDisplayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, quotaDisplayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricUnit_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, metricUnit_); + } + if (quotaIncreaseEligibility_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, getQuotaIncreaseEligibility()); + } + if (isFixed_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, isFixed_); + } + for (int i = 0; i < dimensionsInfos_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, dimensionsInfos_.get(i)); + } + if (isConcurrent_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(15, isConcurrent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceRequestQuotaUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, serviceRequestQuotaUri_); + } + 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.api.cloudquotas.v1.QuotaInfo)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.QuotaInfo other = (com.google.api.cloudquotas.v1.QuotaInfo) obj; + + if (!getName().equals(other.getName())) return false; + if (!getQuotaId().equals(other.getQuotaId())) return false; + if (!getMetric().equals(other.getMetric())) return false; + if (!getService().equals(other.getService())) return false; + if (getIsPrecise() != other.getIsPrecise()) return false; + if (!getRefreshInterval().equals(other.getRefreshInterval())) return false; + if (containerType_ != other.containerType_) return false; + if (!getDimensionsList().equals(other.getDimensionsList())) return false; + if (!getMetricDisplayName().equals(other.getMetricDisplayName())) return false; + if (!getQuotaDisplayName().equals(other.getQuotaDisplayName())) return false; + if (!getMetricUnit().equals(other.getMetricUnit())) return false; + if (hasQuotaIncreaseEligibility() != other.hasQuotaIncreaseEligibility()) return false; + if (hasQuotaIncreaseEligibility()) { + if (!getQuotaIncreaseEligibility().equals(other.getQuotaIncreaseEligibility())) return false; + } + if (getIsFixed() != other.getIsFixed()) return false; + if (!getDimensionsInfosList().equals(other.getDimensionsInfosList())) return false; + if (getIsConcurrent() != other.getIsConcurrent()) return false; + if (!getServiceRequestQuotaUri().equals(other.getServiceRequestQuotaUri())) 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_ID_FIELD_NUMBER; + hash = (53 * hash) + getQuotaId().hashCode(); + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetric().hashCode(); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + IS_PRECISE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsPrecise()); + hash = (37 * hash) + REFRESH_INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getRefreshInterval().hashCode(); + hash = (37 * hash) + CONTAINER_TYPE_FIELD_NUMBER; + hash = (53 * hash) + containerType_; + if (getDimensionsCount() > 0) { + hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getDimensionsList().hashCode(); + } + hash = (37 * hash) + METRIC_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getMetricDisplayName().hashCode(); + hash = (37 * hash) + QUOTA_DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getQuotaDisplayName().hashCode(); + hash = (37 * hash) + METRIC_UNIT_FIELD_NUMBER; + hash = (53 * hash) + getMetricUnit().hashCode(); + if (hasQuotaIncreaseEligibility()) { + hash = (37 * hash) + QUOTA_INCREASE_ELIGIBILITY_FIELD_NUMBER; + hash = (53 * hash) + getQuotaIncreaseEligibility().hashCode(); + } + hash = (37 * hash) + IS_FIXED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsFixed()); + if (getDimensionsInfosCount() > 0) { + hash = (37 * hash) + DIMENSIONS_INFOS_FIELD_NUMBER; + hash = (53 * hash) + getDimensionsInfosList().hashCode(); + } + hash = (37 * hash) + IS_CONCURRENT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsConcurrent()); + hash = (37 * hash) + SERVICE_REQUEST_QUOTA_URI_FIELD_NUMBER; + hash = (53 * hash) + getServiceRequestQuotaUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.QuotaInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo 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.api.cloudquotas.v1.QuotaInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo 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.api.cloudquotas.v1.QuotaInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo 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.api.cloudquotas.v1.QuotaInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo 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.api.cloudquotas.v1.QuotaInfo 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; + } + /** + * + * + *
+   * QuotaInfo represents information about a particular quota for a given
+   * project, folder or organization.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.QuotaInfo) + com.google.api.cloudquotas.v1.QuotaInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaInfo.class, + com.google.api.cloudquotas.v1.QuotaInfo.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.QuotaInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + quotaId_ = ""; + metric_ = ""; + service_ = ""; + isPrecise_ = false; + refreshInterval_ = ""; + containerType_ = 0; + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + metricDisplayName_ = ""; + quotaDisplayName_ = ""; + metricUnit_ = ""; + quotaIncreaseEligibility_ = null; + if (quotaIncreaseEligibilityBuilder_ != null) { + quotaIncreaseEligibilityBuilder_.dispose(); + quotaIncreaseEligibilityBuilder_ = null; + } + isFixed_ = false; + if (dimensionsInfosBuilder_ == null) { + dimensionsInfos_ = java.util.Collections.emptyList(); + } else { + dimensionsInfos_ = null; + dimensionsInfosBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00002000); + isConcurrent_ = false; + serviceRequestQuotaUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaInfo_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaInfo getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.QuotaInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaInfo build() { + com.google.api.cloudquotas.v1.QuotaInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaInfo buildPartial() { + com.google.api.cloudquotas.v1.QuotaInfo result = + new com.google.api.cloudquotas.v1.QuotaInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.api.cloudquotas.v1.QuotaInfo result) { + if (dimensionsInfosBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + dimensionsInfos_ = java.util.Collections.unmodifiableList(dimensionsInfos_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.dimensionsInfos_ = dimensionsInfos_; + } else { + result.dimensionsInfos_ = dimensionsInfosBuilder_.build(); + } + } + + private void buildPartial0(com.google.api.cloudquotas.v1.QuotaInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.quotaId_ = quotaId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.metric_ = metric_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.isPrecise_ = isPrecise_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.refreshInterval_ = refreshInterval_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.containerType_ = containerType_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + dimensions_.makeImmutable(); + result.dimensions_ = dimensions_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.metricDisplayName_ = metricDisplayName_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.quotaDisplayName_ = quotaDisplayName_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.metricUnit_ = metricUnit_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.quotaIncreaseEligibility_ = + quotaIncreaseEligibilityBuilder_ == null + ? quotaIncreaseEligibility_ + : quotaIncreaseEligibilityBuilder_.build(); + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.isFixed_ = isFixed_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.isConcurrent_ = isConcurrent_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.serviceRequestQuotaUri_ = serviceRequestQuotaUri_; + } + } + + @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.api.cloudquotas.v1.QuotaInfo) { + return mergeFrom((com.google.api.cloudquotas.v1.QuotaInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.QuotaInfo other) { + if (other == com.google.api.cloudquotas.v1.QuotaInfo.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getQuotaId().isEmpty()) { + quotaId_ = other.quotaId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getMetric().isEmpty()) { + metric_ = other.metric_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getService().isEmpty()) { + service_ = other.service_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getIsPrecise() != false) { + setIsPrecise(other.getIsPrecise()); + } + if (!other.getRefreshInterval().isEmpty()) { + refreshInterval_ = other.refreshInterval_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.containerType_ != 0) { + setContainerTypeValue(other.getContainerTypeValue()); + } + if (!other.dimensions_.isEmpty()) { + if (dimensions_.isEmpty()) { + dimensions_ = other.dimensions_; + bitField0_ |= 0x00000080; + } else { + ensureDimensionsIsMutable(); + dimensions_.addAll(other.dimensions_); + } + onChanged(); + } + if (!other.getMetricDisplayName().isEmpty()) { + metricDisplayName_ = other.metricDisplayName_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (!other.getQuotaDisplayName().isEmpty()) { + quotaDisplayName_ = other.quotaDisplayName_; + bitField0_ |= 0x00000200; + onChanged(); + } + if (!other.getMetricUnit().isEmpty()) { + metricUnit_ = other.metricUnit_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (other.hasQuotaIncreaseEligibility()) { + mergeQuotaIncreaseEligibility(other.getQuotaIncreaseEligibility()); + } + if (other.getIsFixed() != false) { + setIsFixed(other.getIsFixed()); + } + if (dimensionsInfosBuilder_ == null) { + if (!other.dimensionsInfos_.isEmpty()) { + if (dimensionsInfos_.isEmpty()) { + dimensionsInfos_ = other.dimensionsInfos_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.addAll(other.dimensionsInfos_); + } + onChanged(); + } + } else { + if (!other.dimensionsInfos_.isEmpty()) { + if (dimensionsInfosBuilder_.isEmpty()) { + dimensionsInfosBuilder_.dispose(); + dimensionsInfosBuilder_ = null; + dimensionsInfos_ = other.dimensionsInfos_; + bitField0_ = (bitField0_ & ~0x00002000); + dimensionsInfosBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDimensionsInfosFieldBuilder() + : null; + } else { + dimensionsInfosBuilder_.addAllMessages(other.dimensionsInfos_); + } + } + } + if (other.getIsConcurrent() != false) { + setIsConcurrent(other.getIsConcurrent()); + } + if (!other.getServiceRequestQuotaUri().isEmpty()) { + serviceRequestQuotaUri_ = other.serviceRequestQuotaUri_; + bitField0_ |= 0x00008000; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + quotaId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + metric_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + service_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + isPrecise_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + refreshInterval_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + containerType_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDimensionsIsMutable(); + dimensions_.add(s); + break; + } // case 66 + case 74: + { + metricDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 82: + { + quotaDisplayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 82 + case 90: + { + metricUnit_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + input.readMessage( + getQuotaIncreaseEligibilityFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 98 + case 104: + { + isFixed_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: + { + com.google.api.cloudquotas.v1.DimensionsInfo m = + input.readMessage( + com.google.api.cloudquotas.v1.DimensionsInfo.parser(), extensionRegistry); + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(m); + } else { + dimensionsInfosBuilder_.addMessage(m); + } + break; + } // case 114 + case 120: + { + isConcurrent_ = input.readBool(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 138: + { + serviceRequestQuotaUri_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00008000; + break; + } // case 138 + 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_ = ""; + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of this QuotaInfo.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object quotaId_ = ""; + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @return The quotaId. + */ + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @return The bytes for quotaId. + */ + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @param value The quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearQuotaId() { + quotaId_ = getDefaultInstance().getQuotaId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The id of the quota, which is unquie within the service.
+     * Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 2; + * + * @param value The bytes for quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object metric_ = ""; + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @return The metric. + */ + public java.lang.String getMetric() { + java.lang.Object ref = metric_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metric_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @return The bytes for metric. + */ + public com.google.protobuf.ByteString getMetricBytes() { + java.lang.Object ref = metric_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metric_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @param value The metric to set. + * @return This builder for chaining. + */ + public Builder setMetric(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metric_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @return This builder for chaining. + */ + public Builder clearMetric() { + metric_ = getDefaultInstance().getMetric(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The metric of the quota. It specifies the resources consumption the quota
+     * is defined for.
+     * Example: `compute.googleapis.com/cpus`
+     * 
+ * + * string metric = 3; + * + * @param value The bytes for metric to set. + * @return This builder for chaining. + */ + public Builder setMetricBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metric_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @return This builder for chaining. + */ + public Builder clearService() { + service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the service in which the quota is defined.
+     * Example: `compute.googleapis.com`
+     * 
+ * + * string service = 4; + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + service_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean isPrecise_; + /** + * + * + *
+     * Whether this is a precise quota. A precise quota is tracked with absolute
+     * precision. In contrast, an imprecise quota is not tracked with precision.
+     * 
+ * + * bool is_precise = 5; + * + * @return The isPrecise. + */ + @java.lang.Override + public boolean getIsPrecise() { + return isPrecise_; + } + /** + * + * + *
+     * Whether this is a precise quota. A precise quota is tracked with absolute
+     * precision. In contrast, an imprecise quota is not tracked with precision.
+     * 
+ * + * bool is_precise = 5; + * + * @param value The isPrecise to set. + * @return This builder for chaining. + */ + public Builder setIsPrecise(boolean value) { + + isPrecise_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether this is a precise quota. A precise quota is tracked with absolute
+     * precision. In contrast, an imprecise quota is not tracked with precision.
+     * 
+ * + * bool is_precise = 5; + * + * @return This builder for chaining. + */ + public Builder clearIsPrecise() { + bitField0_ = (bitField0_ & ~0x00000010); + isPrecise_ = false; + onChanged(); + return this; + } + + private java.lang.Object refreshInterval_ = ""; + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @return The refreshInterval. + */ + public java.lang.String getRefreshInterval() { + java.lang.Object ref = refreshInterval_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + refreshInterval_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @return The bytes for refreshInterval. + */ + public com.google.protobuf.ByteString getRefreshIntervalBytes() { + java.lang.Object ref = refreshInterval_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + refreshInterval_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @param value The refreshInterval to set. + * @return This builder for chaining. + */ + public Builder setRefreshInterval(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + refreshInterval_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @return This builder for chaining. + */ + public Builder clearRefreshInterval() { + refreshInterval_ = getDefaultInstance().getRefreshInterval(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * The reset time interval for the quota. Refresh interval applies to rate
+     * quota only.
+     * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+     * every 10 seconds.
+     * 
+ * + * string refresh_interval = 6; + * + * @param value The bytes for refreshInterval to set. + * @return This builder for chaining. + */ + public Builder setRefreshIntervalBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + refreshInterval_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int containerType_ = 0; + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @return The enum numeric value on the wire for containerType. + */ + @java.lang.Override + public int getContainerTypeValue() { + return containerType_; + } + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @param value The enum numeric value on the wire for containerType to set. + * @return This builder for chaining. + */ + public Builder setContainerTypeValue(int value) { + containerType_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @return The containerType. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaInfo.ContainerType getContainerType() { + com.google.api.cloudquotas.v1.QuotaInfo.ContainerType result = + com.google.api.cloudquotas.v1.QuotaInfo.ContainerType.forNumber(containerType_); + return result == null + ? com.google.api.cloudquotas.v1.QuotaInfo.ContainerType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @param value The containerType to set. + * @return This builder for chaining. + */ + public Builder setContainerType(com.google.api.cloudquotas.v1.QuotaInfo.ContainerType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + containerType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The container type of the QuotaInfo.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @return This builder for chaining. + */ + public Builder clearContainerType() { + bitField0_ = (bitField0_ & ~0x00000040); + containerType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList dimensions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDimensionsIsMutable() { + if (!dimensions_.isModifiable()) { + dimensions_ = new com.google.protobuf.LazyStringArrayList(dimensions_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @return A list containing the dimensions. + */ + public com.google.protobuf.ProtocolStringList getDimensionsList() { + dimensions_.makeImmutable(); + return dimensions_; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @return The count of dimensions. + */ + public int getDimensionsCount() { + return dimensions_.size(); + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + public java.lang.String getDimensions(int index) { + return dimensions_.get(index); + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + public com.google.protobuf.ByteString getDimensionsBytes(int index) { + return dimensions_.getByteString(index); + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param index The index to set the value at. + * @param value The dimensions to set. + * @return This builder for chaining. + */ + public Builder setDimensions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsIsMutable(); + dimensions_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param value The dimensions to add. + * @return This builder for chaining. + */ + public Builder addDimensions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsIsMutable(); + dimensions_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param values The dimensions to add. + * @return This builder for chaining. + */ + public Builder addAllDimensions(java.lang.Iterable values) { + ensureDimensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dimensions_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @return This builder for chaining. + */ + public Builder clearDimensions() { + dimensions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The dimensions the quota is defined on.
+     * 
+ * + * repeated string dimensions = 8; + * + * @param value The bytes of the dimensions to add. + * @return This builder for chaining. + */ + public Builder addDimensionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDimensionsIsMutable(); + dimensions_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object metricDisplayName_ = ""; + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @return The metricDisplayName. + */ + public java.lang.String getMetricDisplayName() { + java.lang.Object ref = metricDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @return The bytes for metricDisplayName. + */ + public com.google.protobuf.ByteString getMetricDisplayNameBytes() { + java.lang.Object ref = metricDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @param value The metricDisplayName to set. + * @return This builder for chaining. + */ + public Builder setMetricDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metricDisplayName_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @return This builder for chaining. + */ + public Builder clearMetricDisplayName() { + metricDisplayName_ = getDefaultInstance().getMetricDisplayName(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the quota metric
+     * 
+ * + * string metric_display_name = 9; + * + * @param value The bytes for metricDisplayName to set. + * @return This builder for chaining. + */ + public Builder setMetricDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metricDisplayName_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.lang.Object quotaDisplayName_ = ""; + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @return The quotaDisplayName. + */ + public java.lang.String getQuotaDisplayName() { + java.lang.Object ref = quotaDisplayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaDisplayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @return The bytes for quotaDisplayName. + */ + public com.google.protobuf.ByteString getQuotaDisplayNameBytes() { + java.lang.Object ref = quotaDisplayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaDisplayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @param value The quotaDisplayName to set. + * @return This builder for chaining. + */ + public Builder setQuotaDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaDisplayName_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @return This builder for chaining. + */ + public Builder clearQuotaDisplayName() { + quotaDisplayName_ = getDefaultInstance().getQuotaDisplayName(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * The display name of the quota.
+     * 
+ * + * string quota_display_name = 10; + * + * @param value The bytes for quotaDisplayName to set. + * @return This builder for chaining. + */ + public Builder setQuotaDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaDisplayName_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + private java.lang.Object metricUnit_ = ""; + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., “MByte”.
+     * 
+ * + * string metric_unit = 11; + * + * @return The metricUnit. + */ + public java.lang.String getMetricUnit() { + java.lang.Object ref = metricUnit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + metricUnit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., “MByte”.
+     * 
+ * + * string metric_unit = 11; + * + * @return The bytes for metricUnit. + */ + public com.google.protobuf.ByteString getMetricUnitBytes() { + java.lang.Object ref = metricUnit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + metricUnit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., “MByte”.
+     * 
+ * + * string metric_unit = 11; + * + * @param value The metricUnit to set. + * @return This builder for chaining. + */ + public Builder setMetricUnit(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + metricUnit_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., “MByte”.
+     * 
+ * + * string metric_unit = 11; + * + * @return This builder for chaining. + */ + public Builder clearMetricUnit() { + metricUnit_ = getDefaultInstance().getMetricUnit(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * The unit in which the metric value is reported, e.g., “MByte”.
+     * 
+ * + * string metric_unit = 11; + * + * @param value The bytes for metricUnit to set. + * @return This builder for chaining. + */ + public Builder setMetricUnitBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + metricUnit_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private com.google.api.cloudquotas.v1.QuotaIncreaseEligibility quotaIncreaseEligibility_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility, + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.Builder, + com.google.api.cloudquotas.v1.QuotaIncreaseEligibilityOrBuilder> + quotaIncreaseEligibilityBuilder_; + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return Whether the quotaIncreaseEligibility field is set. + */ + public boolean hasQuotaIncreaseEligibility() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return The quotaIncreaseEligibility. + */ + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibility getQuotaIncreaseEligibility() { + if (quotaIncreaseEligibilityBuilder_ == null) { + return quotaIncreaseEligibility_ == null + ? com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.getDefaultInstance() + : quotaIncreaseEligibility_; + } else { + return quotaIncreaseEligibilityBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public Builder setQuotaIncreaseEligibility( + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility value) { + if (quotaIncreaseEligibilityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaIncreaseEligibility_ = value; + } else { + quotaIncreaseEligibilityBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public Builder setQuotaIncreaseEligibility( + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.Builder builderForValue) { + if (quotaIncreaseEligibilityBuilder_ == null) { + quotaIncreaseEligibility_ = builderForValue.build(); + } else { + quotaIncreaseEligibilityBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public Builder mergeQuotaIncreaseEligibility( + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility value) { + if (quotaIncreaseEligibilityBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && quotaIncreaseEligibility_ != null + && quotaIncreaseEligibility_ + != com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.getDefaultInstance()) { + getQuotaIncreaseEligibilityBuilder().mergeFrom(value); + } else { + quotaIncreaseEligibility_ = value; + } + } else { + quotaIncreaseEligibilityBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public Builder clearQuotaIncreaseEligibility() { + bitField0_ = (bitField0_ & ~0x00000800); + quotaIncreaseEligibility_ = null; + if (quotaIncreaseEligibilityBuilder_ != null) { + quotaIncreaseEligibilityBuilder_.dispose(); + quotaIncreaseEligibilityBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.Builder + getQuotaIncreaseEligibilityBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getQuotaIncreaseEligibilityFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + public com.google.api.cloudquotas.v1.QuotaIncreaseEligibilityOrBuilder + getQuotaIncreaseEligibilityOrBuilder() { + if (quotaIncreaseEligibilityBuilder_ != null) { + return quotaIncreaseEligibilityBuilder_.getMessageOrBuilder(); + } else { + return quotaIncreaseEligibility_ == null + ? com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.getDefaultInstance() + : quotaIncreaseEligibility_; + } + } + /** + * + * + *
+     * Whether it is eligible to request a higher quota value for this quota.
+     * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility, + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.Builder, + com.google.api.cloudquotas.v1.QuotaIncreaseEligibilityOrBuilder> + getQuotaIncreaseEligibilityFieldBuilder() { + if (quotaIncreaseEligibilityBuilder_ == null) { + quotaIncreaseEligibilityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility, + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility.Builder, + com.google.api.cloudquotas.v1.QuotaIncreaseEligibilityOrBuilder>( + getQuotaIncreaseEligibility(), getParentForChildren(), isClean()); + quotaIncreaseEligibility_ = null; + } + return quotaIncreaseEligibilityBuilder_; + } + + private boolean isFixed_; + /** + * + * + *
+     * Whether the quota value is fixed or adjustable
+     * 
+ * + * bool is_fixed = 13; + * + * @return The isFixed. + */ + @java.lang.Override + public boolean getIsFixed() { + return isFixed_; + } + /** + * + * + *
+     * Whether the quota value is fixed or adjustable
+     * 
+ * + * bool is_fixed = 13; + * + * @param value The isFixed to set. + * @return This builder for chaining. + */ + public Builder setIsFixed(boolean value) { + + isFixed_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the quota value is fixed or adjustable
+     * 
+ * + * bool is_fixed = 13; + * + * @return This builder for chaining. + */ + public Builder clearIsFixed() { + bitField0_ = (bitField0_ & ~0x00001000); + isFixed_ = false; + onChanged(); + return this; + } + + private java.util.List dimensionsInfos_ = + java.util.Collections.emptyList(); + + private void ensureDimensionsInfosIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + dimensionsInfos_ = + new java.util.ArrayList(dimensionsInfos_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.DimensionsInfo, + com.google.api.cloudquotas.v1.DimensionsInfo.Builder, + com.google.api.cloudquotas.v1.DimensionsInfoOrBuilder> + dimensionsInfosBuilder_; + + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public java.util.List getDimensionsInfosList() { + if (dimensionsInfosBuilder_ == null) { + return java.util.Collections.unmodifiableList(dimensionsInfos_); + } else { + return dimensionsInfosBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public int getDimensionsInfosCount() { + if (dimensionsInfosBuilder_ == null) { + return dimensionsInfos_.size(); + } else { + return dimensionsInfosBuilder_.getCount(); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1.DimensionsInfo getDimensionsInfos(int index) { + if (dimensionsInfosBuilder_ == null) { + return dimensionsInfos_.get(index); + } else { + return dimensionsInfosBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder setDimensionsInfos( + int index, com.google.api.cloudquotas.v1.DimensionsInfo value) { + if (dimensionsInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.set(index, value); + onChanged(); + } else { + dimensionsInfosBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder setDimensionsInfos( + int index, com.google.api.cloudquotas.v1.DimensionsInfo.Builder builderForValue) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.set(index, builderForValue.build()); + onChanged(); + } else { + dimensionsInfosBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder addDimensionsInfos(com.google.api.cloudquotas.v1.DimensionsInfo value) { + if (dimensionsInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(value); + onChanged(); + } else { + dimensionsInfosBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder addDimensionsInfos( + int index, com.google.api.cloudquotas.v1.DimensionsInfo value) { + if (dimensionsInfosBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(index, value); + onChanged(); + } else { + dimensionsInfosBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder addDimensionsInfos( + com.google.api.cloudquotas.v1.DimensionsInfo.Builder builderForValue) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(builderForValue.build()); + onChanged(); + } else { + dimensionsInfosBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder addDimensionsInfos( + int index, com.google.api.cloudquotas.v1.DimensionsInfo.Builder builderForValue) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.add(index, builderForValue.build()); + onChanged(); + } else { + dimensionsInfosBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder addAllDimensionsInfos( + java.lang.Iterable values) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dimensionsInfos_); + onChanged(); + } else { + dimensionsInfosBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder clearDimensionsInfos() { + if (dimensionsInfosBuilder_ == null) { + dimensionsInfos_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + dimensionsInfosBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public Builder removeDimensionsInfos(int index) { + if (dimensionsInfosBuilder_ == null) { + ensureDimensionsInfosIsMutable(); + dimensionsInfos_.remove(index); + onChanged(); + } else { + dimensionsInfosBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1.DimensionsInfo.Builder getDimensionsInfosBuilder( + int index) { + return getDimensionsInfosFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1.DimensionsInfoOrBuilder getDimensionsInfosOrBuilder( + int index) { + if (dimensionsInfosBuilder_ == null) { + return dimensionsInfos_.get(index); + } else { + return dimensionsInfosBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public java.util.List + getDimensionsInfosOrBuilderList() { + if (dimensionsInfosBuilder_ != null) { + return dimensionsInfosBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(dimensionsInfos_); + } + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1.DimensionsInfo.Builder addDimensionsInfosBuilder() { + return getDimensionsInfosFieldBuilder() + .addBuilder(com.google.api.cloudquotas.v1.DimensionsInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public com.google.api.cloudquotas.v1.DimensionsInfo.Builder addDimensionsInfosBuilder( + int index) { + return getDimensionsInfosFieldBuilder() + .addBuilder(index, com.google.api.cloudquotas.v1.DimensionsInfo.getDefaultInstance()); + } + /** + * + * + *
+     * The collection of dimensions info ordered by their dimensions from more
+     * specific ones to less specific ones.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + public java.util.List + getDimensionsInfosBuilderList() { + return getDimensionsInfosFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.DimensionsInfo, + com.google.api.cloudquotas.v1.DimensionsInfo.Builder, + com.google.api.cloudquotas.v1.DimensionsInfoOrBuilder> + getDimensionsInfosFieldBuilder() { + if (dimensionsInfosBuilder_ == null) { + dimensionsInfosBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.cloudquotas.v1.DimensionsInfo, + com.google.api.cloudquotas.v1.DimensionsInfo.Builder, + com.google.api.cloudquotas.v1.DimensionsInfoOrBuilder>( + dimensionsInfos_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + dimensionsInfos_ = null; + } + return dimensionsInfosBuilder_; + } + + private boolean isConcurrent_; + /** + * + * + *
+     * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+     * on the total number of concurrent operations in flight at any given time.
+     * 
+ * + * bool is_concurrent = 15; + * + * @return The isConcurrent. + */ + @java.lang.Override + public boolean getIsConcurrent() { + return isConcurrent_; + } + /** + * + * + *
+     * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+     * on the total number of concurrent operations in flight at any given time.
+     * 
+ * + * bool is_concurrent = 15; + * + * @param value The isConcurrent to set. + * @return This builder for chaining. + */ + public Builder setIsConcurrent(boolean value) { + + isConcurrent_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+     * on the total number of concurrent operations in flight at any given time.
+     * 
+ * + * bool is_concurrent = 15; + * + * @return This builder for chaining. + */ + public Builder clearIsConcurrent() { + bitField0_ = (bitField0_ & ~0x00004000); + isConcurrent_ = false; + onChanged(); + return this; + } + + private java.lang.Object serviceRequestQuotaUri_ = ""; + /** + * + * + *
+     * URI to the page where the user can request more quotas for the cloud
+     * service, such as
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+     * Google Developers Console UI replace {email} with the current
+     * user's e-mail, {id} with the current project number, or organization ID
+     * with "organizations/" prefix. For example,
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+     * or
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @return The serviceRequestQuotaUri. + */ + public java.lang.String getServiceRequestQuotaUri() { + java.lang.Object ref = serviceRequestQuotaUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceRequestQuotaUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URI to the page where the user can request more quotas for the cloud
+     * service, such as
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+     * Google Developers Console UI replace {email} with the current
+     * user's e-mail, {id} with the current project number, or organization ID
+     * with "organizations/" prefix. For example,
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+     * or
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @return The bytes for serviceRequestQuotaUri. + */ + public com.google.protobuf.ByteString getServiceRequestQuotaUriBytes() { + java.lang.Object ref = serviceRequestQuotaUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceRequestQuotaUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URI to the page where the user can request more quotas for the cloud
+     * service, such as
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+     * Google Developers Console UI replace {email} with the current
+     * user's e-mail, {id} with the current project number, or organization ID
+     * with "organizations/" prefix. For example,
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+     * or
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @param value The serviceRequestQuotaUri to set. + * @return This builder for chaining. + */ + public Builder setServiceRequestQuotaUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceRequestQuotaUri_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * + * + *
+     * URI to the page where the user can request more quotas for the cloud
+     * service, such as
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+     * Google Developers Console UI replace {email} with the current
+     * user's e-mail, {id} with the current project number, or organization ID
+     * with "organizations/" prefix. For example,
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+     * or
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @return This builder for chaining. + */ + public Builder clearServiceRequestQuotaUri() { + serviceRequestQuotaUri_ = getDefaultInstance().getServiceRequestQuotaUri(); + bitField0_ = (bitField0_ & ~0x00008000); + onChanged(); + return this; + } + /** + * + * + *
+     * URI to the page where the user can request more quotas for the cloud
+     * service, such as
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+     * Google Developers Console UI replace {email} with the current
+     * user's e-mail, {id} with the current project number, or organization ID
+     * with "organizations/" prefix. For example,
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+     * or
+     * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+     * 
+ * + * string service_request_quota_uri = 17; + * + * @param value The bytes for serviceRequestQuotaUri to set. + * @return This builder for chaining. + */ + public Builder setServiceRequestQuotaUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceRequestQuotaUri_ = value; + bitField0_ |= 0x00008000; + 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.api.cloudquotas.v1.QuotaInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.QuotaInfo) + private static final com.google.api.cloudquotas.v1.QuotaInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.QuotaInfo(); + } + + public static com.google.api.cloudquotas.v1.QuotaInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaInfo 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.api.cloudquotas.v1.QuotaInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfoName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfoName.java new file mode 100644 index 000000000000..6f80edc03230 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfoName.java @@ -0,0 +1,531 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 QuotaInfoName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_SERVICE_QUOTA_INFO = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}"); + private static final PathTemplate FOLDER_LOCATION_SERVICE_QUOTA_INFO = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}"); + private static final PathTemplate ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String service; + private final String quotaInfo; + private final String folder; + private final String organization; + + @Deprecated + protected QuotaInfoName() { + project = null; + location = null; + service = null; + quotaInfo = null; + folder = null; + organization = null; + } + + private QuotaInfoName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + quotaInfo = Preconditions.checkNotNull(builder.getQuotaInfo()); + folder = null; + organization = null; + pathTemplate = PROJECT_LOCATION_SERVICE_QUOTA_INFO; + } + + private QuotaInfoName(FolderLocationServiceQuotaInfoBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + quotaInfo = Preconditions.checkNotNull(builder.getQuotaInfo()); + project = null; + organization = null; + pathTemplate = FOLDER_LOCATION_SERVICE_QUOTA_INFO; + } + + private QuotaInfoName(OrganizationLocationServiceQuotaInfoBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + quotaInfo = Preconditions.checkNotNull(builder.getQuotaInfo()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getQuotaInfo() { + return quotaInfo; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationServiceQuotaInfoBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderLocationServiceQuotaInfoBuilder newFolderLocationServiceQuotaInfoBuilder() { + return new FolderLocationServiceQuotaInfoBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationLocationServiceQuotaInfoBuilder + newOrganizationLocationServiceQuotaInfoBuilder() { + return new OrganizationLocationServiceQuotaInfoBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static QuotaInfoName of( + String project, String location, String service, String quotaInfo) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static QuotaInfoName ofProjectLocationServiceQuotaInfoName( + String project, String location, String service, String quotaInfo) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static QuotaInfoName ofFolderLocationServiceQuotaInfoName( + String folder, String location, String service, String quotaInfo) { + return newFolderLocationServiceQuotaInfoBuilder() + .setFolder(folder) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static QuotaInfoName ofOrganizationLocationServiceQuotaInfoName( + String organization, String location, String service, String quotaInfo) { + return newOrganizationLocationServiceQuotaInfoBuilder() + .setOrganization(organization) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build(); + } + + public static String format(String project, String location, String service, String quotaInfo) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationServiceQuotaInfoName( + String project, String location, String service, String quotaInfo) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderLocationServiceQuotaInfoName( + String folder, String location, String service, String quotaInfo) { + return newFolderLocationServiceQuotaInfoBuilder() + .setFolder(folder) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationLocationServiceQuotaInfoName( + String organization, String location, String service, String quotaInfo) { + return newOrganizationLocationServiceQuotaInfoBuilder() + .setOrganization(organization) + .setLocation(location) + .setService(service) + .setQuotaInfo(quotaInfo) + .build() + .toString(); + } + + public static QuotaInfoName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_SERVICE_QUOTA_INFO.match(formattedString); + return ofProjectLocationServiceQuotaInfoName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("service"), + matchMap.get("quota_info")); + } else if (FOLDER_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_SERVICE_QUOTA_INFO.match(formattedString); + return ofFolderLocationServiceQuotaInfoName( + matchMap.get("folder"), + matchMap.get("location"), + matchMap.get("service"), + matchMap.get("quota_info")); + } else if (ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString)) { + Map matchMap = + ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO.match(formattedString); + return ofOrganizationLocationServiceQuotaInfoName( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("service"), + matchMap.get("quota_info")); + } + throw new ValidationException("QuotaInfoName.parse: formattedString not in valid format"); + } + + 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 (QuotaInfoName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString) + || FOLDER_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString) + || ORGANIZATION_LOCATION_SERVICE_QUOTA_INFO.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (service != null) { + fieldMapBuilder.put("service", service); + } + if (quotaInfo != null) { + fieldMapBuilder.put("quota_info", quotaInfo); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + QuotaInfoName that = ((QuotaInfoName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.service, that.service) + && Objects.equals(this.quotaInfo, that.quotaInfo) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(service); + h *= 1000003; + h ^= Objects.hashCode(quotaInfo); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}. + */ + public static class Builder { + private String project; + private String location; + private String service; + private String quotaInfo; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getQuotaInfo() { + return quotaInfo; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + public Builder setQuotaInfo(String quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + private Builder(QuotaInfoName quotaInfoName) { + Preconditions.checkArgument( + Objects.equals(quotaInfoName.pathTemplate, PROJECT_LOCATION_SERVICE_QUOTA_INFO), + "toBuilder is only supported when QuotaInfoName has the pattern of projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}"); + this.project = quotaInfoName.project; + this.location = quotaInfoName.location; + this.service = quotaInfoName.service; + this.quotaInfo = quotaInfoName.quotaInfo; + } + + public QuotaInfoName build() { + return new QuotaInfoName(this); + } + } + + /** + * Builder for folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderLocationServiceQuotaInfoBuilder { + private String folder; + private String location; + private String service; + private String quotaInfo; + + protected FolderLocationServiceQuotaInfoBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getQuotaInfo() { + return quotaInfo; + } + + public FolderLocationServiceQuotaInfoBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationServiceQuotaInfoBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationServiceQuotaInfoBuilder setService(String service) { + this.service = service; + return this; + } + + public FolderLocationServiceQuotaInfoBuilder setQuotaInfo(String quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + public QuotaInfoName build() { + return new QuotaInfoName(this); + } + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationLocationServiceQuotaInfoBuilder { + private String organization; + private String location; + private String service; + private String quotaInfo; + + protected OrganizationLocationServiceQuotaInfoBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getQuotaInfo() { + return quotaInfo; + } + + public OrganizationLocationServiceQuotaInfoBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationServiceQuotaInfoBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationServiceQuotaInfoBuilder setService(String service) { + this.service = service; + return this; + } + + public OrganizationLocationServiceQuotaInfoBuilder setQuotaInfo(String quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + public QuotaInfoName build() { + return new QuotaInfoName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfoOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfoOrBuilder.java new file mode 100644 index 000000000000..803ba50321e8 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaInfoOrBuilder.java @@ -0,0 +1,499 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +public interface QuotaInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.QuotaInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of this QuotaInfo.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Resource name of this QuotaInfo.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The id of the quota, which is unquie within the service.
+   * Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 2; + * + * @return The quotaId. + */ + java.lang.String getQuotaId(); + /** + * + * + *
+   * The id of the quota, which is unquie within the service.
+   * Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 2; + * + * @return The bytes for quotaId. + */ + com.google.protobuf.ByteString getQuotaIdBytes(); + + /** + * + * + *
+   * The metric of the quota. It specifies the resources consumption the quota
+   * is defined for.
+   * Example: `compute.googleapis.com/cpus`
+   * 
+ * + * string metric = 3; + * + * @return The metric. + */ + java.lang.String getMetric(); + /** + * + * + *
+   * The metric of the quota. It specifies the resources consumption the quota
+   * is defined for.
+   * Example: `compute.googleapis.com/cpus`
+   * 
+ * + * string metric = 3; + * + * @return The bytes for metric. + */ + com.google.protobuf.ByteString getMetricBytes(); + + /** + * + * + *
+   * The name of the service in which the quota is defined.
+   * Example: `compute.googleapis.com`
+   * 
+ * + * string service = 4; + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * The name of the service in which the quota is defined.
+   * Example: `compute.googleapis.com`
+   * 
+ * + * string service = 4; + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * Whether this is a precise quota. A precise quota is tracked with absolute
+   * precision. In contrast, an imprecise quota is not tracked with precision.
+   * 
+ * + * bool is_precise = 5; + * + * @return The isPrecise. + */ + boolean getIsPrecise(); + + /** + * + * + *
+   * The reset time interval for the quota. Refresh interval applies to rate
+   * quota only.
+   * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+   * every 10 seconds.
+   * 
+ * + * string refresh_interval = 6; + * + * @return The refreshInterval. + */ + java.lang.String getRefreshInterval(); + /** + * + * + *
+   * The reset time interval for the quota. Refresh interval applies to rate
+   * quota only.
+   * Example: “minute” for per minute, “day” for per day, or “10 seconds” for
+   * every 10 seconds.
+   * 
+ * + * string refresh_interval = 6; + * + * @return The bytes for refreshInterval. + */ + com.google.protobuf.ByteString getRefreshIntervalBytes(); + + /** + * + * + *
+   * The container type of the QuotaInfo.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @return The enum numeric value on the wire for containerType. + */ + int getContainerTypeValue(); + /** + * + * + *
+   * The container type of the QuotaInfo.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaInfo.ContainerType container_type = 7; + * + * @return The containerType. + */ + com.google.api.cloudquotas.v1.QuotaInfo.ContainerType getContainerType(); + + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @return A list containing the dimensions. + */ + java.util.List getDimensionsList(); + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @return The count of dimensions. + */ + int getDimensionsCount(); + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the element to return. + * @return The dimensions at the given index. + */ + java.lang.String getDimensions(int index); + /** + * + * + *
+   * The dimensions the quota is defined on.
+   * 
+ * + * repeated string dimensions = 8; + * + * @param index The index of the value to return. + * @return The bytes of the dimensions at the given index. + */ + com.google.protobuf.ByteString getDimensionsBytes(int index); + + /** + * + * + *
+   * The display name of the quota metric
+   * 
+ * + * string metric_display_name = 9; + * + * @return The metricDisplayName. + */ + java.lang.String getMetricDisplayName(); + /** + * + * + *
+   * The display name of the quota metric
+   * 
+ * + * string metric_display_name = 9; + * + * @return The bytes for metricDisplayName. + */ + com.google.protobuf.ByteString getMetricDisplayNameBytes(); + + /** + * + * + *
+   * The display name of the quota.
+   * 
+ * + * string quota_display_name = 10; + * + * @return The quotaDisplayName. + */ + java.lang.String getQuotaDisplayName(); + /** + * + * + *
+   * The display name of the quota.
+   * 
+ * + * string quota_display_name = 10; + * + * @return The bytes for quotaDisplayName. + */ + com.google.protobuf.ByteString getQuotaDisplayNameBytes(); + + /** + * + * + *
+   * The unit in which the metric value is reported, e.g., “MByte”.
+   * 
+ * + * string metric_unit = 11; + * + * @return The metricUnit. + */ + java.lang.String getMetricUnit(); + /** + * + * + *
+   * The unit in which the metric value is reported, e.g., “MByte”.
+   * 
+ * + * string metric_unit = 11; + * + * @return The bytes for metricUnit. + */ + com.google.protobuf.ByteString getMetricUnitBytes(); + + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return Whether the quotaIncreaseEligibility field is set. + */ + boolean hasQuotaIncreaseEligibility(); + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + * + * @return The quotaIncreaseEligibility. + */ + com.google.api.cloudquotas.v1.QuotaIncreaseEligibility getQuotaIncreaseEligibility(); + /** + * + * + *
+   * Whether it is eligible to request a higher quota value for this quota.
+   * 
+ * + * .google.api.cloudquotas.v1.QuotaIncreaseEligibility quota_increase_eligibility = 12; + * + */ + com.google.api.cloudquotas.v1.QuotaIncreaseEligibilityOrBuilder + getQuotaIncreaseEligibilityOrBuilder(); + + /** + * + * + *
+   * Whether the quota value is fixed or adjustable
+   * 
+ * + * bool is_fixed = 13; + * + * @return The isFixed. + */ + boolean getIsFixed(); + + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + java.util.List getDimensionsInfosList(); + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + com.google.api.cloudquotas.v1.DimensionsInfo getDimensionsInfos(int index); + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + int getDimensionsInfosCount(); + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + java.util.List + getDimensionsInfosOrBuilderList(); + /** + * + * + *
+   * The collection of dimensions info ordered by their dimensions from more
+   * specific ones to less specific ones.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.DimensionsInfo dimensions_infos = 14; + */ + com.google.api.cloudquotas.v1.DimensionsInfoOrBuilder getDimensionsInfosOrBuilder(int index); + + /** + * + * + *
+   * Whether the quota is a concurrent quota. Concurrent quotas are enforced
+   * on the total number of concurrent operations in flight at any given time.
+   * 
+ * + * bool is_concurrent = 15; + * + * @return The isConcurrent. + */ + boolean getIsConcurrent(); + + /** + * + * + *
+   * URI to the page where the user can request more quotas for the cloud
+   * service, such as
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+   * Google Developers Console UI replace {email} with the current
+   * user's e-mail, {id} with the current project number, or organization ID
+   * with "organizations/" prefix. For example,
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+   * or
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+   * 
+ * + * string service_request_quota_uri = 17; + * + * @return The serviceRequestQuotaUri. + */ + java.lang.String getServiceRequestQuotaUri(); + /** + * + * + *
+   * URI to the page where the user can request more quotas for the cloud
+   * service, such as
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}.
+   * Google Developers Console UI replace {email} with the current
+   * user's e-mail, {id} with the current project number, or organization ID
+   * with "organizations/" prefix. For example,
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754,
+   * or
+   * https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422.
+   * 
+ * + * string service_request_quota_uri = 17; + * + * @return The bytes for serviceRequestQuotaUri. + */ + com.google.protobuf.ByteString getServiceRequestQuotaUriBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreference.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreference.java new file mode 100644 index 000000000000..2e4099d974bb --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreference.java @@ -0,0 +1,2834 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * QuotaPreference represents the preferred quota configuration specified for
+ * a project, folder or organization. There is only one QuotaPreference
+ * resource for a quota value targeting a unique set of dimensions.
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaPreference} + */ +public final class QuotaPreference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.QuotaPreference) + QuotaPreferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use QuotaPreference.newBuilder() to construct. + private QuotaPreference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QuotaPreference() { + name_ = ""; + etag_ = ""; + service_ = ""; + quotaId_ = ""; + justification_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QuotaPreference(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaPreference_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaPreference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaPreference.class, + com.google.api.cloudquotas.v1.QuotaPreference.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required except in the CREATE requests.
+   * The resource name of the quota preference.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required except in the CREATE requests.
+   * The resource name of the quota preference.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIMENSIONS_FIELD_NUMBER = 2; + + private static final class DimensionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaPreference_DimensionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField dimensions_; + + private com.google.protobuf.MapField internalGetDimensions() { + if (dimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField(DimensionsDefaultEntryHolder.defaultEntry); + } + return dimensions_; + } + + public int getDimensionsCount() { + return internalGetDimensions().getMap().size(); + } + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + @java.lang.Override + public boolean containsDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDimensions().getMap().containsKey(key); + } + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDimensions() { + return getDimensionsMap(); + } + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + @java.lang.Override + public java.util.Map getDimensionsMap() { + return internalGetDimensions().getMap(); + } + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + @java.lang.Override + public java.lang.String getDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int QUOTA_CONFIG_FIELD_NUMBER = 3; + private com.google.api.cloudquotas.v1.QuotaConfig quotaConfig_; + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaConfig field is set. + */ + @java.lang.Override + public boolean hasQuotaConfig() { + return quotaConfig_ != null; + } + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaConfig. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaConfig getQuotaConfig() { + return quotaConfig_ == null + ? com.google.api.cloudquotas.v1.QuotaConfig.getDefaultInstance() + : quotaConfig_; + } + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaConfigOrBuilder getQuotaConfigOrBuilder() { + return quotaConfig_ == null + ? com.google.api.cloudquotas.v1.QuotaConfig.getDefaultInstance() + : quotaConfig_; + } + + public static final int ETAG_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. The current etag of the quota preference. If an etag is provided
+   * on update and does not match the current server's etag of the quota
+   * preference, the request will be blocked and an ABORTED error will be
+   * returned. See https://google.aip.dev/134#etags for more details on etags.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The current etag of the quota preference. If an etag is provided
+   * on update and does not match the current server's etag of the quota
+   * preference, the request will be blocked and an ABORTED error will be
+   * returned. See https://google.aip.dev/134#etags for more details on etags.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int SERVICE_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object service_ = ""; + /** + * + * + *
+   * Required. The name of the service to which the quota preference is applied.
+   * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + 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(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the service to which the quota preference is applied.
+   * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUOTA_ID_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object quotaId_ = ""; + /** + * + * + *
+   * Required. The id of the quota to which the quota preference is applied. A
+   * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The quotaId. + */ + @java.lang.Override + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + 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(); + quotaId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The id of the quota to which the quota preference is applied. A
+   * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for quotaId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECONCILING_FIELD_NUMBER = 10; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Is the quota preference pending GCP approval and fulfillment.
+   * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int JUSTIFICATION_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object justification_ = ""; + /** + * + * + *
+   * The reason / justification for this quota preference.
+   * 
+ * + * string justification = 11; + * + * @return The justification. + */ + @java.lang.Override + public java.lang.String getJustification() { + java.lang.Object ref = justification_; + 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(); + justification_ = s; + return s; + } + } + /** + * + * + *
+   * The reason / justification for this quota preference.
+   * 
+ * + * string justification = 11; + * + * @return The bytes for justification. + */ + @java.lang.Override + public com.google.protobuf.ByteString getJustificationBytes() { + java.lang.Object ref = justification_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + justification_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetDimensions(), DimensionsDefaultEntryHolder.defaultEntry, 2); + if (quotaConfig_ != null) { + output.writeMessage(3, getQuotaConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, etag_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, quotaId_); + } + if (reconciling_ != false) { + output.writeBool(10, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(justification_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, justification_); + } + 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_); + } + for (java.util.Map.Entry entry : + internalGetDimensions().getMap().entrySet()) { + com.google.protobuf.MapEntry dimensions__ = + DimensionsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, dimensions__); + } + if (quotaConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQuotaConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, etag_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, service_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(quotaId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, quotaId_); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(justification_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, justification_); + } + 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.api.cloudquotas.v1.QuotaPreference)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.QuotaPreference other = + (com.google.api.cloudquotas.v1.QuotaPreference) obj; + + if (!getName().equals(other.getName())) return false; + if (!internalGetDimensions().equals(other.internalGetDimensions())) return false; + if (hasQuotaConfig() != other.hasQuotaConfig()) return false; + if (hasQuotaConfig()) { + if (!getQuotaConfig().equals(other.getQuotaConfig())) return false; + } + if (!getEtag().equals(other.getEtag())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getService().equals(other.getService())) return false; + if (!getQuotaId().equals(other.getQuotaId())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!getJustification().equals(other.getJustification())) 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(); + if (!internalGetDimensions().getMap().isEmpty()) { + hash = (37 * hash) + DIMENSIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetDimensions().hashCode(); + } + if (hasQuotaConfig()) { + hash = (37 * hash) + QUOTA_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getQuotaConfig().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + QUOTA_ID_FIELD_NUMBER; + hash = (53 * hash) + getQuotaId().hashCode(); + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + hash = (37 * hash) + JUSTIFICATION_FIELD_NUMBER; + hash = (53 * hash) + getJustification().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.QuotaPreference parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference 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.api.cloudquotas.v1.QuotaPreference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference 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.api.cloudquotas.v1.QuotaPreference parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference 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.api.cloudquotas.v1.QuotaPreference parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference 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.api.cloudquotas.v1.QuotaPreference 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; + } + /** + * + * + *
+   * QuotaPreference represents the preferred quota configuration specified for
+   * a project, folder or organization. There is only one QuotaPreference
+   * resource for a quota value targeting a unique set of dimensions.
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.QuotaPreference} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.QuotaPreference) + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaPreference_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableDimensions(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaPreference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.QuotaPreference.class, + com.google.api.cloudquotas.v1.QuotaPreference.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.QuotaPreference.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + internalGetMutableDimensions().clear(); + quotaConfig_ = null; + if (quotaConfigBuilder_ != null) { + quotaConfigBuilder_.dispose(); + quotaConfigBuilder_ = null; + } + etag_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + service_ = ""; + quotaId_ = ""; + reconciling_ = false; + justification_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.ResourcesProto + .internal_static_google_api_cloudquotas_v1_QuotaPreference_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreference getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreference build() { + com.google.api.cloudquotas.v1.QuotaPreference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreference buildPartial() { + com.google.api.cloudquotas.v1.QuotaPreference result = + new com.google.api.cloudquotas.v1.QuotaPreference(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.QuotaPreference result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.dimensions_ = internalGetDimensions(); + result.dimensions_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.quotaConfig_ = + quotaConfigBuilder_ == null ? quotaConfig_ : quotaConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.service_ = service_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.quotaId_ = quotaId_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.justification_ = justification_; + } + } + + @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.api.cloudquotas.v1.QuotaPreference) { + return mergeFrom((com.google.api.cloudquotas.v1.QuotaPreference) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.QuotaPreference other) { + if (other == com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableDimensions().mergeFrom(other.internalGetDimensions()); + bitField0_ |= 0x00000002; + if (other.hasQuotaConfig()) { + mergeQuotaConfig(other.getQuotaConfig()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getService().isEmpty()) { + service_ = other.service_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getQuotaId().isEmpty()) { + quotaId_ = other.quotaId_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (!other.getJustification().isEmpty()) { + justification_ = other.justification_; + bitField0_ |= 0x00000200; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry dimensions__ = + input.readMessage( + DimensionsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableDimensions() + .getMutableMap() + .put(dimensions__.getKey(), dimensions__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getQuotaConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + service_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + quotaId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 80: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 80 + case 90: + { + justification_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000200; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required except in the CREATE requests.
+     * The resource name of the quota preference.
+     * The ID component following "locations/" must be "global".
+     * Example:
+     * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.MapField dimensions_; + + private com.google.protobuf.MapField + internalGetDimensions() { + if (dimensions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + DimensionsDefaultEntryHolder.defaultEntry); + } + return dimensions_; + } + + private com.google.protobuf.MapField + internalGetMutableDimensions() { + if (dimensions_ == null) { + dimensions_ = + com.google.protobuf.MapField.newMapField(DimensionsDefaultEntryHolder.defaultEntry); + } + if (!dimensions_.isMutable()) { + dimensions_ = dimensions_.copy(); + } + bitField0_ |= 0x00000002; + onChanged(); + return dimensions_; + } + + public int getDimensionsCount() { + return internalGetDimensions().getMap().size(); + } + /** + * + * + *
+     * The dimensions that this quota preference applies to. The key of the map
+     * entry is the name of a dimension, such as "region", "zone", “network_id”,
+     * and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2; + */ + @java.lang.Override + public boolean containsDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetDimensions().getMap().containsKey(key); + } + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getDimensions() { + return getDimensionsMap(); + } + /** + * + * + *
+     * The dimensions that this quota preference applies to. The key of the map
+     * entry is the name of a dimension, such as "region", "zone", “network_id”,
+     * and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2; + */ + @java.lang.Override + public java.util.Map getDimensionsMap() { + return internalGetDimensions().getMap(); + } + /** + * + * + *
+     * The dimensions that this quota preference applies to. The key of the map
+     * entry is the name of a dimension, such as "region", "zone", “network_id”,
+     * and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2; + */ + @java.lang.Override + public /* nullable */ java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * The dimensions that this quota preference applies to. The key of the map
+     * entry is the name of a dimension, such as "region", "zone", “network_id”,
+     * and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2; + */ + @java.lang.Override + public java.lang.String getDimensionsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetDimensions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearDimensions() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableDimensions().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * The dimensions that this quota preference applies to. The key of the map
+     * entry is the name of a dimension, such as "region", "zone", “network_id”,
+     * and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2; + */ + public Builder removeDimensions(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableDimensions().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableDimensions() { + bitField0_ |= 0x00000002; + return internalGetMutableDimensions().getMutableMap(); + } + /** + * + * + *
+     * The dimensions that this quota preference applies to. The key of the map
+     * entry is the name of a dimension, such as "region", "zone", “network_id”,
+     * and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2; + */ + public Builder putDimensions(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableDimensions().getMutableMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
+     * The dimensions that this quota preference applies to. The key of the map
+     * entry is the name of a dimension, such as "region", "zone", “network_id”,
+     * and the value of the map entry is the dimension value.
+     *
+     * If a dimension is missing from the map of dimensions, the quota preference
+     * applies to all the dimension values except for those that have other quota
+     * preferences configured for the specific value.
+     *
+     * NOTE: QuotaPreferences can only be applied across all values of "user" and
+     * "resource" dimension. Do not set values for "user" or "resource" in the
+     * dimension map.
+     *
+     * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+     * dimension.
+     * 
+ * + * map<string, string> dimensions = 2; + */ + public Builder putAllDimensions(java.util.Map values) { + internalGetMutableDimensions().getMutableMap().putAll(values); + bitField0_ |= 0x00000002; + return this; + } + + private com.google.api.cloudquotas.v1.QuotaConfig quotaConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaConfig, + com.google.api.cloudquotas.v1.QuotaConfig.Builder, + com.google.api.cloudquotas.v1.QuotaConfigOrBuilder> + quotaConfigBuilder_; + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaConfig field is set. + */ + public boolean hasQuotaConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaConfig. + */ + public com.google.api.cloudquotas.v1.QuotaConfig getQuotaConfig() { + if (quotaConfigBuilder_ == null) { + return quotaConfig_ == null + ? com.google.api.cloudquotas.v1.QuotaConfig.getDefaultInstance() + : quotaConfig_; + } else { + return quotaConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaConfig(com.google.api.cloudquotas.v1.QuotaConfig value) { + if (quotaConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaConfig_ = value; + } else { + quotaConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaConfig( + com.google.api.cloudquotas.v1.QuotaConfig.Builder builderForValue) { + if (quotaConfigBuilder_ == null) { + quotaConfig_ = builderForValue.build(); + } else { + quotaConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuotaConfig(com.google.api.cloudquotas.v1.QuotaConfig value) { + if (quotaConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && quotaConfig_ != null + && quotaConfig_ != com.google.api.cloudquotas.v1.QuotaConfig.getDefaultInstance()) { + getQuotaConfigBuilder().mergeFrom(value); + } else { + quotaConfig_ = value; + } + } else { + quotaConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuotaConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + quotaConfig_ = null; + if (quotaConfigBuilder_ != null) { + quotaConfigBuilder_.dispose(); + quotaConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1.QuotaConfig.Builder getQuotaConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getQuotaConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1.QuotaConfigOrBuilder getQuotaConfigOrBuilder() { + if (quotaConfigBuilder_ != null) { + return quotaConfigBuilder_.getMessageOrBuilder(); + } else { + return quotaConfig_ == null + ? com.google.api.cloudquotas.v1.QuotaConfig.getDefaultInstance() + : quotaConfig_; + } + } + /** + * + * + *
+     * Required. Preferred quota configuration.
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaConfig, + com.google.api.cloudquotas.v1.QuotaConfig.Builder, + com.google.api.cloudquotas.v1.QuotaConfigOrBuilder> + getQuotaConfigFieldBuilder() { + if (quotaConfigBuilder_ == null) { + quotaConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaConfig, + com.google.api.cloudquotas.v1.QuotaConfig.Builder, + com.google.api.cloudquotas.v1.QuotaConfigOrBuilder>( + getQuotaConfig(), getParentForChildren(), isClean()); + quotaConfig_ = null; + } + return quotaConfigBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The current etag of the quota preference. If an etag is provided
+     * on update and does not match the current server's etag of the quota
+     * preference, the request will be blocked and an ABORTED error will be
+     * returned. See https://google.aip.dev/134#etags for more details on etags.
+     * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Create time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Update time stamp
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + service_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearService() { + service_ = getDefaultInstance().getService(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the service to which the quota preference is applied.
+     * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + service_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object quotaId_ = ""; + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The quotaId. + */ + public java.lang.String getQuotaId() { + java.lang.Object ref = quotaId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + quotaId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for quotaId. + */ + public com.google.protobuf.ByteString getQuotaIdBytes() { + java.lang.Object ref = quotaId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + quotaId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + quotaId_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuotaId() { + quotaId_ = getDefaultInstance().getQuotaId(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The id of the quota to which the quota preference is applied. A
+     * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+     * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for quotaId to set. + * @return This builder for chaining. + */ + public Builder setQuotaIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + quotaId_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Is the quota preference pending GCP approval and fulfillment.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Is the quota preference pending GCP approval and fulfillment.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Is the quota preference pending GCP approval and fulfillment.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000100); + reconciling_ = false; + onChanged(); + return this; + } + + private java.lang.Object justification_ = ""; + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @return The justification. + */ + public java.lang.String getJustification() { + java.lang.Object ref = justification_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + justification_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @return The bytes for justification. + */ + public com.google.protobuf.ByteString getJustificationBytes() { + java.lang.Object ref = justification_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + justification_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @param value The justification to set. + * @return This builder for chaining. + */ + public Builder setJustification(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + justification_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @return This builder for chaining. + */ + public Builder clearJustification() { + justification_ = getDefaultInstance().getJustification(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + return this; + } + /** + * + * + *
+     * The reason / justification for this quota preference.
+     * 
+ * + * string justification = 11; + * + * @param value The bytes for justification to set. + * @return This builder for chaining. + */ + public Builder setJustificationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + justification_ = value; + bitField0_ |= 0x00000200; + 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.api.cloudquotas.v1.QuotaPreference) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.QuotaPreference) + private static final com.google.api.cloudquotas.v1.QuotaPreference DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.QuotaPreference(); + } + + public static com.google.api.cloudquotas.v1.QuotaPreference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaPreference 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.api.cloudquotas.v1.QuotaPreference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreferenceName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreferenceName.java new file mode 100644 index 000000000000..9d82d7b8abd1 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreferenceName.java @@ -0,0 +1,462 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 QuotaPreferenceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_QUOTA_PREFERENCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/quotaPreferences/{quota_preference}"); + private static final PathTemplate FOLDER_LOCATION_QUOTA_PREFERENCE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}"); + private static final PathTemplate ORGANIZATION_LOCATION_QUOTA_PREFERENCE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String quotaPreference; + private final String folder; + private final String organization; + + @Deprecated + protected QuotaPreferenceName() { + project = null; + location = null; + quotaPreference = null; + folder = null; + organization = null; + } + + private QuotaPreferenceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + quotaPreference = Preconditions.checkNotNull(builder.getQuotaPreference()); + folder = null; + organization = null; + pathTemplate = PROJECT_LOCATION_QUOTA_PREFERENCE; + } + + private QuotaPreferenceName(FolderLocationQuotaPreferenceBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + quotaPreference = Preconditions.checkNotNull(builder.getQuotaPreference()); + project = null; + organization = null; + pathTemplate = FOLDER_LOCATION_QUOTA_PREFERENCE; + } + + private QuotaPreferenceName(OrganizationLocationQuotaPreferenceBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + quotaPreference = Preconditions.checkNotNull(builder.getQuotaPreference()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_LOCATION_QUOTA_PREFERENCE; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getQuotaPreference() { + return quotaPreference; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationQuotaPreferenceBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderLocationQuotaPreferenceBuilder newFolderLocationQuotaPreferenceBuilder() { + return new FolderLocationQuotaPreferenceBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationLocationQuotaPreferenceBuilder + newOrganizationLocationQuotaPreferenceBuilder() { + return new OrganizationLocationQuotaPreferenceBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static QuotaPreferenceName of(String project, String location, String quotaPreference) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static QuotaPreferenceName ofProjectLocationQuotaPreferenceName( + String project, String location, String quotaPreference) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static QuotaPreferenceName ofFolderLocationQuotaPreferenceName( + String folder, String location, String quotaPreference) { + return newFolderLocationQuotaPreferenceBuilder() + .setFolder(folder) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static QuotaPreferenceName ofOrganizationLocationQuotaPreferenceName( + String organization, String location, String quotaPreference) { + return newOrganizationLocationQuotaPreferenceBuilder() + .setOrganization(organization) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build(); + } + + public static String format(String project, String location, String quotaPreference) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationQuotaPreferenceName( + String project, String location, String quotaPreference) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderLocationQuotaPreferenceName( + String folder, String location, String quotaPreference) { + return newFolderLocationQuotaPreferenceBuilder() + .setFolder(folder) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationLocationQuotaPreferenceName( + String organization, String location, String quotaPreference) { + return newOrganizationLocationQuotaPreferenceBuilder() + .setOrganization(organization) + .setLocation(location) + .setQuotaPreference(quotaPreference) + .build() + .toString(); + } + + public static QuotaPreferenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_QUOTA_PREFERENCE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_QUOTA_PREFERENCE.match(formattedString); + return ofProjectLocationQuotaPreferenceName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("quota_preference")); + } else if (FOLDER_LOCATION_QUOTA_PREFERENCE.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_QUOTA_PREFERENCE.match(formattedString); + return ofFolderLocationQuotaPreferenceName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("quota_preference")); + } else if (ORGANIZATION_LOCATION_QUOTA_PREFERENCE.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_QUOTA_PREFERENCE.match(formattedString); + return ofOrganizationLocationQuotaPreferenceName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("quota_preference")); + } + throw new ValidationException("QuotaPreferenceName.parse: formattedString not in valid format"); + } + + 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 (QuotaPreferenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_QUOTA_PREFERENCE.matches(formattedString) + || FOLDER_LOCATION_QUOTA_PREFERENCE.matches(formattedString) + || ORGANIZATION_LOCATION_QUOTA_PREFERENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (quotaPreference != null) { + fieldMapBuilder.put("quota_preference", quotaPreference); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + QuotaPreferenceName that = ((QuotaPreferenceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.quotaPreference, that.quotaPreference) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(quotaPreference); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for projects/{project}/locations/{location}/quotaPreferences/{quota_preference}. */ + public static class Builder { + private String project; + private String location; + private String quotaPreference; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getQuotaPreference() { + return quotaPreference; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setQuotaPreference(String quotaPreference) { + this.quotaPreference = quotaPreference; + return this; + } + + private Builder(QuotaPreferenceName quotaPreferenceName) { + Preconditions.checkArgument( + Objects.equals(quotaPreferenceName.pathTemplate, PROJECT_LOCATION_QUOTA_PREFERENCE), + "toBuilder is only supported when QuotaPreferenceName has the pattern of projects/{project}/locations/{location}/quotaPreferences/{quota_preference}"); + this.project = quotaPreferenceName.project; + this.location = quotaPreferenceName.location; + this.quotaPreference = quotaPreferenceName.quotaPreference; + } + + public QuotaPreferenceName build() { + return new QuotaPreferenceName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderLocationQuotaPreferenceBuilder { + private String folder; + private String location; + private String quotaPreference; + + protected FolderLocationQuotaPreferenceBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getQuotaPreference() { + return quotaPreference; + } + + public FolderLocationQuotaPreferenceBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationQuotaPreferenceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationQuotaPreferenceBuilder setQuotaPreference(String quotaPreference) { + this.quotaPreference = quotaPreference; + return this; + } + + public QuotaPreferenceName build() { + return new QuotaPreferenceName(this); + } + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationLocationQuotaPreferenceBuilder { + private String organization; + private String location; + private String quotaPreference; + + protected OrganizationLocationQuotaPreferenceBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getQuotaPreference() { + return quotaPreference; + } + + public OrganizationLocationQuotaPreferenceBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationQuotaPreferenceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationQuotaPreferenceBuilder setQuotaPreference(String quotaPreference) { + this.quotaPreference = quotaPreference; + return this; + } + + public QuotaPreferenceName build() { + return new QuotaPreferenceName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreferenceOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreferenceOrBuilder.java new file mode 100644 index 000000000000..9ab52b4a23b7 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaPreferenceOrBuilder.java @@ -0,0 +1,419 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +public interface QuotaPreferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.QuotaPreference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required except in the CREATE requests.
+   * The resource name of the quota preference.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required except in the CREATE requests.
+   * The resource name of the quota preference.
+   * The ID component following "locations/" must be "global".
+   * Example:
+   * `projects/123/locations/global/quotaPreferences/my-config-for-us-east1`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + int getDimensionsCount(); + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + boolean containsDimensions(java.lang.String key); + /** Use {@link #getDimensionsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getDimensions(); + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + java.util.Map getDimensionsMap(); + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + /* nullable */ + java.lang.String getDimensionsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * The dimensions that this quota preference applies to. The key of the map
+   * entry is the name of a dimension, such as "region", "zone", “network_id”,
+   * and the value of the map entry is the dimension value.
+   *
+   * If a dimension is missing from the map of dimensions, the quota preference
+   * applies to all the dimension values except for those that have other quota
+   * preferences configured for the specific value.
+   *
+   * NOTE: QuotaPreferences can only be applied across all values of "user" and
+   * "resource" dimension. Do not set values for "user" or "resource" in the
+   * dimension map.
+   *
+   * Example: {"provider", "Foo Inc"} where "provider" is a service specific
+   * dimension.
+   * 
+ * + * map<string, string> dimensions = 2; + */ + java.lang.String getDimensionsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaConfig field is set. + */ + boolean hasQuotaConfig(); + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaConfig. + */ + com.google.api.cloudquotas.v1.QuotaConfig getQuotaConfig(); + /** + * + * + *
+   * Required. Preferred quota configuration.
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaConfig quota_config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.api.cloudquotas.v1.QuotaConfigOrBuilder getQuotaConfigOrBuilder(); + + /** + * + * + *
+   * Optional. The current etag of the quota preference. If an etag is provided
+   * on update and does not match the current server's etag of the quota
+   * preference, the request will be blocked and an ABORTED error will be
+   * returned. See https://google.aip.dev/134#etags for more details on etags.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. The current etag of the quota preference. If an etag is provided
+   * on update and does not match the current server's etag of the quota
+   * preference, the request will be blocked and an ABORTED error will be
+   * returned. See https://google.aip.dev/134#etags for more details on etags.
+   * 
+ * + * string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Create time stamp
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Update time stamp
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Required. The name of the service to which the quota preference is applied.
+   * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * Required. The name of the service to which the quota preference is applied.
+   * 
+ * + * string service = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * Required. The id of the quota to which the quota preference is applied. A
+   * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The quotaId. + */ + java.lang.String getQuotaId(); + /** + * + * + *
+   * Required. The id of the quota to which the quota preference is applied. A
+   * quota name is unique in the service. Example: `CpusPerProjectPerRegion`
+   * 
+ * + * string quota_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for quotaId. + */ + com.google.protobuf.ByteString getQuotaIdBytes(); + + /** + * + * + *
+   * Output only. Is the quota preference pending GCP approval and fulfillment.
+   * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * The reason / justification for this quota preference.
+   * 
+ * + * string justification = 11; + * + * @return The justification. + */ + java.lang.String getJustification(); + /** + * + * + *
+   * The reason / justification for this quota preference.
+   * 
+ * + * string justification = 11; + * + * @return The bytes for justification. + */ + com.google.protobuf.ByteString getJustificationBytes(); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaSafetyCheck.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaSafetyCheck.java new file mode 100644 index 000000000000..74144f682dfb --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/QuotaSafetyCheck.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Enumerations of quota safety checks.
+ * 
+ * + * Protobuf enum {@code google.api.cloudquotas.v1.QuotaSafetyCheck} + */ +public enum QuotaSafetyCheck implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified quota safety check.
+   * 
+ * + * QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + */ + QUOTA_SAFETY_CHECK_UNSPECIFIED(0), + /** + * + * + *
+   * Validates that a quota mutation would not cause the consumer's effective
+   * limit to be lower than the consumer's quota usage.
+   * 
+ * + * LIMIT_DECREASE_BELOW_USAGE = 1; + */ + LIMIT_DECREASE_BELOW_USAGE(1), + /** + * + * + *
+   * Validates that a quota mutation would not cause the consumer's effective
+   * limit to decrease by more than 10 percent.
+   * 
+ * + * LIMIT_DECREASE_PERCENTAGE_TOO_HIGH = 2; + */ + LIMIT_DECREASE_PERCENTAGE_TOO_HIGH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified quota safety check.
+   * 
+ * + * QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + */ + public static final int QUOTA_SAFETY_CHECK_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Validates that a quota mutation would not cause the consumer's effective
+   * limit to be lower than the consumer's quota usage.
+   * 
+ * + * LIMIT_DECREASE_BELOW_USAGE = 1; + */ + public static final int LIMIT_DECREASE_BELOW_USAGE_VALUE = 1; + /** + * + * + *
+   * Validates that a quota mutation would not cause the consumer's effective
+   * limit to decrease by more than 10 percent.
+   * 
+ * + * LIMIT_DECREASE_PERCENTAGE_TOO_HIGH = 2; + */ + public static final int LIMIT_DECREASE_PERCENTAGE_TOO_HIGH_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static QuotaSafetyCheck valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static QuotaSafetyCheck forNumber(int value) { + switch (value) { + case 0: + return QUOTA_SAFETY_CHECK_UNSPECIFIED; + case 1: + return LIMIT_DECREASE_BELOW_USAGE; + case 2: + return LIMIT_DECREASE_PERCENTAGE_TOO_HIGH; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public QuotaSafetyCheck findValueByNumber(int number) { + return QuotaSafetyCheck.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.cloudquotas.v1.ResourcesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final QuotaSafetyCheck[] VALUES = values(); + + public static QuotaSafetyCheck valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private QuotaSafetyCheck(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.cloudquotas.v1.QuotaSafetyCheck) +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ResourcesProto.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ResourcesProto.java new file mode 100644 index 000000000000..eab8648ad83e --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ResourcesProto.java @@ -0,0 +1,281 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/resources.proto + +package com.google.api.cloudquotas.v1; + +public final class ResourcesProto { + private ResourcesProto() {} + + 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_api_cloudquotas_v1_QuotaInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_QuotaInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_QuotaPreference_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_QuotaPreference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_QuotaPreference_DimensionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_QuotaPreference_DimensionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_QuotaConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_QuotaConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_QuotaConfig_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_QuotaConfig_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_DimensionsInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_DimensionsInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_DimensionsInfo_DimensionsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_DimensionsInfo_DimensionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_cloudquotas_v1_QuotaDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_cloudquotas_v1_QuotaDetails_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/api/cloudquotas/v1/resources.pr" + + "oto\022\031google.api.cloudquotas.v1\032\037google/a" + + "pi/field_behavior.proto\032\031google/api/reso" + + "urce.proto\032\037google/protobuf/timestamp.pr" + + "oto\032\036google/protobuf/wrappers.proto\"\237\007\n\t" + + "QuotaInfo\022\014\n\004name\030\001 \001(\t\022\020\n\010quota_id\030\002 \001(" + + "\t\022\016\n\006metric\030\003 \001(\t\022\017\n\007service\030\004 \001(\t\022\022\n\nis" + + "_precise\030\005 \001(\010\022\030\n\020refresh_interval\030\006 \001(\t" + + "\022J\n\016container_type\030\007 \001(\01622.google.api.cl" + + "oudquotas.v1.QuotaInfo.ContainerType\022\022\n\n" + + "dimensions\030\010 \003(\t\022\033\n\023metric_display_name\030" + + "\t \001(\t\022\032\n\022quota_display_name\030\n \001(\t\022\023\n\013met" + + "ric_unit\030\013 \001(\t\022W\n\032quota_increase_eligibi" + + "lity\030\014 \001(\01323.google.api.cloudquotas.v1.Q" + + "uotaIncreaseEligibility\022\020\n\010is_fixed\030\r \001(" + + "\010\022C\n\020dimensions_infos\030\016 \003(\0132).google.api" + + ".cloudquotas.v1.DimensionsInfo\022\025\n\ris_con" + + "current\030\017 \001(\010\022!\n\031service_request_quota_u" + + "ri\030\021 \001(\t\"Z\n\rContainerType\022\036\n\032CONTAINER_T" + + "YPE_UNSPECIFIED\020\000\022\013\n\007PROJECT\020\001\022\n\n\006FOLDER" + + "\020\002\022\020\n\014ORGANIZATION\020\003:\256\002\352A\252\002\n$cloudquotas" + + ".googleapis.com/QuotaInfo\022Rprojects/{pro" + + "ject}/locations/{location}/services/{ser" + + "vice}/quotaInfos/{quota_info}\022Pfolders/{" + + "folder}/locations/{location}/services/{s" + + "ervice}/quotaInfos/{quota_info}\022\\organiz" + + "ations/{organization}/locations/{locatio" + + "n}/services/{service}/quotaInfos/{quota_" + + "info}\"\366\001\n\030QuotaIncreaseEligibility\022\023\n\013is" + + "_eligible\030\001 \001(\010\022e\n\024ineligibility_reason\030" + + "\002 \001(\0162G.google.api.cloudquotas.v1.QuotaI" + + "ncreaseEligibility.IneligibilityReason\"^" + + "\n\023IneligibilityReason\022$\n INELIGIBILITY_R" + + "EASON_UNSPECIFIED\020\000\022\026\n\022NO_BILLING_ACCOUN" + + "T\020\002\022\t\n\005OTHER\020\003\"\353\005\n\017QuotaPreference\022\014\n\004na" + + "me\030\001 \001(\t\022N\n\ndimensions\030\002 \003(\0132:.google.ap" + + "i.cloudquotas.v1.QuotaPreference.Dimensi" + + "onsEntry\022B\n\014quota_config\030\003 \001(\0132&.google." + + "api.cloudquotas.v1.QuotaConfigB\004\342A\001\002\022\022\n\004" + + "etag\030\004 \001(\tB\004\342A\001\001\0225\n\013create_time\030\005 \001(\0132\032." + + "google.protobuf.TimestampB\004\342A\001\003\0225\n\013updat" + + "e_time\030\006 \001(\0132\032.google.protobuf.Timestamp" + + "B\004\342A\001\003\022\025\n\007service\030\007 \001(\tB\004\342A\001\002\022\026\n\010quota_i" + + "d\030\010 \001(\tB\004\342A\001\002\022\031\n\013reconciling\030\n \001(\010B\004\342A\001\003" + + "\022\025\n\rjustification\030\013 \001(\t\0321\n\017DimensionsEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\237\002\352A\233" + + "\002\n*cloudquotas.googleapis.com/QuotaPrefe" + + "rence\022Kprojects/{project}/locations/{loc" + + "ation}/quotaPreferences/{quota_preferenc" + + "e}\022Ifolders/{folder}/locations/{location" + + "}/quotaPreferences/{quota_preference}\022Uo" + + "rganizations/{organization}/locations/{l" + + "ocation}/quotaPreferences/{quota_prefere" + + "nce}\"\261\003\n\013QuotaConfig\022\035\n\017preferred_value\030" + + "\001 \001(\003B\004\342A\001\002\022\032\n\014state_detail\030\002 \001(\tB\004\342A\001\003\022" + + "8\n\rgranted_value\030\003 \001(\0132\033.google.protobuf" + + ".Int64ValueB\004\342A\001\003\022\026\n\010trace_id\030\004 \001(\tB\004\342A\001" + + "\003\022L\n\013annotations\030\005 \003(\01327.google.api.clou" + + "dquotas.v1.QuotaConfig.AnnotationsEntry\022" + + "K\n\016request_origin\030\006 \001(\0162-.google.api.clo" + + "udquotas.v1.QuotaConfig.OriginB\004\342A\001\003\0322\n\020" + + "AnnotationsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" + + " \001(\t:\0028\001\"F\n\006Origin\022\026\n\022ORIGIN_UNSPECIFIED" + + "\020\000\022\021\n\rCLOUD_CONSOLE\020\001\022\021\n\rAUTO_ADJUSTER\020\002" + + "\"\352\001\n\016DimensionsInfo\022M\n\ndimensions\030\001 \003(\0132" + + "9.google.api.cloudquotas.v1.DimensionsIn" + + "fo.DimensionsEntry\0228\n\007details\030\002 \001(\0132\'.go" + + "ogle.api.cloudquotas.v1.QuotaDetails\022\034\n\024" + + "applicable_locations\030\003 \003(\t\0321\n\017Dimensions" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\035\n" + + "\014QuotaDetails\022\r\n\005value\030\001 \001(\003*~\n\020QuotaSaf" + + "etyCheck\022\"\n\036QUOTA_SAFETY_CHECK_UNSPECIFI" + + "ED\020\000\022\036\n\032LIMIT_DECREASE_BELOW_USAGE\020\001\022&\n\"" + + "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH\020\002B\324\001\n" + + "\035com.google.api.cloudquotas.v1B\016Resource" + + "sProtoP\001ZDgoogle.golang.org/genproto/goo" + + "gleapis/api/cloudquotas/v1;cloudquotas\252\002" + + "\033Google.Cloud.CloudQuotas.V1\312\002\033Google\\Cl" + + "oud\\CloudQuotas\\V1\352\002\036Google::Cloud::Clou" + + "dQuotas::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + }); + internal_static_google_api_cloudquotas_v1_QuotaInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_cloudquotas_v1_QuotaInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_QuotaInfo_descriptor, + new java.lang.String[] { + "Name", + "QuotaId", + "Metric", + "Service", + "IsPrecise", + "RefreshInterval", + "ContainerType", + "Dimensions", + "MetricDisplayName", + "QuotaDisplayName", + "MetricUnit", + "QuotaIncreaseEligibility", + "IsFixed", + "DimensionsInfos", + "IsConcurrent", + "ServiceRequestQuotaUri", + }); + internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_QuotaIncreaseEligibility_descriptor, + new java.lang.String[] { + "IsEligible", "IneligibilityReason", + }); + internal_static_google_api_cloudquotas_v1_QuotaPreference_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_api_cloudquotas_v1_QuotaPreference_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_QuotaPreference_descriptor, + new java.lang.String[] { + "Name", + "Dimensions", + "QuotaConfig", + "Etag", + "CreateTime", + "UpdateTime", + "Service", + "QuotaId", + "Reconciling", + "Justification", + }); + internal_static_google_api_cloudquotas_v1_QuotaPreference_DimensionsEntry_descriptor = + internal_static_google_api_cloudquotas_v1_QuotaPreference_descriptor + .getNestedTypes() + .get(0); + internal_static_google_api_cloudquotas_v1_QuotaPreference_DimensionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_QuotaPreference_DimensionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_cloudquotas_v1_QuotaConfig_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_api_cloudquotas_v1_QuotaConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_QuotaConfig_descriptor, + new java.lang.String[] { + "PreferredValue", + "StateDetail", + "GrantedValue", + "TraceId", + "Annotations", + "RequestOrigin", + }); + internal_static_google_api_cloudquotas_v1_QuotaConfig_AnnotationsEntry_descriptor = + internal_static_google_api_cloudquotas_v1_QuotaConfig_descriptor.getNestedTypes().get(0); + internal_static_google_api_cloudquotas_v1_QuotaConfig_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_QuotaConfig_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_cloudquotas_v1_DimensionsInfo_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_api_cloudquotas_v1_DimensionsInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_DimensionsInfo_descriptor, + new java.lang.String[] { + "Dimensions", "Details", "ApplicableLocations", + }); + internal_static_google_api_cloudquotas_v1_DimensionsInfo_DimensionsEntry_descriptor = + internal_static_google_api_cloudquotas_v1_DimensionsInfo_descriptor.getNestedTypes().get(0); + internal_static_google_api_cloudquotas_v1_DimensionsInfo_DimensionsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_DimensionsInfo_DimensionsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_api_cloudquotas_v1_QuotaDetails_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_api_cloudquotas_v1_QuotaDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_cloudquotas_v1_QuotaDetails_descriptor, + new java.lang.String[] { + "Value", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ServiceName.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ServiceName.java new file mode 100644 index 000000000000..0188f1c1f26c --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/ServiceName.java @@ -0,0 +1,450 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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 ServiceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_SERVICE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/services/{service}"); + private static final PathTemplate FOLDER_LOCATION_SERVICE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/services/{service}"); + private static final PathTemplate ORGANIZATION_LOCATION_SERVICE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/services/{service}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String service; + private final String folder; + private final String organization; + + @Deprecated + protected ServiceName() { + project = null; + location = null; + service = null; + folder = null; + organization = null; + } + + private ServiceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + folder = null; + organization = null; + pathTemplate = PROJECT_LOCATION_SERVICE; + } + + private ServiceName(FolderLocationServiceBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + project = null; + organization = null; + pathTemplate = FOLDER_LOCATION_SERVICE; + } + + private ServiceName(OrganizationLocationServiceBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + service = Preconditions.checkNotNull(builder.getService()); + project = null; + folder = null; + pathTemplate = ORGANIZATION_LOCATION_SERVICE; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public String getFolder() { + return folder; + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectLocationServiceBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderLocationServiceBuilder newFolderLocationServiceBuilder() { + return new FolderLocationServiceBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationLocationServiceBuilder newOrganizationLocationServiceBuilder() { + return new OrganizationLocationServiceBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ServiceName of(String project, String location, String service) { + return newBuilder().setProject(project).setLocation(location).setService(service).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceName ofProjectLocationServiceName( + String project, String location, String service) { + return newBuilder().setProject(project).setLocation(location).setService(service).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceName ofFolderLocationServiceName( + String folder, String location, String service) { + return newFolderLocationServiceBuilder() + .setFolder(folder) + .setLocation(location) + .setService(service) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceName ofOrganizationLocationServiceName( + String organization, String location, String service) { + return newOrganizationLocationServiceBuilder() + .setOrganization(organization) + .setLocation(location) + .setService(service) + .build(); + } + + public static String format(String project, String location, String service) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationServiceName( + String project, String location, String service) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setService(service) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderLocationServiceName( + String folder, String location, String service) { + return newFolderLocationServiceBuilder() + .setFolder(folder) + .setLocation(location) + .setService(service) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationLocationServiceName( + String organization, String location, String service) { + return newOrganizationLocationServiceBuilder() + .setOrganization(organization) + .setLocation(location) + .setService(service) + .build() + .toString(); + } + + public static ServiceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_SERVICE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_SERVICE.match(formattedString); + return ofProjectLocationServiceName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("service")); + } else if (FOLDER_LOCATION_SERVICE.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_SERVICE.match(formattedString); + return ofFolderLocationServiceName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("service")); + } else if (ORGANIZATION_LOCATION_SERVICE.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_SERVICE.match(formattedString); + return ofOrganizationLocationServiceName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("service")); + } + throw new ValidationException("ServiceName.parse: formattedString not in valid format"); + } + + 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 (ServiceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_SERVICE.matches(formattedString) + || FOLDER_LOCATION_SERVICE.matches(formattedString) + || ORGANIZATION_LOCATION_SERVICE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (service != null) { + fieldMapBuilder.put("service", service); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ServiceName that = ((ServiceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.service, that.service) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(service); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for projects/{project}/locations/{location}/services/{service}. */ + public static class Builder { + private String project; + private String location; + private String service; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setService(String service) { + this.service = service; + return this; + } + + private Builder(ServiceName serviceName) { + Preconditions.checkArgument( + Objects.equals(serviceName.pathTemplate, PROJECT_LOCATION_SERVICE), + "toBuilder is only supported when ServiceName has the pattern of projects/{project}/locations/{location}/services/{service}"); + this.project = serviceName.project; + this.location = serviceName.location; + this.service = serviceName.service; + } + + public ServiceName build() { + return new ServiceName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/services/{service}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderLocationServiceBuilder { + private String folder; + private String location; + private String service; + + protected FolderLocationServiceBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public FolderLocationServiceBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationServiceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationServiceBuilder setService(String service) { + this.service = service; + return this; + } + + public ServiceName build() { + return new ServiceName(this); + } + } + + /** Builder for organizations/{organization}/locations/{location}/services/{service}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationLocationServiceBuilder { + private String organization; + private String location; + private String service; + + protected OrganizationLocationServiceBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getService() { + return service; + } + + public OrganizationLocationServiceBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationServiceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationServiceBuilder setService(String service) { + this.service = service; + return this; + } + + public ServiceName build() { + return new ServiceName(this); + } + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/UpdateQuotaPreferenceRequest.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/UpdateQuotaPreferenceRequest.java new file mode 100644 index 000000000000..aef89767921e --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/UpdateQuotaPreferenceRequest.java @@ -0,0 +1,1645 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +/** + * + * + *
+ * Message for updating a QuotaPreference
+ * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest} + */ +public final class UpdateQuotaPreferenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) + UpdateQuotaPreferenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateQuotaPreferenceRequest.newBuilder() to construct. + private UpdateQuotaPreferenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateQuotaPreferenceRequest() { + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateQuotaPreferenceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int QUOTA_PREFERENCE_FIELD_NUMBER = 2; + private com.google.api.cloudquotas.v1.QuotaPreference quotaPreference_; + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + @java.lang.Override + public boolean hasQuotaPreference() { + return quotaPreference_ != null; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreference() { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder() { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + + public static final int ALLOW_MISSING_FIELD_NUMBER = 3; + private boolean allowMissing_ = false; + /** + * + * + *
+   * Optional. If set to true, and the quota preference is not found, a new one
+   * will be created. In this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + + public static final int VALIDATE_ONLY_FIELD_NUMBER = 4; + private boolean validateOnly_ = false; + /** + * + * + *
+   * Optional. If set to true, validate the request, but do not actually update.
+   * Note that a request being valid does not mean that the request is
+   * guaranteed to be fulfilled.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + + public static final int IGNORE_SAFETY_CHECKS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List ignoreSafetyChecks_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.api.cloudquotas.v1.QuotaSafetyCheck> + ignoreSafetyChecks_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.api.cloudquotas.v1.QuotaSafetyCheck>() { + public com.google.api.cloudquotas.v1.QuotaSafetyCheck convert(java.lang.Integer from) { + com.google.api.cloudquotas.v1.QuotaSafetyCheck result = + com.google.api.cloudquotas.v1.QuotaSafetyCheck.forNumber(from); + return result == null + ? com.google.api.cloudquotas.v1.QuotaSafetyCheck.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the ignoreSafetyChecks. + */ + @java.lang.Override + public java.util.List + getIgnoreSafetyChecksList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.api.cloudquotas.v1.QuotaSafetyCheck>( + ignoreSafetyChecks_, ignoreSafetyChecks_converter_); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return The count of ignoreSafetyChecks. + */ + @java.lang.Override + public int getIgnoreSafetyChecksCount() { + return ignoreSafetyChecks_.size(); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + @java.lang.Override + public com.google.api.cloudquotas.v1.QuotaSafetyCheck getIgnoreSafetyChecks(int index) { + return ignoreSafetyChecks_converter_.convert(ignoreSafetyChecks_.get(index)); + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + @java.lang.Override + public java.util.List getIgnoreSafetyChecksValueList() { + return ignoreSafetyChecks_; + } + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + @java.lang.Override + public int getIgnoreSafetyChecksValue(int index) { + return ignoreSafetyChecks_.get(index); + } + + private int ignoreSafetyChecksMemoizedSerializedSize; + + 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 { + getSerializedSize(); + if (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (quotaPreference_ != null) { + output.writeMessage(2, getQuotaPreference()); + } + if (allowMissing_ != false) { + output.writeBool(3, allowMissing_); + } + if (validateOnly_ != false) { + output.writeBool(4, validateOnly_); + } + if (getIgnoreSafetyChecksList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(ignoreSafetyChecksMemoizedSerializedSize); + } + for (int i = 0; i < ignoreSafetyChecks_.size(); i++) { + output.writeEnumNoTag(ignoreSafetyChecks_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (quotaPreference_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQuotaPreference()); + } + if (allowMissing_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowMissing_); + } + if (validateOnly_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, validateOnly_); + } + { + int dataSize = 0; + for (int i = 0; i < ignoreSafetyChecks_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(ignoreSafetyChecks_.get(i)); + } + size += dataSize; + if (!getIgnoreSafetyChecksList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + ignoreSafetyChecksMemoizedSerializedSize = dataSize; + } + 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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest)) { + return super.equals(obj); + } + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest other = + (com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasQuotaPreference() != other.hasQuotaPreference()) return false; + if (hasQuotaPreference()) { + if (!getQuotaPreference().equals(other.getQuotaPreference())) return false; + } + if (getAllowMissing() != other.getAllowMissing()) return false; + if (getValidateOnly() != other.getValidateOnly()) return false; + if (!ignoreSafetyChecks_.equals(other.ignoreSafetyChecks_)) 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 (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasQuotaPreference()) { + hash = (37 * hash) + QUOTA_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getQuotaPreference().hashCode(); + } + hash = (37 * hash) + ALLOW_MISSING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowMissing()); + hash = (37 * hash) + VALIDATE_ONLY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValidateOnly()); + if (getIgnoreSafetyChecksCount() > 0) { + hash = (37 * hash) + IGNORE_SAFETY_CHECKS_FIELD_NUMBER; + hash = (53 * hash) + ignoreSafetyChecks_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest 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; + } + /** + * + * + *
+   * Message for updating a QuotaPreference
+   * 
+ * + * Protobuf type {@code google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest.class, + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest.Builder.class); + } + + // Construct using com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + quotaPreference_ = null; + if (quotaPreferenceBuilder_ != null) { + quotaPreferenceBuilder_.dispose(); + quotaPreferenceBuilder_ = null; + } + allowMissing_ = false; + validateOnly_ = false; + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.cloudquotas.v1.CloudquotasProto + .internal_static_google_api_cloudquotas_v1_UpdateQuotaPreferenceRequest_descriptor; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest getDefaultInstanceForType() { + return com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest build() { + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest buildPartial() { + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest result = + new com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest result) { + if (((bitField0_ & 0x00000010) != 0)) { + ignoreSafetyChecks_ = java.util.Collections.unmodifiableList(ignoreSafetyChecks_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.ignoreSafetyChecks_ = ignoreSafetyChecks_; + } + + private void buildPartial0(com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.quotaPreference_ = + quotaPreferenceBuilder_ == null ? quotaPreference_ : quotaPreferenceBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.allowMissing_ = allowMissing_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.validateOnly_ = validateOnly_; + } + } + + @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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) { + return mergeFrom((com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest other) { + if (other == com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasQuotaPreference()) { + mergeQuotaPreference(other.getQuotaPreference()); + } + if (other.getAllowMissing() != false) { + setAllowMissing(other.getAllowMissing()); + } + if (other.getValidateOnly() != false) { + setValidateOnly(other.getValidateOnly()); + } + if (!other.ignoreSafetyChecks_.isEmpty()) { + if (ignoreSafetyChecks_.isEmpty()) { + ignoreSafetyChecks_ = other.ignoreSafetyChecks_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.addAll(other.ignoreSafetyChecks_); + } + 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: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getQuotaPreferenceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + allowMissing_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + validateOnly_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + int tmpRaw = input.readEnum(); + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(tmpRaw); + break; + } // case 40 + case 42: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 42 + 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 com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Field mask is used to specify the fields to be overwritten in the
+     * QuotaPreference resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.api.cloudquotas.v1.QuotaPreference quotaPreference_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder> + quotaPreferenceBuilder_; + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + public boolean hasQuotaPreference() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + public com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreference() { + if (quotaPreferenceBuilder_ == null) { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } else { + return quotaPreferenceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaPreference(com.google.api.cloudquotas.v1.QuotaPreference value) { + if (quotaPreferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + quotaPreference_ = value; + } else { + quotaPreferenceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setQuotaPreference( + com.google.api.cloudquotas.v1.QuotaPreference.Builder builderForValue) { + if (quotaPreferenceBuilder_ == null) { + quotaPreference_ = builderForValue.build(); + } else { + quotaPreferenceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeQuotaPreference(com.google.api.cloudquotas.v1.QuotaPreference value) { + if (quotaPreferenceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && quotaPreference_ != null + && quotaPreference_ + != com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance()) { + getQuotaPreferenceBuilder().mergeFrom(value); + } else { + quotaPreference_ = value; + } + } else { + quotaPreferenceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearQuotaPreference() { + bitField0_ = (bitField0_ & ~0x00000002); + quotaPreference_ = null; + if (quotaPreferenceBuilder_ != null) { + quotaPreferenceBuilder_.dispose(); + quotaPreferenceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1.QuotaPreference.Builder getQuotaPreferenceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getQuotaPreferenceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder() { + if (quotaPreferenceBuilder_ != null) { + return quotaPreferenceBuilder_.getMessageOrBuilder(); + } else { + return quotaPreference_ == null + ? com.google.api.cloudquotas.v1.QuotaPreference.getDefaultInstance() + : quotaPreference_; + } + } + /** + * + * + *
+     * Required. The resource being updated
+     * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder> + getQuotaPreferenceFieldBuilder() { + if (quotaPreferenceBuilder_ == null) { + quotaPreferenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.cloudquotas.v1.QuotaPreference, + com.google.api.cloudquotas.v1.QuotaPreference.Builder, + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder>( + getQuotaPreference(), getParentForChildren(), isClean()); + quotaPreference_ = null; + } + return quotaPreferenceBuilder_; + } + + private boolean allowMissing_; + /** + * + * + *
+     * Optional. If set to true, and the quota preference is not found, a new one
+     * will be created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + @java.lang.Override + public boolean getAllowMissing() { + return allowMissing_; + } + /** + * + * + *
+     * Optional. If set to true, and the quota preference is not found, a new one
+     * will be created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The allowMissing to set. + * @return This builder for chaining. + */ + public Builder setAllowMissing(boolean value) { + + allowMissing_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, and the quota preference is not found, a new one
+     * will be created. In this situation, `update_mask` is ignored.
+     * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAllowMissing() { + bitField0_ = (bitField0_ & ~0x00000004); + allowMissing_ = false; + onChanged(); + return this; + } + + private boolean validateOnly_; + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + @java.lang.Override + public boolean getValidateOnly() { + return validateOnly_; + } + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The validateOnly to set. + * @return This builder for chaining. + */ + public Builder setValidateOnly(boolean value) { + + validateOnly_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true, validate the request, but do not actually update.
+     * Note that a request being valid does not mean that the request is
+     * guaranteed to be fulfilled.
+     * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValidateOnly() { + bitField0_ = (bitField0_ & ~0x00000008); + validateOnly_ = false; + onChanged(); + return this; + } + + private java.util.List ignoreSafetyChecks_ = + java.util.Collections.emptyList(); + + private void ensureIgnoreSafetyChecksIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + ignoreSafetyChecks_ = new java.util.ArrayList(ignoreSafetyChecks_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the ignoreSafetyChecks. + */ + public java.util.List + getIgnoreSafetyChecksList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.api.cloudquotas.v1.QuotaSafetyCheck>( + ignoreSafetyChecks_, ignoreSafetyChecks_converter_); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return The count of ignoreSafetyChecks. + */ + public int getIgnoreSafetyChecksCount() { + return ignoreSafetyChecks_.size(); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + public com.google.api.cloudquotas.v1.QuotaSafetyCheck getIgnoreSafetyChecks(int index) { + return ignoreSafetyChecks_converter_.convert(ignoreSafetyChecks_.get(index)); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index to set the value at. + * @param value The ignoreSafetyChecks to set. + * @return This builder for chaining. + */ + public Builder setIgnoreSafetyChecks( + int index, com.google.api.cloudquotas.v1.QuotaSafetyCheck value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param value The ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addIgnoreSafetyChecks(com.google.api.cloudquotas.v1.QuotaSafetyCheck value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param values The ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreSafetyChecks( + java.lang.Iterable values) { + ensureIgnoreSafetyChecksIsMutable(); + for (com.google.api.cloudquotas.v1.QuotaSafetyCheck value : values) { + ignoreSafetyChecks_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreSafetyChecks() { + ignoreSafetyChecks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + public java.util.List getIgnoreSafetyChecksValueList() { + return java.util.Collections.unmodifiableList(ignoreSafetyChecks_); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + public int getIgnoreSafetyChecksValue(int index) { + return ignoreSafetyChecks_.get(index); + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for ignoreSafetyChecks to set. + * @return This builder for chaining. + */ + public Builder setIgnoreSafetyChecksValue(int index, int value) { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param value The enum numeric value on the wire for ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addIgnoreSafetyChecksValue(int value) { + ensureIgnoreSafetyChecksIsMutable(); + ignoreSafetyChecks_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of quota safety checks to be ignored.
+     * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param values The enum numeric values on the wire for ignoreSafetyChecks to add. + * @return This builder for chaining. + */ + public Builder addAllIgnoreSafetyChecksValue(java.lang.Iterable values) { + ensureIgnoreSafetyChecksIsMutable(); + for (int value : values) { + ignoreSafetyChecks_.add(value); + } + 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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) + private static final com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest(); + } + + public static com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/UpdateQuotaPreferenceRequestOrBuilder.java b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/UpdateQuotaPreferenceRequestOrBuilder.java new file mode 100644 index 000000000000..28c530fb0a53 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/java/com/google/api/cloudquotas/v1/UpdateQuotaPreferenceRequestOrBuilder.java @@ -0,0 +1,208 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/cloudquotas/v1/cloudquotas.proto + +package com.google.api.cloudquotas.v1; + +public interface UpdateQuotaPreferenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Field mask is used to specify the fields to be overwritten in the
+   * QuotaPreference resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the quotaPreference field is set. + */ + boolean hasQuotaPreference(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The quotaPreference. + */ + com.google.api.cloudquotas.v1.QuotaPreference getQuotaPreference(); + /** + * + * + *
+   * Required. The resource being updated
+   * 
+ * + * + * .google.api.cloudquotas.v1.QuotaPreference quota_preference = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.api.cloudquotas.v1.QuotaPreferenceOrBuilder getQuotaPreferenceOrBuilder(); + + /** + * + * + *
+   * Optional. If set to true, and the quota preference is not found, a new one
+   * will be created. In this situation, `update_mask` is ignored.
+   * 
+ * + * bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The allowMissing. + */ + boolean getAllowMissing(); + + /** + * + * + *
+   * Optional. If set to true, validate the request, but do not actually update.
+   * Note that a request being valid does not mean that the request is
+   * guaranteed to be fulfilled.
+   * 
+ * + * bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The validateOnly. + */ + boolean getValidateOnly(); + + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the ignoreSafetyChecks. + */ + java.util.List getIgnoreSafetyChecksList(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return The count of ignoreSafetyChecks. + */ + int getIgnoreSafetyChecksCount(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the element to return. + * @return The ignoreSafetyChecks at the given index. + */ + com.google.api.cloudquotas.v1.QuotaSafetyCheck getIgnoreSafetyChecks(int index); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @return A list containing the enum numeric values on the wire for ignoreSafetyChecks. + */ + java.util.List getIgnoreSafetyChecksValueList(); + /** + * + * + *
+   * The list of quota safety checks to be ignored.
+   * 
+ * + * repeated .google.api.cloudquotas.v1.QuotaSafetyCheck ignore_safety_checks = 5; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of ignoreSafetyChecks at the given index. + */ + int getIgnoreSafetyChecksValue(int index); +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/proto/google/api/cloudquotas/v1/cloudquotas.proto b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/proto/google/api/cloudquotas/v1/cloudquotas.proto new file mode 100644 index 000000000000..6f29c79da7e4 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/proto/google/api/cloudquotas/v1/cloudquotas.proto @@ -0,0 +1,325 @@ +// 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.api.cloudquotas.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/cloudquotas/v1/resources.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.CloudQuotas.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/cloudquotas/v1;cloudquotas"; +option java_multiple_files = true; +option java_outer_classname = "CloudquotasProto"; +option java_package = "com.google.api.cloudquotas.v1"; +option php_namespace = "Google\\Cloud\\CloudQuotas\\V1"; +option ruby_package = "Google::Cloud::CloudQuotas::V1"; +option (google.api.resource_definition) = { + type: "cloudquotas.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/services/{service}" + pattern: "folders/{folder}/locations/{location}/services/{service}" + pattern: "organizations/{organization}/locations/{location}/services/{service}" +}; +option (google.api.resource_definition) = { + type: "cloudquotas.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" + pattern: "folders/{folder}/locations/{location}" + pattern: "organizations/{organization}/locations/{location}" +}; + +// The Cloud Quotas API is an infrastructure service for Google Cloud that lets +// service consumers list and manage their resource usage limits. +// +// - List/Get the metadata and current status of the quotas for a service. +// - Create/Update quota preferencess that declare the preferred quota values. +// - Check the status of a quota preference request. +// - List/Get pending and historical quota preference. +service CloudQuotas { + option (google.api.default_host) = "cloudquotas.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists QuotaInfos of all quotas for a given project, folder or organization. + rpc ListQuotaInfos(ListQuotaInfosRequest) returns (ListQuotaInfosResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/services/*}/quotaInfos" + additional_bindings { + get: "/v1/{parent=organizations/*/locations/*/services/*}/quotaInfos" + } + additional_bindings { + get: "/v1/{parent=folders/*/locations/*/services/*}/quotaInfos" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve the QuotaInfo of a quota for a project, folder or organization. + rpc GetQuotaInfo(GetQuotaInfoRequest) returns (QuotaInfo) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/services/*/quotaInfos/*}" + additional_bindings { + get: "/v1/{name=organizations/*/locations/*/services/*/quotaInfos/*}" + } + additional_bindings { + get: "/v1/{name=folders/*/locations/*/services/*/quotaInfos/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists QuotaPreferences in a given project, folder or organization. + rpc ListQuotaPreferences(ListQuotaPreferencesRequest) + returns (ListQuotaPreferencesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/quotaPreferences" + additional_bindings { + get: "/v1/{parent=folders/*/locations/*}/quotaPreferences" + } + additional_bindings { + get: "/v1/{parent=organizations/*/locations/*}/quotaPreferences" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single QuotaPreference. + rpc GetQuotaPreference(GetQuotaPreferenceRequest) returns (QuotaPreference) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/quotaPreferences/*}" + additional_bindings { + get: "/v1/{name=organizations/*/locations/*/quotaPreferences/*}" + } + additional_bindings { + get: "/v1/{name=folders/*/locations/*/quotaPreferences/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new QuotaPreference that declares the desired value for a quota. + rpc CreateQuotaPreference(CreateQuotaPreferenceRequest) + returns (QuotaPreference) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/quotaPreferences" + body: "quota_preference" + additional_bindings { + post: "/v1/{parent=folders/*/locations/*}/quotaPreferences" + body: "quota_preference" + } + additional_bindings { + post: "/v1/{parent=organizations/*/locations/*}/quotaPreferences" + body: "quota_preference" + } + }; + option (google.api.method_signature) = + "parent,quota_preference,quota_preference_id"; + option (google.api.method_signature) = "parent,quota_preference"; + } + + // Updates the parameters of a single QuotaPreference. It can updates the + // config in any states, not just the ones pending approval. + rpc UpdateQuotaPreference(UpdateQuotaPreferenceRequest) + returns (QuotaPreference) { + option (google.api.http) = { + patch: "/v1/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + additional_bindings { + patch: "/v1/{quota_preference.name=folders/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + } + additional_bindings { + patch: "/v1/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + } + }; + option (google.api.method_signature) = "quota_preference,update_mask"; + } +} + +// Message for requesting list of QuotaInfos +message ListQuotaInfosRequest { + // Required. Parent value of QuotaInfo resources. + // Listing across different resource containers (such as 'projects/-') is not + // allowed. + // + // Example names: + // `projects/123/locations/global/services/compute.googleapis.com` + // `folders/234/locations/global/services/compute.googleapis.com` + // `organizations/345/locations/global/services/compute.googleapis.com` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaInfo" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing QuotaInfos +message ListQuotaInfosResponse { + // The list of QuotaInfo + repeated QuotaInfo quota_infos = 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; +} + +// Message for getting a QuotaInfo +message GetQuotaInfoRequest { + // Required. The resource name of the quota info. + // + // An example name: + // `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudquotas.googleapis.com/QuotaInfo" + } + ]; +} + +// Message for requesting list of QuotaPreferences +message ListQuotaPreferencesRequest { + // Required. Parent value of QuotaPreference resources. + // Listing across different resource containers (such as 'projects/-') is not + // allowed. + // + // When the value starts with 'folders' or 'organizations', it lists the + // QuotaPreferences for org quotas in the container. It does not list the + // QuotaPreferences in the descendant projects of the container. + // + // Example parents: + // `projects/123/locations/global` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter result QuotaPreferences by their state, type, + // create/update time range. + // + // Example filters: + // `state=PENDING OR state=PENDING_PARTIALLY_GRANTED` + // `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND + // creation_time>2022-12-03T10:30:00` + // + // If no filter is provided, returns all pending quota preferences. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How to order of the results. By default, the results are ordered + // by create time. + // + // Example orders: + // `type` + // `state, create_time` + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing QuotaPreferences +message ListQuotaPreferencesResponse { + // The list of QuotaPreference + repeated QuotaPreference quota_preferences = 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; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a QuotaPreference +message GetQuotaPreferenceRequest { + // Required. Name of the resource + // + // Example name: + // `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; +} + +// Message for creating a QuotaPreference +message CreateQuotaPreferenceRequest { + // Required. Value for parent. + // + // Example: + // `projects/123/locations/global` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; + + // Optional. Id of the requesting object, must be unique under its parent. + // If client does not set this field, the service will generate one. + string quota_preference_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being created + QuotaPreference quota_preference = 3 [(google.api.field_behavior) = REQUIRED]; + + // The list of quota safety checks to be ignored. + repeated QuotaSafetyCheck ignore_safety_checks = 4; +} + +// Message for updating a QuotaPreference +message UpdateQuotaPreferenceRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // QuotaPreference resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + QuotaPreference quota_preference = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set to true, and the quota preference is not found, a new one + // will be created. In this situation, `update_mask` is ignored. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, validate the request, but do not actually update. + // Note that a request being valid does not mean that the request is + // guaranteed to be fulfilled. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // The list of quota safety checks to be ignored. + repeated QuotaSafetyCheck ignore_safety_checks = 5; +} diff --git a/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/proto/google/api/cloudquotas/v1/resources.proto b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/proto/google/api/cloudquotas/v1/resources.proto new file mode 100644 index 000000000000..a3aae2a12e72 --- /dev/null +++ b/java-cloudquotas/proto-google-cloud-cloudquotas-v1/src/main/proto/google/api/cloudquotas/v1/resources.proto @@ -0,0 +1,298 @@ +// 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.api.cloudquotas.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.CloudQuotas.V1"; +option go_package = "google.golang.org/genproto/googleapis/api/cloudquotas/v1;cloudquotas"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.api.cloudquotas.v1"; +option php_namespace = "Google\\Cloud\\CloudQuotas\\V1"; +option ruby_package = "Google::Cloud::CloudQuotas::V1"; + +// Enumerations of quota safety checks. +enum QuotaSafetyCheck { + // Unspecified quota safety check. + QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + + // Validates that a quota mutation would not cause the consumer's effective + // limit to be lower than the consumer's quota usage. + LIMIT_DECREASE_BELOW_USAGE = 1; + + // Validates that a quota mutation would not cause the consumer's effective + // limit to decrease by more than 10 percent. + LIMIT_DECREASE_PERCENTAGE_TOO_HIGH = 2; +} + +// QuotaInfo represents information about a particular quota for a given +// project, folder or organization. +message QuotaInfo { + option (google.api.resource) = { + type: "cloudquotas.googleapis.com/QuotaInfo" + pattern: "projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + pattern: "folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + pattern: "organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + }; + + // The enumeration of the types of a cloud resource container. + enum ContainerType { + // Unspecified container type. + CONTAINER_TYPE_UNSPECIFIED = 0; + + // consumer project + PROJECT = 1; + + // folder + FOLDER = 2; + + // organization + ORGANIZATION = 3; + } + + // Resource name of this QuotaInfo. + // The ID component following "locations/" must be "global". + // Example: + // `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + string name = 1; + + // The id of the quota, which is unquie within the service. + // Example: `CpusPerProjectPerRegion` + string quota_id = 2; + + // The metric of the quota. It specifies the resources consumption the quota + // is defined for. + // Example: `compute.googleapis.com/cpus` + string metric = 3; + + // The name of the service in which the quota is defined. + // Example: `compute.googleapis.com` + string service = 4; + + // Whether this is a precise quota. A precise quota is tracked with absolute + // precision. In contrast, an imprecise quota is not tracked with precision. + bool is_precise = 5; + + // The reset time interval for the quota. Refresh interval applies to rate + // quota only. + // Example: “minute” for per minute, “day” for per day, or “10 seconds” for + // every 10 seconds. + string refresh_interval = 6; + + // The container type of the QuotaInfo. + ContainerType container_type = 7; + + // The dimensions the quota is defined on. + repeated string dimensions = 8; + + // The display name of the quota metric + string metric_display_name = 9; + + // The display name of the quota. + string quota_display_name = 10; + + // The unit in which the metric value is reported, e.g., “MByte”. + string metric_unit = 11; + + // Whether it is eligible to request a higher quota value for this quota. + QuotaIncreaseEligibility quota_increase_eligibility = 12; + + // Whether the quota value is fixed or adjustable + bool is_fixed = 13; + + // The collection of dimensions info ordered by their dimensions from more + // specific ones to less specific ones. + repeated DimensionsInfo dimensions_infos = 14; + + // Whether the quota is a concurrent quota. Concurrent quotas are enforced + // on the total number of concurrent operations in flight at any given time. + bool is_concurrent = 15; + + // URI to the page where the user can request more quotas for the cloud + // service, such as + // https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0={email}&entry_1={id}. + // Google Developers Console UI replace {email} with the current + // user's e-mail, {id} with the current project number, or organization ID + // with "organizations/" prefix. For example, + // https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=25463754, + // or + // https://docs.google.com/spreadsheet/viewform?formkey=abc123&entry_0=johndoe@gmail.com&entry_1=organizations/26474422. + string service_request_quota_uri = 17; +} + +// Eligibility information regarding requesting increase adjustment of a quota. +message QuotaIncreaseEligibility { + // The enumeration of reasons when it is ineligible to request increase + // adjustment. + enum IneligibilityReason { + // Default value when is_eligible is true. + INELIGIBILITY_REASON_UNSPECIFIED = 0; + + // The container is not linked with a billing account. + NO_BILLING_ACCOUNT = 2; + + // Other reasons. + OTHER = 3; + } + + // Whether a higher quota value can be requested for the quota. + bool is_eligible = 1; + + // The reason of why it is ineligible to request increased value of the quota. + // If the is_eligible field is true, it defaults to + // INELIGIBILITY_REASON_UNSPECIFIED. + IneligibilityReason ineligibility_reason = 2; +} + +// QuotaPreference represents the preferred quota configuration specified for +// a project, folder or organization. There is only one QuotaPreference +// resource for a quota value targeting a unique set of dimensions. +message QuotaPreference { + option (google.api.resource) = { + type: "cloudquotas.googleapis.com/QuotaPreference" + pattern: "projects/{project}/locations/{location}/quotaPreferences/{quota_preference}" + pattern: "folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}" + pattern: "organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}" + }; + + // Required except in the CREATE requests. + // The resource name of the quota preference. + // The ID component following "locations/" must be "global". + // Example: + // `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` + string name = 1; + + // The dimensions that this quota preference applies to. The key of the map + // entry is the name of a dimension, such as "region", "zone", “network_id”, + // and the value of the map entry is the dimension value. + // + // If a dimension is missing from the map of dimensions, the quota preference + // applies to all the dimension values except for those that have other quota + // preferences configured for the specific value. + // + // NOTE: QuotaPreferences can only be applied across all values of "user" and + // "resource" dimension. Do not set values for "user" or "resource" in the + // dimension map. + // + // Example: {"provider", "Foo Inc"} where "provider" is a service specific + // dimension. + map dimensions = 2; + + // Required. Preferred quota configuration. + QuotaConfig quota_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The current etag of the quota preference. If an etag is provided + // on update and does not match the current server's etag of the quota + // preference, the request will be blocked and an ABORTED error will be + // returned. See https://google.aip.dev/134#etags for more details on etags. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the service to which the quota preference is applied. + string service = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. The id of the quota to which the quota preference is applied. A + // quota name is unique in the service. Example: `CpusPerProjectPerRegion` + string quota_id = 8 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Is the quota preference pending GCP approval and fulfillment. + bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The reason / justification for this quota preference. + string justification = 11; +} + +// The preferred quota configuration. +message QuotaConfig { + // The enumeration of the origins of quota preference requests. + enum Origin { + // The unspecified value. + ORIGIN_UNSPECIFIED = 0; + + // Created through Cloud Console. + CLOUD_CONSOLE = 1; + + // Generated by automatic quota adjustment. + AUTO_ADJUSTER = 2; + } + + // Required. The preferred value. Must be greater than or equal to -1. If set + // to -1, it means the value is "unlimited". + int64 preferred_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Optional details about the state of this quota preference. + string state_detail = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Granted quota value. + google.protobuf.Int64Value granted_value = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The trace id that the GCP uses to provision the requested + // quota. This trace id may be used by the client to contact Cloud support to + // track the state of a quota preference request. The trace id is only + // produced for increase requests and is unique for each request. The + // quota decrease requests do not have a trace id. + string trace_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The annotations map for clients to store small amounts of arbitrary data. + // Do not put PII or other sensitive information here. + // See https://google.aip.dev/128#annotations + map annotations = 5; + + // Output only. The origin of the quota preference request. + Origin request_origin = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The detailed quota information such as effective quota value for a +// combination of dimensions. +message DimensionsInfo { + // The map of dimensions for this dimensions info. The key of a map entry + // is "region", "zone" or the name of a service specific dimension, and the + // value of a map entry is the value of the dimension. If a dimension does + // not appear in the map of dimensions, the dimensions info applies to all + // the dimension values except for those that have another DimenisonInfo + // instance configured for the specific value. + // Example: {"provider" : "Foo Inc"} where "provider" is a service specific + // dimension of a quota. + map dimensions = 1; + + // Quota details for the specified dimensions. + QuotaDetails details = 2; + + // The applicable regions or zones of this dimensions info. The field will be + // set to ['global'] for quotas that are not per region or per zone. + // Otherwise, it will be set to the list of locations this dimension info is + // applicable to. + repeated string applicable_locations = 3; +} + +// The quota details for a map of dimensions. +message QuotaDetails { + // The value currently in effect and being enforced. + int64 value = 1; +} diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetCredentialsProvider.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..360405661efb --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_Create_SetCredentialsProvider_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.CloudQuotasSettings; +import com.google.api.cloudquotas.v1.myCredentials; +import com.google.api.gax.core.FixedCredentialsProvider; + +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 + CloudQuotasSettings cloudQuotasSettings = + CloudQuotasSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings); + } +} +// [END cloudquotas_v1_generated_CloudQuotas_Create_SetCredentialsProvider_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetCredentialsProvider1.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..618f5da01720 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,39 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_Create_SetCredentialsProvider1_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.CloudQuotasSettings; + +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 + CloudQuotasSettings cloudQuotasSettings = CloudQuotasSettings.newHttpJsonBuilder().build(); + CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings); + } +} +// [END cloudquotas_v1_generated_CloudQuotas_Create_SetCredentialsProvider1_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetEndpoint.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..21ba09201cc3 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_Create_SetEndpoint_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.CloudQuotasSettings; +import com.google.api.cloudquotas.v1.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 + CloudQuotasSettings cloudQuotasSettings = + CloudQuotasSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create(cloudQuotasSettings); + } +} +// [END cloudquotas_v1_generated_CloudQuotas_Create_SetEndpoint_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/AsyncCreateQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/AsyncCreateQuotaPreference.java new file mode 100644 index 000000000000..8b3e4bdfc2df --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/AsyncCreateQuotaPreference.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_async] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.QuotaSafetyCheck; +import com.google.api.core.ApiFuture; +import java.util.ArrayList; + +public class AsyncCreateQuotaPreference { + + public static void main(String[] args) throws Exception { + asyncCreateQuotaPreference(); + } + + public static void asyncCreateQuotaPreference() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setQuotaPreferenceId("quotaPreferenceId-948332050") + .setQuotaPreference(QuotaPreference.newBuilder().build()) + .addAllIgnoreSafetyChecks(new ArrayList()) + .build(); + ApiFuture future = + cloudQuotasClient.createQuotaPreferenceCallable().futureCall(request); + // Do something. + QuotaPreference response = future.get(); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreference.java new file mode 100644 index 000000000000..28053fca5efd --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreference.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.CreateQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.QuotaSafetyCheck; +import java.util.ArrayList; + +public class SyncCreateQuotaPreference { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreference(); + } + + public static void syncCreateQuotaPreference() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + CreateQuotaPreferenceRequest request = + CreateQuotaPreferenceRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setQuotaPreferenceId("quotaPreferenceId-948332050") + .setQuotaPreference(QuotaPreference.newBuilder().build()) + .addAllIgnoreSafetyChecks(new ArrayList()) + .build(); + QuotaPreference response = cloudQuotasClient.createQuotaPreference(request); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreference.java new file mode 100644 index 000000000000..2b69f092827d --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreference.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_LocationnameQuotapreference_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; + +public class SyncCreateQuotaPreferenceLocationnameQuotapreference { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreferenceLocationnameQuotapreference(); + } + + public static void syncCreateQuotaPreferenceLocationnameQuotapreference() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + QuotaPreference response = cloudQuotasClient.createQuotaPreference(parent, quotaPreference); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_LocationnameQuotapreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreferenceString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreferenceString.java new file mode 100644 index 000000000000..20a854ccfe08 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceLocationnameQuotapreferenceString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_LocationnameQuotapreferenceString_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; + +public class SyncCreateQuotaPreferenceLocationnameQuotapreferenceString { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreferenceLocationnameQuotapreferenceString(); + } + + public static void syncCreateQuotaPreferenceLocationnameQuotapreferenceString() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + QuotaPreference response = + cloudQuotasClient.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_LocationnameQuotapreferenceString_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreference.java new file mode 100644 index 000000000000..5e7336f3ae26 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreference.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_StringQuotapreference_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; + +public class SyncCreateQuotaPreferenceStringQuotapreference { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreferenceStringQuotapreference(); + } + + public static void syncCreateQuotaPreferenceStringQuotapreference() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString(); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + QuotaPreference response = cloudQuotasClient.createQuotaPreference(parent, quotaPreference); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_StringQuotapreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreferenceString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreferenceString.java new file mode 100644 index 000000000000..9f82eb9ba6ad --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/createquotapreference/SyncCreateQuotaPreferenceStringQuotapreferenceString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_StringQuotapreferenceString_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; + +public class SyncCreateQuotaPreferenceStringQuotapreferenceString { + + public static void main(String[] args) throws Exception { + syncCreateQuotaPreferenceStringQuotapreferenceString(); + } + + public static void syncCreateQuotaPreferenceStringQuotapreferenceString() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString(); + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + String quotaPreferenceId = "quotaPreferenceId-948332050"; + QuotaPreference response = + cloudQuotasClient.createQuotaPreference(parent, quotaPreference, quotaPreferenceId); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_CreateQuotaPreference_StringQuotapreferenceString_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/AsyncGetQuotaInfo.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/AsyncGetQuotaInfo.java new file mode 100644 index 000000000000..a95f529df0e7 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/AsyncGetQuotaInfo.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_async] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.QuotaInfoName; +import com.google.api.core.ApiFuture; + +public class AsyncGetQuotaInfo { + + public static void main(String[] args) throws Exception { + asyncGetQuotaInfo(); + } + + public static void asyncGetQuotaInfo() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + GetQuotaInfoRequest request = + GetQuotaInfoRequest.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .build(); + ApiFuture future = cloudQuotasClient.getQuotaInfoCallable().futureCall(request); + // Do something. + QuotaInfo response = future.get(); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfo.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfo.java new file mode 100644 index 000000000000..da0c66969531 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfo.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.GetQuotaInfoRequest; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.QuotaInfoName; + +public class SyncGetQuotaInfo { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfo(); + } + + public static void syncGetQuotaInfo() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + GetQuotaInfoRequest request = + GetQuotaInfoRequest.newBuilder() + .setName( + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString()) + .build(); + QuotaInfo response = cloudQuotasClient.getQuotaInfo(request); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfoQuotainfoname.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfoQuotainfoname.java new file mode 100644 index 000000000000..f7067c0e73bf --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfoQuotainfoname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_Quotainfoname_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.QuotaInfoName; + +public class SyncGetQuotaInfoQuotainfoname { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfoQuotainfoname(); + } + + public static void syncGetQuotaInfoQuotainfoname() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + QuotaInfoName name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]"); + QuotaInfo response = cloudQuotasClient.getQuotaInfo(name); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_Quotainfoname_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfoString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfoString.java new file mode 100644 index 000000000000..38b86e43f3e1 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotainfo/SyncGetQuotaInfoString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_String_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.QuotaInfoName; + +public class SyncGetQuotaInfoString { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfoString(); + } + + public static void syncGetQuotaInfoString() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String name = + QuotaInfoName.ofProjectLocationServiceQuotaInfoName( + "[PROJECT]", "[LOCATION]", "[SERVICE]", "[QUOTA_INFO]") + .toString(); + QuotaInfo response = cloudQuotasClient.getQuotaInfo(name); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaInfo_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/AsyncGetQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/AsyncGetQuotaPreference.java new file mode 100644 index 000000000000..ea9efaad36ed --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/AsyncGetQuotaPreference.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_async] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.QuotaPreferenceName; +import com.google.api.core.ApiFuture; + +public class AsyncGetQuotaPreference { + + public static void main(String[] args) throws Exception { + asyncGetQuotaPreference(); + } + + public static void asyncGetQuotaPreference() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + GetQuotaPreferenceRequest request = + GetQuotaPreferenceRequest.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .build(); + ApiFuture future = + cloudQuotasClient.getQuotaPreferenceCallable().futureCall(request); + // Do something. + QuotaPreference response = future.get(); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreference.java new file mode 100644 index 000000000000..fec5528bb355 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreference.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.GetQuotaPreferenceRequest; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.QuotaPreferenceName; + +public class SyncGetQuotaPreference { + + public static void main(String[] args) throws Exception { + syncGetQuotaPreference(); + } + + public static void syncGetQuotaPreference() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + GetQuotaPreferenceRequest request = + GetQuotaPreferenceRequest.newBuilder() + .setName( + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString()) + .build(); + QuotaPreference response = cloudQuotasClient.getQuotaPreference(request); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreferenceQuotapreferencename.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreferenceQuotapreferencename.java new file mode 100644 index 000000000000..4f59d67e9bc1 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreferenceQuotapreferencename.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_Quotapreferencename_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.QuotaPreferenceName; + +public class SyncGetQuotaPreferenceQuotapreferencename { + + public static void main(String[] args) throws Exception { + syncGetQuotaPreferenceQuotapreferencename(); + } + + public static void syncGetQuotaPreferenceQuotapreferencename() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + QuotaPreferenceName name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]"); + QuotaPreference response = cloudQuotasClient.getQuotaPreference(name); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_Quotapreferencename_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreferenceString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreferenceString.java new file mode 100644 index 000000000000..0142ea837485 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/getquotapreference/SyncGetQuotaPreferenceString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_String_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.QuotaPreferenceName; + +public class SyncGetQuotaPreferenceString { + + public static void main(String[] args) throws Exception { + syncGetQuotaPreferenceString(); + } + + public static void syncGetQuotaPreferenceString() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String name = + QuotaPreferenceName.ofProjectLocationQuotaPreferenceName( + "[PROJECT]", "[LOCATION]", "[QUOTA_PREFERENCE]") + .toString(); + QuotaPreference response = cloudQuotasClient.getQuotaPreference(name); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_GetQuotaPreference_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/AsyncListQuotaInfos.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/AsyncListQuotaInfos.java new file mode 100644 index 000000000000..6035c94bd23b --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/AsyncListQuotaInfos.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_async] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.ServiceName; +import com.google.api.core.ApiFuture; + +public class AsyncListQuotaInfos { + + public static void main(String[] args) throws Exception { + asyncListQuotaInfos(); + } + + public static void asyncListQuotaInfos() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaInfosRequest request = + ListQuotaInfosRequest.newBuilder() + .setParent( + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cloudQuotasClient.listQuotaInfosPagedCallable().futureCall(request); + // Do something. + for (QuotaInfo element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/AsyncListQuotaInfosPaged.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/AsyncListQuotaInfosPaged.java new file mode 100644 index 000000000000..4908736811b5 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/AsyncListQuotaInfosPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_Paged_async] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1.ListQuotaInfosResponse; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.ServiceName; +import com.google.common.base.Strings; + +public class AsyncListQuotaInfosPaged { + + public static void main(String[] args) throws Exception { + asyncListQuotaInfosPaged(); + } + + public static void asyncListQuotaInfosPaged() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaInfosRequest request = + ListQuotaInfosRequest.newBuilder() + .setParent( + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListQuotaInfosResponse response = cloudQuotasClient.listQuotaInfosCallable().call(request); + for (QuotaInfo element : response.getQuotaInfosList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_Paged_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfos.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfos.java new file mode 100644 index 000000000000..7607fb3892b3 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfos.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.ListQuotaInfosRequest; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.ServiceName; + +public class SyncListQuotaInfos { + + public static void main(String[] args) throws Exception { + syncListQuotaInfos(); + } + + public static void syncListQuotaInfos() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaInfosRequest request = + ListQuotaInfosRequest.newBuilder() + .setParent( + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfosServicename.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfosServicename.java new file mode 100644 index 000000000000..327c7dc018d1 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfosServicename.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_Servicename_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.ServiceName; + +public class SyncListQuotaInfosServicename { + + public static void main(String[] args) throws Exception { + syncListQuotaInfosServicename(); + } + + public static void syncListQuotaInfosServicename() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ServiceName parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]"); + for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_Servicename_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfosString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfosString.java new file mode 100644 index 000000000000..91425950652a --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotainfos/SyncListQuotaInfosString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_String_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaInfo; +import com.google.api.cloudquotas.v1.ServiceName; + +public class SyncListQuotaInfosString { + + public static void main(String[] args) throws Exception { + syncListQuotaInfosString(); + } + + public static void syncListQuotaInfosString() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String parent = + ServiceName.ofProjectLocationServiceName("[PROJECT]", "[LOCATION]", "[SERVICE]") + .toString(); + for (QuotaInfo element : cloudQuotasClient.listQuotaInfos(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaInfos_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/AsyncListQuotaPreferences.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/AsyncListQuotaPreferences.java new file mode 100644 index 000000000000..46ea4e82e646 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/AsyncListQuotaPreferences.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_async] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.core.ApiFuture; + +public class AsyncListQuotaPreferences { + + public static void main(String[] args) throws Exception { + asyncListQuotaPreferences(); + } + + public static void asyncListQuotaPreferences() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + cloudQuotasClient.listQuotaPreferencesPagedCallable().futureCall(request); + // Do something. + for (QuotaPreference element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/AsyncListQuotaPreferencesPaged.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/AsyncListQuotaPreferencesPaged.java new file mode 100644 index 000000000000..e68ae0a54f3c --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/AsyncListQuotaPreferencesPaged.java @@ -0,0 +1,64 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_Paged_async] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesResponse; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.common.base.Strings; + +public class AsyncListQuotaPreferencesPaged { + + public static void main(String[] args) throws Exception { + asyncListQuotaPreferencesPaged(); + } + + public static void asyncListQuotaPreferencesPaged() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListQuotaPreferencesResponse response = + cloudQuotasClient.listQuotaPreferencesCallable().call(request); + for (QuotaPreference element : response.getQuotaPreferencesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_Paged_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferences.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferences.java new file mode 100644 index 000000000000..14e133995e00 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferences.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.ListQuotaPreferencesRequest; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; + +public class SyncListQuotaPreferences { + + public static void main(String[] args) throws Exception { + syncListQuotaPreferences(); + } + + public static void syncListQuotaPreferences() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + ListQuotaPreferencesRequest request = + ListQuotaPreferencesRequest.newBuilder() + .setParent(LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferencesLocationname.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferencesLocationname.java new file mode 100644 index 000000000000..67b0c9b33119 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferencesLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_Locationname_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; + +public class SyncListQuotaPreferencesLocationname { + + public static void main(String[] args) throws Exception { + syncListQuotaPreferencesLocationname(); + } + + public static void syncListQuotaPreferencesLocationname() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + LocationName parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]"); + for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_Locationname_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferencesString.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferencesString.java new file mode 100644 index 000000000000..bb2f296a270f --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/listquotapreferences/SyncListQuotaPreferencesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_String_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.LocationName; +import com.google.api.cloudquotas.v1.QuotaPreference; + +public class SyncListQuotaPreferencesString { + + public static void main(String[] args) throws Exception { + syncListQuotaPreferencesString(); + } + + public static void syncListQuotaPreferencesString() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + String parent = LocationName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString(); + for (QuotaPreference element : cloudQuotasClient.listQuotaPreferences(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_ListQuotaPreferences_String_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/AsyncUpdateQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/AsyncUpdateQuotaPreference.java new file mode 100644 index 000000000000..3c48962cbe9b --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/AsyncUpdateQuotaPreference.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_UpdateQuotaPreference_async] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.QuotaSafetyCheck; +import com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest; +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import java.util.ArrayList; + +public class AsyncUpdateQuotaPreference { + + public static void main(String[] args) throws Exception { + asyncUpdateQuotaPreference(); + } + + public static void asyncUpdateQuotaPreference() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + UpdateQuotaPreferenceRequest request = + UpdateQuotaPreferenceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setQuotaPreference(QuotaPreference.newBuilder().build()) + .setAllowMissing(true) + .setValidateOnly(true) + .addAllIgnoreSafetyChecks(new ArrayList()) + .build(); + ApiFuture future = + cloudQuotasClient.updateQuotaPreferenceCallable().futureCall(request); + // Do something. + QuotaPreference response = future.get(); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_UpdateQuotaPreference_async] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/SyncUpdateQuotaPreference.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/SyncUpdateQuotaPreference.java new file mode 100644 index 000000000000..87559ff9f17b --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/SyncUpdateQuotaPreference.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_UpdateQuotaPreference_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.api.cloudquotas.v1.QuotaSafetyCheck; +import com.google.api.cloudquotas.v1.UpdateQuotaPreferenceRequest; +import com.google.protobuf.FieldMask; +import java.util.ArrayList; + +public class SyncUpdateQuotaPreference { + + public static void main(String[] args) throws Exception { + syncUpdateQuotaPreference(); + } + + public static void syncUpdateQuotaPreference() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + UpdateQuotaPreferenceRequest request = + UpdateQuotaPreferenceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setQuotaPreference(QuotaPreference.newBuilder().build()) + .setAllowMissing(true) + .setValidateOnly(true) + .addAllIgnoreSafetyChecks(new ArrayList()) + .build(); + QuotaPreference response = cloudQuotasClient.updateQuotaPreference(request); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_UpdateQuotaPreference_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/SyncUpdateQuotaPreferenceQuotapreferenceFieldmask.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/SyncUpdateQuotaPreferenceQuotapreferenceFieldmask.java new file mode 100644 index 000000000000..bd3d7d79e411 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotas/updatequotapreference/SyncUpdateQuotaPreferenceQuotapreferenceFieldmask.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotas_UpdateQuotaPreference_QuotapreferenceFieldmask_sync] +import com.google.api.cloudquotas.v1.CloudQuotasClient; +import com.google.api.cloudquotas.v1.QuotaPreference; +import com.google.protobuf.FieldMask; + +public class SyncUpdateQuotaPreferenceQuotapreferenceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateQuotaPreferenceQuotapreferenceFieldmask(); + } + + public static void syncUpdateQuotaPreferenceQuotapreferenceFieldmask() 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 (CloudQuotasClient cloudQuotasClient = CloudQuotasClient.create()) { + QuotaPreference quotaPreference = QuotaPreference.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + QuotaPreference response = + cloudQuotasClient.updateQuotaPreference(quotaPreference, updateMask); + } + } +} +// [END cloudquotas_v1_generated_CloudQuotas_UpdateQuotaPreference_QuotapreferenceFieldmask_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotassettings/getquotainfo/SyncGetQuotaInfo.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotassettings/getquotainfo/SyncGetQuotaInfo.java new file mode 100644 index 000000000000..4656d8e55d8c --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/cloudquotassettings/getquotainfo/SyncGetQuotaInfo.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.samples; + +// [START cloudquotas_v1_generated_CloudQuotasSettings_GetQuotaInfo_sync] +import com.google.api.cloudquotas.v1.CloudQuotasSettings; +import java.time.Duration; + +public class SyncGetQuotaInfo { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfo(); + } + + public static void syncGetQuotaInfo() 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 + CloudQuotasSettings.Builder cloudQuotasSettingsBuilder = CloudQuotasSettings.newBuilder(); + cloudQuotasSettingsBuilder + .getQuotaInfoSettings() + .setRetrySettings( + cloudQuotasSettingsBuilder + .getQuotaInfoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudQuotasSettings cloudQuotasSettings = cloudQuotasSettingsBuilder.build(); + } +} +// [END cloudquotas_v1_generated_CloudQuotasSettings_GetQuotaInfo_sync] diff --git a/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/stub/cloudquotasstubsettings/getquotainfo/SyncGetQuotaInfo.java b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/stub/cloudquotasstubsettings/getquotainfo/SyncGetQuotaInfo.java new file mode 100644 index 000000000000..1a114376bd89 --- /dev/null +++ b/java-cloudquotas/samples/snippets/generated/com/google/api/cloudquotas/v1/stub/cloudquotasstubsettings/getquotainfo/SyncGetQuotaInfo.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.api.cloudquotas.v1.stub.samples; + +// [START cloudquotas_v1_generated_CloudQuotasStubSettings_GetQuotaInfo_sync] +import com.google.api.cloudquotas.v1.stub.CloudQuotasStubSettings; +import java.time.Duration; + +public class SyncGetQuotaInfo { + + public static void main(String[] args) throws Exception { + syncGetQuotaInfo(); + } + + public static void syncGetQuotaInfo() 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 + CloudQuotasStubSettings.Builder cloudQuotasSettingsBuilder = + CloudQuotasStubSettings.newBuilder(); + cloudQuotasSettingsBuilder + .getQuotaInfoSettings() + .setRetrySettings( + cloudQuotasSettingsBuilder + .getQuotaInfoSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudQuotasStubSettings cloudQuotasSettings = cloudQuotasSettingsBuilder.build(); + } +} +// [END cloudquotas_v1_generated_CloudQuotasStubSettings_GetQuotaInfo_sync] diff --git a/pom.xml b/pom.xml index 543d70ecf422..2f5b4ffcc30a 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,7 @@ java-channel java-cloudbuild java-cloudcommerceconsumerprocurement + java-cloudquotas java-cloudsupport java-compute java-confidentialcomputing diff --git a/versions.txt b/versions.txt index 8ee743de5416..a56fc1dda0a1 100644 --- a/versions.txt +++ b/versions.txt @@ -710,3 +710,6 @@ grpc-google-cloud-vertexai-v1beta1:0.1.0:0.2.0-SNAPSHOT google-cloud-edgenetwork:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-edgenetwork-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-edgenetwork-v1:0.0.0:0.0.1-SNAPSHOT +google-cloud-cloudquotas:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-cloudquotas-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-cloudquotas-v1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file