diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index f3a78f15ac38..a7c52b65d3c1 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -308,6 +308,13 @@ pom import + + com.google.cloud + google-cloud-cloudcontrolspartner-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-cloudquotas-bom diff --git a/java-cloudcontrolspartner/.OwlBot.yaml b/java-cloudcontrolspartner/.OwlBot.yaml new file mode 100644 index 000000000000..b6b792e566ff --- /dev/null +++ b/java-cloudcontrolspartner/.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-cloudcontrolspartner/grpc-google-.*/src" +- "/java-cloudcontrolspartner/proto-google-.*/src" +- "/java-cloudcontrolspartner/google-.*/src" +- "/java-cloudcontrolspartner/samples/snippets/generated" + +deep-preserve-regex: +- "/java-cloudcontrolspartner/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/cloudcontrolspartner/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-cloudcontrolspartner/$1/proto-google-cloud-cloudcontrolspartner-$1/src" +- source: "/google/cloud/cloudcontrolspartner/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-cloudcontrolspartner/$1/grpc-google-cloud-cloudcontrolspartner-$1/src" +- source: "/google/cloud/cloudcontrolspartner/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-cloudcontrolspartner/$1/google-cloud-cloudcontrolspartner/src" +- source: "/google/cloud/cloudcontrolspartner/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-cloudcontrolspartner/$1/samples/snippets/generated" + + +api-name: cloudcontrolspartner \ No newline at end of file diff --git a/java-cloudcontrolspartner/.repo-metadata.json b/java-cloudcontrolspartner/.repo-metadata.json new file mode 100644 index 000000000000..b072ceee6b15 --- /dev/null +++ b/java-cloudcontrolspartner/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "cloudcontrolspartner", + "name_pretty": "Cloud Controls Partner API", + "product_documentation": "https://cloud.google.com/sovereign-controls-by-partners/docs/sovereign-partners", + "api_description": "Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-cloudcontrolspartner/latest/overview", + "release_level": "preview", + "transport": "both", + "language": "java", + "repo": "googleapis/java-cloudcontrolspartner", + "repo_short": "java-cloudcontrolspartner", + "distribution_name": "com.google.cloud:google-cloud-cloudcontrolspartner", + "api_id": "cloudcontrolspartner.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-cloudcontrolspartner/README.md b/java-cloudcontrolspartner/README.md new file mode 100644 index 000000000000..727878232cea --- /dev/null +++ b/java-cloudcontrolspartner/README.md @@ -0,0 +1,225 @@ +# Google Cloud Controls Partner API Client for Java + +Java idiomatic client for [Cloud Controls Partner 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.33.0 + pom + import + + + + + + + com.google.cloud + google-cloud-cloudcontrolspartner + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-cloudcontrolspartner + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-cloudcontrolspartner:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-cloudcontrolspartner" % "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 Controls Partner API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Controls Partner API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Controls Partner API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud Controls Partner 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-cloudcontrolspartner` library. See the [Quickstart](#quickstart) section +to add `google-cloud-cloudcontrolspartner` as a dependency in your code. + +## About Cloud Controls Partner API + + +[Cloud Controls Partner API][product-docs] Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering. + +See the [Cloud Controls Partner API client library docs][javadocs] to learn how to +use this Cloud Controls Partner API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud Controls Partner API uses both gRPC and HTTP/JSON for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/sovereign-controls-by-partners/docs/sovereign-partners +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-cloudcontrolspartner/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-cloudcontrolspartner/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-cloudcontrolspartner.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-cloudcontrolspartner/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-cloudcontrolspartner/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-cloudcontrolspartner/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-cloudcontrolspartner/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=cloudcontrolspartner.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-cloudcontrolspartner/google-cloud-cloudcontrolspartner-bom/pom.xml b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner-bom/pom.xml new file mode 100644 index 000000000000..ef0a91533199 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner-bom/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudcontrolspartner-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.31.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Cloud Controls Partner API BOM + + BOM for Cloud Controls Partner API + + + + true + + + + + + com.google.cloud + google-cloud-cloudcontrolspartner + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudcontrolspartner-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudcontrolspartner-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-cloudcontrolspartner-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-cloudcontrolspartner-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/pom.xml b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/pom.xml new file mode 100644 index 000000000000..2d843b895277 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudcontrolspartner + 0.0.1-SNAPSHOT + jar + Google Cloud Controls Partner API + Cloud Controls Partner API Provides insights about your customers and their Assured Workloads based on your Sovereign Controls by Partners offering. + + com.google.cloud + google-cloud-cloudcontrolspartner-parent + 0.0.1-SNAPSHOT + + + google-cloud-cloudcontrolspartner + + + + 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-cloudcontrolspartner-v1beta + + + com.google.api.grpc + proto-google-cloud-cloudcontrolspartner-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-cloudcontrolspartner-v1 + test + + + com.google.api.grpc + grpc-google-cloud-cloudcontrolspartner-v1beta + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClient.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClient.java new file mode 100644 index 000000000000..740b36c91725 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClient.java @@ -0,0 +1,1756 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +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.cloud.cloudcontrolspartner.v1.stub.CloudControlsPartnerCoreStub; +import com.google.cloud.cloudcontrolspartner.v1.stub.CloudControlsPartnerCoreStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create()) {
+ *   WorkloadName name =
+ *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+ *   Workload response = cloudControlsPartnerCoreClient.getWorkload(name);
+ * }
+ * }
+ * + *

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

GetWorkload

Gets details of a single workload

+ *

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

+ *
    + *
  • getWorkload(GetWorkloadRequest request) + *

+ *

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

+ *
    + *
  • getWorkload(WorkloadName name) + *

  • getWorkload(String name) + *

+ *

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

+ *
    + *
  • getWorkloadCallable() + *

+ *

ListWorkloads

Lists customer workloads for a given customer org id

+ *

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

+ *
    + *
  • listWorkloads(ListWorkloadsRequest request) + *

+ *

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

+ *
    + *
  • listWorkloads(CustomerName parent) + *

  • listWorkloads(String parent) + *

+ *

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

+ *
    + *
  • listWorkloadsPagedCallable() + *

  • listWorkloadsCallable() + *

+ *

GetCustomer

Gets details of a single customer

+ *

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

+ *
    + *
  • getCustomer(GetCustomerRequest request) + *

+ *

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

+ *
    + *
  • getCustomer(CustomerName name) + *

  • getCustomer(String name) + *

+ *

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

+ *
    + *
  • getCustomerCallable() + *

+ *

ListCustomers

Lists customers of a partner identified by its Google Cloud organization ID

+ *

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

+ *
    + *
  • listCustomers(ListCustomersRequest request) + *

+ *

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

+ *
    + *
  • listCustomers(OrganizationLocationName parent) + *

  • listCustomers(String parent) + *

+ *

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

+ *
    + *
  • listCustomersPagedCallable() + *

  • listCustomersCallable() + *

+ *

GetEkmConnections

Gets the EKM connections associated with a workload

+ *

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

+ *
    + *
  • getEkmConnections(GetEkmConnectionsRequest request) + *

+ *

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

+ *
    + *
  • getEkmConnections(EkmConnectionsName name) + *

  • getEkmConnections(String name) + *

+ *

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

+ *
    + *
  • getEkmConnectionsCallable() + *

+ *

GetPartnerPermissions

Gets the partner permissions granted for a workload

+ *

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

+ *
    + *
  • getPartnerPermissions(GetPartnerPermissionsRequest request) + *

+ *

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

+ *
    + *
  • getPartnerPermissions(PartnerPermissionsName name) + *

  • getPartnerPermissions(String name) + *

+ *

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

+ *
    + *
  • getPartnerPermissionsCallable() + *

+ *

ListAccessApprovalRequests

Lists access requests associated with a workload

+ *

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

+ *
    + *
  • listAccessApprovalRequests(ListAccessApprovalRequestsRequest request) + *

+ *

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

+ *
    + *
  • listAccessApprovalRequests(WorkloadName parent) + *

  • listAccessApprovalRequests(String parent) + *

+ *

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

+ *
    + *
  • listAccessApprovalRequestsPagedCallable() + *

  • listAccessApprovalRequestsCallable() + *

+ *

GetPartner

Get details of a Partner.

+ *

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

+ *
    + *
  • getPartner(GetPartnerRequest request) + *

+ *

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

+ *
    + *
  • getPartner(PartnerName name) + *

  • getPartner(String name) + *

+ *

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

+ *
    + *
  • getPartnerCallable() + *

+ *
+ * + *

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 + * CloudControlsPartnerCoreSettings 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
+ * CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings =
+ *     CloudControlsPartnerCoreSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings);
+ * }
+ * + *

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
+ * CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings =
+ *     CloudControlsPartnerCoreSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings);
+ * }
+ * + *

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
+ * CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings =
+ *     CloudControlsPartnerCoreSettings.newHttpJsonBuilder().build();
+ * CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings);
+ * }
+ * + *

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

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   WorkloadName name =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   Workload response = cloudControlsPartnerCoreClient.getWorkload(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workload getWorkload(WorkloadName name) { + GetWorkloadRequest request = + GetWorkloadRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString();
+   *   Workload response = cloudControlsPartnerCoreClient.getWorkload(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workload getWorkload(String name) { + GetWorkloadRequest request = GetWorkloadRequest.newBuilder().setName(name).build(); + return getWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetWorkloadRequest request =
+   *       GetWorkloadRequest.newBuilder()
+   *           .setName(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   Workload response = cloudControlsPartnerCoreClient.getWorkload(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 Workload getWorkload(GetWorkloadRequest request) { + return getWorkloadCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetWorkloadRequest request =
+   *       GetWorkloadRequest.newBuilder()
+   *           .setName(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getWorkloadCallable().futureCall(request);
+   *   // Do something.
+   *   Workload response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getWorkloadCallable() { + return stub.getWorkloadCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]");
+   *   for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * `organizations/{organization}/locations/{location}/customers/{customer}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkloadsPagedResponse listWorkloads(CustomerName parent) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listWorkloads(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString();
+   *   for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * `organizations/{organization}/locations/{location}/customers/{customer}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkloadsPagedResponse listWorkloads(String parent) { + ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder().setParent(parent).build(); + return listWorkloads(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListWorkloadsRequest request =
+   *       ListWorkloadsRequest.newBuilder()
+   *           .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(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 ListWorkloadsPagedResponse listWorkloads(ListWorkloadsRequest request) { + return listWorkloadsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListWorkloadsRequest request =
+   *       ListWorkloadsRequest.newBuilder()
+   *           .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.listWorkloadsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Workload element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkloadsPagedCallable() { + return stub.listWorkloadsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListWorkloadsRequest request =
+   *       ListWorkloadsRequest.newBuilder()
+   *           .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListWorkloadsResponse response =
+   *         cloudControlsPartnerCoreClient.listWorkloadsCallable().call(request);
+   *     for (Workload element : response.getWorkloadsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listWorkloadsCallable() { + return stub.listWorkloadsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single customer + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]");
+   *   Customer response = cloudControlsPartnerCoreClient.getCustomer(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Customer getCustomer(CustomerName name) { + GetCustomerRequest request = + GetCustomerRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCustomer(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single customer + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString();
+   *   Customer response = cloudControlsPartnerCoreClient.getCustomer(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Customer getCustomer(String name) { + GetCustomerRequest request = GetCustomerRequest.newBuilder().setName(name).build(); + return getCustomer(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single customer + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetCustomerRequest request =
+   *       GetCustomerRequest.newBuilder()
+   *           .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .build();
+   *   Customer response = cloudControlsPartnerCoreClient.getCustomer(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 Customer getCustomer(GetCustomerRequest request) { + return getCustomerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single customer + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetCustomerRequest request =
+   *       GetCustomerRequest.newBuilder()
+   *           .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getCustomerCallable().futureCall(request);
+   *   // Do something.
+   *   Customer response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCustomerCallable() { + return stub.getCustomerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (Customer element : cloudControlsPartnerCoreClient.listCustomers(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * `organizations/{organization}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomersPagedResponse listCustomers(OrganizationLocationName parent) { + ListCustomersRequest request = + ListCustomersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCustomers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   for (Customer element : cloudControlsPartnerCoreClient.listCustomers(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * `organizations/{organization}/locations/{location}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomersPagedResponse listCustomers(String parent) { + ListCustomersRequest request = ListCustomersRequest.newBuilder().setParent(parent).build(); + return listCustomers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListCustomersRequest request =
+   *       ListCustomersRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Customer element : cloudControlsPartnerCoreClient.listCustomers(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 ListCustomersPagedResponse listCustomers(ListCustomersRequest request) { + return listCustomersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListCustomersRequest request =
+   *       ListCustomersRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.listCustomersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Customer element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCustomersPagedCallable() { + return stub.listCustomersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListCustomersRequest request =
+   *       ListCustomersRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListCustomersResponse response =
+   *         cloudControlsPartnerCoreClient.listCustomersCallable().call(request);
+   *     for (Customer element : response.getCustomersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listCustomersCallable() { + return stub.listCustomersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the EKM connections associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   EkmConnectionsName name =
+   *       EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EkmConnections getEkmConnections(EkmConnectionsName name) { + GetEkmConnectionsRequest request = + GetEkmConnectionsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getEkmConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the EKM connections associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name =
+   *       EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *           .toString();
+   *   EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EkmConnections getEkmConnections(String name) { + GetEkmConnectionsRequest request = GetEkmConnectionsRequest.newBuilder().setName(name).build(); + return getEkmConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the EKM connections associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetEkmConnectionsRequest request =
+   *       GetEkmConnectionsRequest.newBuilder()
+   *           .setName(
+   *               EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(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 EkmConnections getEkmConnections(GetEkmConnectionsRequest request) { + return getEkmConnectionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the EKM connections associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetEkmConnectionsRequest request =
+   *       GetEkmConnectionsRequest.newBuilder()
+   *           .setName(
+   *               EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getEkmConnectionsCallable().futureCall(request);
+   *   // Do something.
+   *   EkmConnections response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getEkmConnectionsCallable() { + return stub.getEkmConnectionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the partner permissions granted for a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   PartnerPermissionsName name =
+   *       PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource to get in the format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PartnerPermissions getPartnerPermissions(PartnerPermissionsName name) { + GetPartnerPermissionsRequest request = + GetPartnerPermissionsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getPartnerPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the partner permissions granted for a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name =
+   *       PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *           .toString();
+   *   PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource to get in the format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PartnerPermissions getPartnerPermissions(String name) { + GetPartnerPermissionsRequest request = + GetPartnerPermissionsRequest.newBuilder().setName(name).build(); + return getPartnerPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the partner permissions granted for a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetPartnerPermissionsRequest request =
+   *       GetPartnerPermissionsRequest.newBuilder()
+   *           .setName(
+   *               PartnerPermissionsName.of(
+   *                       "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(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 PartnerPermissions getPartnerPermissions(GetPartnerPermissionsRequest request) { + return getPartnerPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the partner permissions granted for a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetPartnerPermissionsRequest request =
+   *       GetPartnerPermissionsRequest.newBuilder()
+   *           .setName(
+   *               PartnerPermissionsName.of(
+   *                       "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getPartnerPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   PartnerPermissions response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getPartnerPermissionsCallable() { + return stub.getPartnerPermissionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   WorkloadName parent =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   for (AccessApprovalRequest element :
+   *       cloudControlsPartnerCoreClient.listAccessApprovalRequests(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAccessApprovalRequestsPagedResponse listAccessApprovalRequests( + WorkloadName parent) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAccessApprovalRequests(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String parent =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString();
+   *   for (AccessApprovalRequest element :
+   *       cloudControlsPartnerCoreClient.listAccessApprovalRequests(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAccessApprovalRequestsPagedResponse listAccessApprovalRequests(String parent) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder().setParent(parent).build(); + return listAccessApprovalRequests(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListAccessApprovalRequestsRequest request =
+   *       ListAccessApprovalRequestsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (AccessApprovalRequest element :
+   *       cloudControlsPartnerCoreClient.listAccessApprovalRequests(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 ListAccessApprovalRequestsPagedResponse listAccessApprovalRequests( + ListAccessApprovalRequestsRequest request) { + return listAccessApprovalRequestsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListAccessApprovalRequestsRequest request =
+   *       ListAccessApprovalRequestsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient
+   *           .listAccessApprovalRequestsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (AccessApprovalRequest element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsPagedCallable() { + return stub.listAccessApprovalRequestsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListAccessApprovalRequestsRequest request =
+   *       ListAccessApprovalRequestsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListAccessApprovalRequestsResponse response =
+   *         cloudControlsPartnerCoreClient.listAccessApprovalRequestsCallable().call(request);
+   *     for (AccessApprovalRequest element : response.getAccessApprovalRequestsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAccessApprovalRequestsCallable() { + return stub.listAccessApprovalRequestsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details of a Partner. + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]");
+   *   Partner response = cloudControlsPartnerCoreClient.getPartner(name);
+   * }
+   * }
+ * + * @param name Required. Format: `organizations/{organization}/locations/{location}/partner` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Partner getPartner(PartnerName name) { + GetPartnerRequest request = + GetPartnerRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPartner(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details of a Partner. + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name = PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   Partner response = cloudControlsPartnerCoreClient.getPartner(name);
+   * }
+   * }
+ * + * @param name Required. Format: `organizations/{organization}/locations/{location}/partner` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Partner getPartner(String name) { + GetPartnerRequest request = GetPartnerRequest.newBuilder().setName(name).build(); + return getPartner(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details of a Partner. + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetPartnerRequest request =
+   *       GetPartnerRequest.newBuilder()
+   *           .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .build();
+   *   Partner response = cloudControlsPartnerCoreClient.getPartner(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 Partner getPartner(GetPartnerRequest request) { + return getPartnerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details of a Partner. + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetPartnerRequest request =
+   *       GetPartnerRequest.newBuilder()
+   *           .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getPartnerCallable().futureCall(request);
+   *   // Do something.
+   *   Partner response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getPartnerCallable() { + return stub.getPartnerCallable(); + } + + @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 ListWorkloadsPagedResponse + extends AbstractPagedListResponse< + ListWorkloadsRequest, + ListWorkloadsResponse, + Workload, + ListWorkloadsPage, + ListWorkloadsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListWorkloadsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListWorkloadsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListWorkloadsPagedResponse(ListWorkloadsPage page) { + super(page, ListWorkloadsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListWorkloadsPage + extends AbstractPage< + ListWorkloadsRequest, ListWorkloadsResponse, Workload, ListWorkloadsPage> { + + private ListWorkloadsPage( + PageContext context, + ListWorkloadsResponse response) { + super(context, response); + } + + private static ListWorkloadsPage createEmptyPage() { + return new ListWorkloadsPage(null, null); + } + + @Override + protected ListWorkloadsPage createPage( + PageContext context, + ListWorkloadsResponse response) { + return new ListWorkloadsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListWorkloadsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListWorkloadsRequest, + ListWorkloadsResponse, + Workload, + ListWorkloadsPage, + ListWorkloadsFixedSizeCollection> { + + private ListWorkloadsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListWorkloadsFixedSizeCollection createEmptyCollection() { + return new ListWorkloadsFixedSizeCollection(null, 0); + } + + @Override + protected ListWorkloadsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListWorkloadsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListCustomersPagedResponse + extends AbstractPagedListResponse< + ListCustomersRequest, + ListCustomersResponse, + Customer, + ListCustomersPage, + ListCustomersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCustomersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListCustomersPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListCustomersPagedResponse(ListCustomersPage page) { + super(page, ListCustomersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCustomersPage + extends AbstractPage< + ListCustomersRequest, ListCustomersResponse, Customer, ListCustomersPage> { + + private ListCustomersPage( + PageContext context, + ListCustomersResponse response) { + super(context, response); + } + + private static ListCustomersPage createEmptyPage() { + return new ListCustomersPage(null, null); + } + + @Override + protected ListCustomersPage createPage( + PageContext context, + ListCustomersResponse response) { + return new ListCustomersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCustomersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCustomersRequest, + ListCustomersResponse, + Customer, + ListCustomersPage, + ListCustomersFixedSizeCollection> { + + private ListCustomersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCustomersFixedSizeCollection createEmptyCollection() { + return new ListCustomersFixedSizeCollection(null, 0); + } + + @Override + protected ListCustomersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCustomersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAccessApprovalRequestsPagedResponse + extends AbstractPagedListResponse< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest, + ListAccessApprovalRequestsPage, + ListAccessApprovalRequestsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAccessApprovalRequestsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAccessApprovalRequestsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAccessApprovalRequestsPagedResponse(ListAccessApprovalRequestsPage page) { + super(page, ListAccessApprovalRequestsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAccessApprovalRequestsPage + extends AbstractPage< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest, + ListAccessApprovalRequestsPage> { + + private ListAccessApprovalRequestsPage( + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + context, + ListAccessApprovalRequestsResponse response) { + super(context, response); + } + + private static ListAccessApprovalRequestsPage createEmptyPage() { + return new ListAccessApprovalRequestsPage(null, null); + } + + @Override + protected ListAccessApprovalRequestsPage createPage( + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + context, + ListAccessApprovalRequestsResponse response) { + return new ListAccessApprovalRequestsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAccessApprovalRequestsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest, + ListAccessApprovalRequestsPage, + ListAccessApprovalRequestsFixedSizeCollection> { + + private ListAccessApprovalRequestsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAccessApprovalRequestsFixedSizeCollection createEmptyCollection() { + return new ListAccessApprovalRequestsFixedSizeCollection(null, 0); + } + + @Override + protected ListAccessApprovalRequestsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAccessApprovalRequestsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreSettings.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreSettings.java new file mode 100644 index 000000000000..bea80d7afa91 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreSettings.java @@ -0,0 +1,300 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.cloudcontrolspartner.v1.stub.CloudControlsPartnerCoreStubSettings; +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 CloudControlsPartnerCoreClient}. + * + *

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

    + *
  • The default service address (cloudcontrolspartner.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 getWorkload 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
+ * CloudControlsPartnerCoreSettings.Builder cloudControlsPartnerCoreSettingsBuilder =
+ *     CloudControlsPartnerCoreSettings.newBuilder();
+ * cloudControlsPartnerCoreSettingsBuilder
+ *     .getWorkloadSettings()
+ *     .setRetrySettings(
+ *         cloudControlsPartnerCoreSettingsBuilder
+ *             .getWorkloadSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings =
+ *     cloudControlsPartnerCoreSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudControlsPartnerCoreSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to getWorkload. */ + public UnaryCallSettings getWorkloadSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).getWorkloadSettings(); + } + + /** Returns the object with the settings used for calls to listWorkloads. */ + public PagedCallSettings + listWorkloadsSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).listWorkloadsSettings(); + } + + /** Returns the object with the settings used for calls to getCustomer. */ + public UnaryCallSettings getCustomerSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).getCustomerSettings(); + } + + /** Returns the object with the settings used for calls to listCustomers. */ + public PagedCallSettings + listCustomersSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).listCustomersSettings(); + } + + /** Returns the object with the settings used for calls to getEkmConnections. */ + public UnaryCallSettings getEkmConnectionsSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).getEkmConnectionsSettings(); + } + + /** Returns the object with the settings used for calls to getPartnerPermissions. */ + public UnaryCallSettings + getPartnerPermissionsSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()) + .getPartnerPermissionsSettings(); + } + + /** Returns the object with the settings used for calls to listAccessApprovalRequests. */ + public PagedCallSettings< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()) + .listAccessApprovalRequestsSettings(); + } + + /** Returns the object with the settings used for calls to getPartner. */ + public UnaryCallSettings getPartnerSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).getPartnerSettings(); + } + + public static final CloudControlsPartnerCoreSettings create( + CloudControlsPartnerCoreStubSettings stub) throws IOException { + return new CloudControlsPartnerCoreSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudControlsPartnerCoreStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudControlsPartnerCoreStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudControlsPartnerCoreStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudControlsPartnerCoreSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudControlsPartnerCoreSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudControlsPartnerCoreStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudControlsPartnerCoreSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudControlsPartnerCoreStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudControlsPartnerCoreStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(CloudControlsPartnerCoreStubSettings.newHttpJsonBuilder()); + } + + public CloudControlsPartnerCoreStubSettings.Builder getStubSettingsBuilder() { + return ((CloudControlsPartnerCoreStubSettings.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 getWorkload. */ + public UnaryCallSettings.Builder getWorkloadSettings() { + return getStubSettingsBuilder().getWorkloadSettings(); + } + + /** Returns the builder for the settings used for calls to listWorkloads. */ + public PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings() { + return getStubSettingsBuilder().listWorkloadsSettings(); + } + + /** Returns the builder for the settings used for calls to getCustomer. */ + public UnaryCallSettings.Builder getCustomerSettings() { + return getStubSettingsBuilder().getCustomerSettings(); + } + + /** Returns the builder for the settings used for calls to listCustomers. */ + public PagedCallSettings.Builder< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + listCustomersSettings() { + return getStubSettingsBuilder().listCustomersSettings(); + } + + /** Returns the builder for the settings used for calls to getEkmConnections. */ + public UnaryCallSettings.Builder + getEkmConnectionsSettings() { + return getStubSettingsBuilder().getEkmConnectionsSettings(); + } + + /** Returns the builder for the settings used for calls to getPartnerPermissions. */ + public UnaryCallSettings.Builder + getPartnerPermissionsSettings() { + return getStubSettingsBuilder().getPartnerPermissionsSettings(); + } + + /** Returns the builder for the settings used for calls to listAccessApprovalRequests. */ + public PagedCallSettings.Builder< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings() { + return getStubSettingsBuilder().listAccessApprovalRequestsSettings(); + } + + /** Returns the builder for the settings used for calls to getPartner. */ + public UnaryCallSettings.Builder getPartnerSettings() { + return getStubSettingsBuilder().getPartnerSettings(); + } + + @Override + public CloudControlsPartnerCoreSettings build() throws IOException { + return new CloudControlsPartnerCoreSettings(this); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClient.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClient.java new file mode 100644 index 000000000000..9c6ed6b875a1 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClient.java @@ -0,0 +1,657 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +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.cloud.cloudcontrolspartner.v1.stub.CloudControlsPartnerMonitoringStub; +import com.google.cloud.cloudcontrolspartner.v1.stub.CloudControlsPartnerMonitoringStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create()) {
+ *   ViolationName name =
+ *       ViolationName.of(
+ *           "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
+ *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(name);
+ * }
+ * }
+ * + *

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

ListViolations

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`

+ *

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

+ *
    + *
  • listViolations(ListViolationsRequest request) + *

+ *

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

+ *
    + *
  • listViolations(WorkloadName parent) + *

  • listViolations(String parent) + *

+ *

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

+ *
    + *
  • listViolationsPagedCallable() + *

  • listViolationsCallable() + *

+ *

GetViolation

Gets details of a single Violation.

+ *

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

+ *
    + *
  • getViolation(GetViolationRequest request) + *

+ *

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

+ *
    + *
  • getViolation(ViolationName name) + *

  • getViolation(String name) + *

+ *

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

+ *
    + *
  • getViolationCallable() + *

+ *
+ * + *

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 + * CloudControlsPartnerMonitoringSettings 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
+ * CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings =
+ *     CloudControlsPartnerMonitoringSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings);
+ * }
+ * + *

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
+ * CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings =
+ *     CloudControlsPartnerMonitoringSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings);
+ * }
+ * + *

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
+ * CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings =
+ *     CloudControlsPartnerMonitoringSettings.newHttpJsonBuilder().build();
+ * CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringClient implements BackgroundResource { + private final CloudControlsPartnerMonitoringSettings settings; + private final CloudControlsPartnerMonitoringStub stub; + + /** Constructs an instance of CloudControlsPartnerMonitoringClient with default settings. */ + public static final CloudControlsPartnerMonitoringClient create() throws IOException { + return create(CloudControlsPartnerMonitoringSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudControlsPartnerMonitoringClient, 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 CloudControlsPartnerMonitoringClient create( + CloudControlsPartnerMonitoringSettings settings) throws IOException { + return new CloudControlsPartnerMonitoringClient(settings); + } + + /** + * Constructs an instance of CloudControlsPartnerMonitoringClient, using the given stub for making + * calls. This is for advanced usage - prefer using + * create(CloudControlsPartnerMonitoringSettings). + */ + public static final CloudControlsPartnerMonitoringClient create( + CloudControlsPartnerMonitoringStub stub) { + return new CloudControlsPartnerMonitoringClient(stub); + } + + /** + * Constructs an instance of CloudControlsPartnerMonitoringClient, 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 CloudControlsPartnerMonitoringClient(CloudControlsPartnerMonitoringSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((CloudControlsPartnerMonitoringStubSettings) settings.getStubSettings()).createStub(); + } + + protected CloudControlsPartnerMonitoringClient(CloudControlsPartnerMonitoringStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CloudControlsPartnerMonitoringSettings getSettings() { + return settings; + } + + public CloudControlsPartnerMonitoringStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   WorkloadName parent =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   for (Violation element :
+   *       cloudControlsPartnerMonitoringClient.listViolations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViolationsPagedResponse listViolations(WorkloadName parent) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listViolations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   String parent =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString();
+   *   for (Violation element :
+   *       cloudControlsPartnerMonitoringClient.listViolations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViolationsPagedResponse listViolations(String parent) { + ListViolationsRequest request = ListViolationsRequest.newBuilder().setParent(parent).build(); + return listViolations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setInterval(Interval.newBuilder().build())
+   *           .build();
+   *   for (Violation element :
+   *       cloudControlsPartnerMonitoringClient.listViolations(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 ListViolationsPagedResponse listViolations(ListViolationsRequest request) { + return listViolationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setInterval(Interval.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerMonitoringClient.listViolationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Violation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listViolationsPagedCallable() { + return stub.listViolationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setInterval(Interval.newBuilder().build())
+   *           .build();
+   *   while (true) {
+   *     ListViolationsResponse response =
+   *         cloudControlsPartnerMonitoringClient.listViolationsCallable().call(request);
+   *     for (Violation element : response.getViolationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listViolationsCallable() { + return stub.listViolationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Violation. + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   ViolationName name =
+   *       ViolationName.of(
+   *           "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
+   *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Violation getViolation(ViolationName name) { + GetViolationRequest request = + GetViolationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getViolation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Violation. + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   String name =
+   *       ViolationName.of(
+   *               "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]")
+   *           .toString();
+   *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Violation getViolation(String name) { + GetViolationRequest request = GetViolationRequest.newBuilder().setName(name).build(); + return getViolation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Violation. + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   GetViolationRequest request =
+   *       GetViolationRequest.newBuilder()
+   *           .setName(
+   *               ViolationName.of(
+   *                       "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]")
+   *                   .toString())
+   *           .build();
+   *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(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 Violation getViolation(GetViolationRequest request) { + return getViolationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Violation. + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   GetViolationRequest request =
+   *       GetViolationRequest.newBuilder()
+   *           .setName(
+   *               ViolationName.of(
+   *                       "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerMonitoringClient.getViolationCallable().futureCall(request);
+   *   // Do something.
+   *   Violation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getViolationCallable() { + return stub.getViolationCallable(); + } + + @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 ListViolationsPagedResponse + extends AbstractPagedListResponse< + ListViolationsRequest, + ListViolationsResponse, + Violation, + ListViolationsPage, + ListViolationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListViolationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListViolationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListViolationsPagedResponse(ListViolationsPage page) { + super(page, ListViolationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListViolationsPage + extends AbstractPage< + ListViolationsRequest, ListViolationsResponse, Violation, ListViolationsPage> { + + private ListViolationsPage( + PageContext context, + ListViolationsResponse response) { + super(context, response); + } + + private static ListViolationsPage createEmptyPage() { + return new ListViolationsPage(null, null); + } + + @Override + protected ListViolationsPage createPage( + PageContext context, + ListViolationsResponse response) { + return new ListViolationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListViolationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListViolationsRequest, + ListViolationsResponse, + Violation, + ListViolationsPage, + ListViolationsFixedSizeCollection> { + + private ListViolationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListViolationsFixedSizeCollection createEmptyCollection() { + return new ListViolationsFixedSizeCollection(null, 0); + } + + @Override + protected ListViolationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListViolationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringSettings.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringSettings.java new file mode 100644 index 000000000000..5f43ff0dace6 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringSettings.java @@ -0,0 +1,224 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.cloudcontrolspartner.v1.stub.CloudControlsPartnerMonitoringStubSettings; +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 CloudControlsPartnerMonitoringClient}. + * + *

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

    + *
  • The default service address (cloudcontrolspartner.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 getViolation 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
+ * CloudControlsPartnerMonitoringSettings.Builder cloudControlsPartnerMonitoringSettingsBuilder =
+ *     CloudControlsPartnerMonitoringSettings.newBuilder();
+ * cloudControlsPartnerMonitoringSettingsBuilder
+ *     .getViolationSettings()
+ *     .setRetrySettings(
+ *         cloudControlsPartnerMonitoringSettingsBuilder
+ *             .getViolationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings =
+ *     cloudControlsPartnerMonitoringSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to listViolations. */ + public PagedCallSettings< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return ((CloudControlsPartnerMonitoringStubSettings) getStubSettings()) + .listViolationsSettings(); + } + + /** Returns the object with the settings used for calls to getViolation. */ + public UnaryCallSettings getViolationSettings() { + return ((CloudControlsPartnerMonitoringStubSettings) getStubSettings()).getViolationSettings(); + } + + public static final CloudControlsPartnerMonitoringSettings create( + CloudControlsPartnerMonitoringStubSettings stub) throws IOException { + return new CloudControlsPartnerMonitoringSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudControlsPartnerMonitoringStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudControlsPartnerMonitoringStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudControlsPartnerMonitoringStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudControlsPartnerMonitoringSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudControlsPartnerMonitoringSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudControlsPartnerMonitoringStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudControlsPartnerMonitoringSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudControlsPartnerMonitoringStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudControlsPartnerMonitoringStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(CloudControlsPartnerMonitoringStubSettings.newHttpJsonBuilder()); + } + + public CloudControlsPartnerMonitoringStubSettings.Builder getStubSettingsBuilder() { + return ((CloudControlsPartnerMonitoringStubSettings.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 listViolations. */ + public PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return getStubSettingsBuilder().listViolationsSettings(); + } + + /** Returns the builder for the settings used for calls to getViolation. */ + public UnaryCallSettings.Builder getViolationSettings() { + return getStubSettingsBuilder().getViolationSettings(); + } + + @Override + public CloudControlsPartnerMonitoringSettings build() throws IOException { + return new CloudControlsPartnerMonitoringSettings(this); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/gapic_metadata.json b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/gapic_metadata.json new file mode 100644 index 000000000000..33e31b85568a --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/gapic_metadata.json @@ -0,0 +1,57 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.cloudcontrolspartner.v1", + "libraryPackage": "com.google.cloud.cloudcontrolspartner.v1", + "services": { + "CloudControlsPartnerCore": { + "clients": { + "grpc": { + "libraryClient": "CloudControlsPartnerCoreClient", + "rpcs": { + "GetCustomer": { + "methods": ["getCustomer", "getCustomer", "getCustomer", "getCustomerCallable"] + }, + "GetEkmConnections": { + "methods": ["getEkmConnections", "getEkmConnections", "getEkmConnections", "getEkmConnectionsCallable"] + }, + "GetPartner": { + "methods": ["getPartner", "getPartner", "getPartner", "getPartnerCallable"] + }, + "GetPartnerPermissions": { + "methods": ["getPartnerPermissions", "getPartnerPermissions", "getPartnerPermissions", "getPartnerPermissionsCallable"] + }, + "GetWorkload": { + "methods": ["getWorkload", "getWorkload", "getWorkload", "getWorkloadCallable"] + }, + "ListAccessApprovalRequests": { + "methods": ["listAccessApprovalRequests", "listAccessApprovalRequests", "listAccessApprovalRequests", "listAccessApprovalRequestsPagedCallable", "listAccessApprovalRequestsCallable"] + }, + "ListCustomers": { + "methods": ["listCustomers", "listCustomers", "listCustomers", "listCustomersPagedCallable", "listCustomersCallable"] + }, + "ListWorkloads": { + "methods": ["listWorkloads", "listWorkloads", "listWorkloads", "listWorkloadsPagedCallable", "listWorkloadsCallable"] + } + } + } + } + }, + "CloudControlsPartnerMonitoring": { + "clients": { + "grpc": { + "libraryClient": "CloudControlsPartnerMonitoringClient", + "rpcs": { + "GetViolation": { + "methods": ["getViolation", "getViolation", "getViolation", "getViolationCallable"] + }, + "ListViolations": { + "methods": ["listViolations", "listViolations", "listViolations", "listViolationsPagedCallable", "listViolationsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/package-info.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/package-info.java new file mode 100644 index 000000000000..59503768e455 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/package-info.java @@ -0,0 +1,66 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Controls Partner API + * + *

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

======================= CloudControlsPartnerCoreClient ======================= + * + *

Service Description: Service describing handlers for resources + * + *

Sample for CloudControlsPartnerCoreClient: + * + *

{@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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create()) {
+ *   WorkloadName name =
+ *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+ *   Workload response = cloudControlsPartnerCoreClient.getWorkload(name);
+ * }
+ * }
+ * + *

======================= CloudControlsPartnerMonitoringClient ======================= + * + *

Service Description: Service describing handlers for resources + * + *

Sample for CloudControlsPartnerMonitoringClient: + * + *

{@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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create()) {
+ *   ViolationName name =
+ *       ViolationName.of(
+ *           "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
+ *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.cloudcontrolspartner.v1; + +import javax.annotation.Generated; diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerCoreStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerCoreStub.java new file mode 100644 index 000000000000..f8d7e78df13d --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerCoreStub.java @@ -0,0 +1,105 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Partner; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudControlsPartnerCore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CloudControlsPartnerCoreStub implements BackgroundResource { + + public UnaryCallable getWorkloadCallable() { + throw new UnsupportedOperationException("Not implemented: getWorkloadCallable()"); + } + + public UnaryCallable + listWorkloadsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkloadsPagedCallable()"); + } + + public UnaryCallable listWorkloadsCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkloadsCallable()"); + } + + public UnaryCallable getCustomerCallable() { + throw new UnsupportedOperationException("Not implemented: getCustomerCallable()"); + } + + public UnaryCallable + listCustomersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomersPagedCallable()"); + } + + public UnaryCallable listCustomersCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomersCallable()"); + } + + public UnaryCallable getEkmConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: getEkmConnectionsCallable()"); + } + + public UnaryCallable + getPartnerPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: getPartnerPermissionsCallable()"); + } + + public UnaryCallable + listAccessApprovalRequestsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listAccessApprovalRequestsPagedCallable()"); + } + + public UnaryCallable + listAccessApprovalRequestsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listAccessApprovalRequestsCallable()"); + } + + public UnaryCallable getPartnerCallable() { + throw new UnsupportedOperationException("Not implemented: getPartnerCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerCoreStubSettings.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerCoreStubSettings.java new file mode 100644 index 000000000000..4b1ad839e514 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerCoreStubSettings.java @@ -0,0 +1,756 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Partner; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +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 CloudControlsPartnerCoreStub}. + * + *

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

    + *
  • The default service address (cloudcontrolspartner.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 getWorkload 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
+ * CloudControlsPartnerCoreStubSettings.Builder cloudControlsPartnerCoreSettingsBuilder =
+ *     CloudControlsPartnerCoreStubSettings.newBuilder();
+ * cloudControlsPartnerCoreSettingsBuilder
+ *     .getWorkloadSettings()
+ *     .setRetrySettings(
+ *         cloudControlsPartnerCoreSettingsBuilder
+ *             .getWorkloadSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudControlsPartnerCoreStubSettings cloudControlsPartnerCoreSettings =
+ *     cloudControlsPartnerCoreSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudControlsPartnerCoreStubSettings + 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 UnaryCallSettings getWorkloadSettings; + private final PagedCallSettings< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings; + private final UnaryCallSettings getCustomerSettings; + private final PagedCallSettings< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + listCustomersSettings; + private final UnaryCallSettings + getEkmConnectionsSettings; + private final UnaryCallSettings + getPartnerPermissionsSettings; + private final PagedCallSettings< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings; + private final UnaryCallSettings getPartnerSettings; + + private static final PagedListDescriptor + LIST_WORKLOADS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWorkloadsRequest injectToken(ListWorkloadsRequest payload, String token) { + return ListWorkloadsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWorkloadsRequest injectPageSize(ListWorkloadsRequest payload, int pageSize) { + return ListWorkloadsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWorkloadsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWorkloadsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWorkloadsResponse payload) { + return payload.getWorkloadsList() == null + ? ImmutableList.of() + : payload.getWorkloadsList(); + } + }; + + private static final PagedListDescriptor + LIST_CUSTOMERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCustomersRequest injectToken(ListCustomersRequest payload, String token) { + return ListCustomersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCustomersRequest injectPageSize(ListCustomersRequest payload, int pageSize) { + return ListCustomersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCustomersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCustomersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCustomersResponse payload) { + return payload.getCustomersList() == null + ? ImmutableList.of() + : payload.getCustomersList(); + } + }; + + private static final PagedListDescriptor< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + LIST_ACCESS_APPROVAL_REQUESTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAccessApprovalRequestsRequest injectToken( + ListAccessApprovalRequestsRequest payload, String token) { + return ListAccessApprovalRequestsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListAccessApprovalRequestsRequest injectPageSize( + ListAccessApprovalRequestsRequest payload, int pageSize) { + return ListAccessApprovalRequestsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListAccessApprovalRequestsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAccessApprovalRequestsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAccessApprovalRequestsResponse payload) { + return payload.getAccessApprovalRequestsList() == null + ? ImmutableList.of() + : payload.getAccessApprovalRequestsList(); + } + }; + + private static final PagedListResponseFactory< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + LIST_WORKLOADS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWorkloadsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_WORKLOADS_PAGE_STR_DESC, request, context); + return ListWorkloadsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + LIST_CUSTOMERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCustomersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CUSTOMERS_PAGE_STR_DESC, request, context); + return ListCustomersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + LIST_ACCESS_APPROVAL_REQUESTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListAccessApprovalRequestsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + pageContext = + PageContext.create( + callable, LIST_ACCESS_APPROVAL_REQUESTS_PAGE_STR_DESC, request, context); + return ListAccessApprovalRequestsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getWorkload. */ + public UnaryCallSettings getWorkloadSettings() { + return getWorkloadSettings; + } + + /** Returns the object with the settings used for calls to listWorkloads. */ + public PagedCallSettings + listWorkloadsSettings() { + return listWorkloadsSettings; + } + + /** Returns the object with the settings used for calls to getCustomer. */ + public UnaryCallSettings getCustomerSettings() { + return getCustomerSettings; + } + + /** Returns the object with the settings used for calls to listCustomers. */ + public PagedCallSettings + listCustomersSettings() { + return listCustomersSettings; + } + + /** Returns the object with the settings used for calls to getEkmConnections. */ + public UnaryCallSettings getEkmConnectionsSettings() { + return getEkmConnectionsSettings; + } + + /** Returns the object with the settings used for calls to getPartnerPermissions. */ + public UnaryCallSettings + getPartnerPermissionsSettings() { + return getPartnerPermissionsSettings; + } + + /** Returns the object with the settings used for calls to listAccessApprovalRequests. */ + public PagedCallSettings< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings() { + return listAccessApprovalRequestsSettings; + } + + /** Returns the object with the settings used for calls to getPartner. */ + public UnaryCallSettings getPartnerSettings() { + return getPartnerSettings; + } + + public CloudControlsPartnerCoreStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudControlsPartnerCoreStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudControlsPartnerCoreStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudcontrolspartner"; + } + + /** 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 "cloudcontrolspartner.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudcontrolspartner.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudControlsPartnerCoreStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudControlsPartnerCoreStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.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 CloudControlsPartnerCoreStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getWorkloadSettings = settingsBuilder.getWorkloadSettings().build(); + listWorkloadsSettings = settingsBuilder.listWorkloadsSettings().build(); + getCustomerSettings = settingsBuilder.getCustomerSettings().build(); + listCustomersSettings = settingsBuilder.listCustomersSettings().build(); + getEkmConnectionsSettings = settingsBuilder.getEkmConnectionsSettings().build(); + getPartnerPermissionsSettings = settingsBuilder.getPartnerPermissionsSettings().build(); + listAccessApprovalRequestsSettings = + settingsBuilder.listAccessApprovalRequestsSettings().build(); + getPartnerSettings = settingsBuilder.getPartnerSettings().build(); + } + + /** Builder for CloudControlsPartnerCoreStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getWorkloadSettings; + private final PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings; + private final UnaryCallSettings.Builder getCustomerSettings; + private final PagedCallSettings.Builder< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + listCustomersSettings; + private final UnaryCallSettings.Builder + getEkmConnectionsSettings; + private final UnaryCallSettings.Builder + getPartnerPermissionsSettings; + private final PagedCallSettings.Builder< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings; + private final UnaryCallSettings.Builder getPartnerSettings; + 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))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + 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); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listWorkloadsSettings = PagedCallSettings.newBuilder(LIST_WORKLOADS_PAGE_STR_FACT); + getCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listCustomersSettings = PagedCallSettings.newBuilder(LIST_CUSTOMERS_PAGE_STR_FACT); + getEkmConnectionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getPartnerPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listAccessApprovalRequestsSettings = + PagedCallSettings.newBuilder(LIST_ACCESS_APPROVAL_REQUESTS_PAGE_STR_FACT); + getPartnerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getWorkloadSettings, + listWorkloadsSettings, + getCustomerSettings, + listCustomersSettings, + getEkmConnectionsSettings, + getPartnerPermissionsSettings, + listAccessApprovalRequestsSettings, + getPartnerSettings); + initDefaults(this); + } + + protected Builder(CloudControlsPartnerCoreStubSettings settings) { + super(settings); + + getWorkloadSettings = settings.getWorkloadSettings.toBuilder(); + listWorkloadsSettings = settings.listWorkloadsSettings.toBuilder(); + getCustomerSettings = settings.getCustomerSettings.toBuilder(); + listCustomersSettings = settings.listCustomersSettings.toBuilder(); + getEkmConnectionsSettings = settings.getEkmConnectionsSettings.toBuilder(); + getPartnerPermissionsSettings = settings.getPartnerPermissionsSettings.toBuilder(); + listAccessApprovalRequestsSettings = settings.listAccessApprovalRequestsSettings.toBuilder(); + getPartnerSettings = settings.getPartnerSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getWorkloadSettings, + listWorkloadsSettings, + getCustomerSettings, + listCustomersSettings, + getEkmConnectionsSettings, + getPartnerPermissionsSettings, + listAccessApprovalRequestsSettings, + getPartnerSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getWorkloadSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listWorkloadsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getCustomerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listCustomersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getEkmConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getPartnerPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listAccessApprovalRequestsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getPartnerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 getWorkload. */ + public UnaryCallSettings.Builder getWorkloadSettings() { + return getWorkloadSettings; + } + + /** Returns the builder for the settings used for calls to listWorkloads. */ + public PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings() { + return listWorkloadsSettings; + } + + /** Returns the builder for the settings used for calls to getCustomer. */ + public UnaryCallSettings.Builder getCustomerSettings() { + return getCustomerSettings; + } + + /** Returns the builder for the settings used for calls to listCustomers. */ + public PagedCallSettings.Builder< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + listCustomersSettings() { + return listCustomersSettings; + } + + /** Returns the builder for the settings used for calls to getEkmConnections. */ + public UnaryCallSettings.Builder + getEkmConnectionsSettings() { + return getEkmConnectionsSettings; + } + + /** Returns the builder for the settings used for calls to getPartnerPermissions. */ + public UnaryCallSettings.Builder + getPartnerPermissionsSettings() { + return getPartnerPermissionsSettings; + } + + /** Returns the builder for the settings used for calls to listAccessApprovalRequests. */ + public PagedCallSettings.Builder< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings() { + return listAccessApprovalRequestsSettings; + } + + /** Returns the builder for the settings used for calls to getPartner. */ + public UnaryCallSettings.Builder getPartnerSettings() { + return getPartnerSettings; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public CloudControlsPartnerCoreStubSettings build() throws IOException { + return new CloudControlsPartnerCoreStubSettings(this); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerMonitoringStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerMonitoringStub.java new file mode 100644 index 000000000000..c4f6e0c8a5da --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerMonitoringStub.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CloudControlsPartnerMonitoringStub implements BackgroundResource { + + public UnaryCallable + listViolationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listViolationsPagedCallable()"); + } + + public UnaryCallable listViolationsCallable() { + throw new UnsupportedOperationException("Not implemented: listViolationsCallable()"); + } + + public UnaryCallable getViolationCallable() { + throw new UnsupportedOperationException("Not implemented: getViolationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerMonitoringStubSettings.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerMonitoringStubSettings.java new file mode 100644 index 000000000000..23f9565f98fc --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/CloudControlsPartnerMonitoringStubSettings.java @@ -0,0 +1,447 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.cloud.cloudcontrolspartner.v1.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +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 CloudControlsPartnerMonitoringStub}. + * + *

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

    + *
  • The default service address (cloudcontrolspartner.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 getViolation 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
+ * CloudControlsPartnerMonitoringStubSettings.Builder
+ *     cloudControlsPartnerMonitoringSettingsBuilder =
+ *         CloudControlsPartnerMonitoringStubSettings.newBuilder();
+ * cloudControlsPartnerMonitoringSettingsBuilder
+ *     .getViolationSettings()
+ *     .setRetrySettings(
+ *         cloudControlsPartnerMonitoringSettingsBuilder
+ *             .getViolationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudControlsPartnerMonitoringStubSettings cloudControlsPartnerMonitoringSettings =
+ *     cloudControlsPartnerMonitoringSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringStubSettings + 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< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings; + private final UnaryCallSettings getViolationSettings; + + private static final PagedListDescriptor + LIST_VIOLATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListViolationsRequest injectToken(ListViolationsRequest payload, String token) { + return ListViolationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListViolationsRequest injectPageSize( + ListViolationsRequest payload, int pageSize) { + return ListViolationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListViolationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListViolationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListViolationsResponse payload) { + return payload.getViolationsList() == null + ? ImmutableList.of() + : payload.getViolationsList(); + } + }; + + private static final PagedListResponseFactory< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + LIST_VIOLATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListViolationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VIOLATIONS_PAGE_STR_DESC, request, context); + return ListViolationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listViolations. */ + public PagedCallSettings< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return listViolationsSettings; + } + + /** Returns the object with the settings used for calls to getViolation. */ + public UnaryCallSettings getViolationSettings() { + return getViolationSettings; + } + + public CloudControlsPartnerMonitoringStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudControlsPartnerMonitoringStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudControlsPartnerMonitoringStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudcontrolspartner"; + } + + /** 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 "cloudcontrolspartner.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudcontrolspartner.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(CloudControlsPartnerMonitoringStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(CloudControlsPartnerMonitoringStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.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 CloudControlsPartnerMonitoringStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listViolationsSettings = settingsBuilder.listViolationsSettings().build(); + getViolationSettings = settingsBuilder.getViolationSettings().build(); + } + + /** Builder for CloudControlsPartnerMonitoringStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings; + private final UnaryCallSettings.Builder getViolationSettings; + 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); + + listViolationsSettings = PagedCallSettings.newBuilder(LIST_VIOLATIONS_PAGE_STR_FACT); + getViolationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listViolationsSettings, getViolationSettings); + initDefaults(this); + } + + protected Builder(CloudControlsPartnerMonitoringStubSettings settings) { + super(settings); + + listViolationsSettings = settings.listViolationsSettings.toBuilder(); + getViolationSettings = settings.getViolationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listViolationsSettings, getViolationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listViolationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getViolationSettings() + .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 listViolations. */ + public PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return listViolationsSettings; + } + + /** Returns the builder for the settings used for calls to getViolation. */ + public UnaryCallSettings.Builder getViolationSettings() { + return getViolationSettings; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public CloudControlsPartnerMonitoringStubSettings build() throws IOException { + return new CloudControlsPartnerMonitoringStubSettings(this); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerCoreCallableFactory.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerCoreCallableFactory.java new file mode 100644 index 000000000000..b1387ba9f80a --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerCoreCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.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 CloudControlsPartnerCore service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudControlsPartnerCoreCallableFactory 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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerCoreStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerCoreStub.java new file mode 100644 index 000000000000..39ef787cedef --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerCoreStub.java @@ -0,0 +1,440 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Partner; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +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 CloudControlsPartnerCore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudControlsPartnerCoreStub extends CloudControlsPartnerCoreStub { + private static final MethodDescriptor getWorkloadMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetWorkload") + .setRequestMarshaller(ProtoUtils.marshaller(GetWorkloadRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Workload.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listWorkloadsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/ListWorkloads") + .setRequestMarshaller( + ProtoUtils.marshaller(ListWorkloadsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListWorkloadsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getCustomerMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetCustomer") + .setRequestMarshaller(ProtoUtils.marshaller(GetCustomerRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Customer.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listCustomersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/ListCustomers") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCustomersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCustomersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getEkmConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetEkmConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(GetEkmConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EkmConnections.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getPartnerPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetPartnerPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(GetPartnerPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PartnerPermissions.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsResponse> + listAccessApprovalRequestsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/ListAccessApprovalRequests") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAccessApprovalRequestsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAccessApprovalRequestsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getPartnerMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetPartner") + .setRequestMarshaller(ProtoUtils.marshaller(GetPartnerRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Partner.getDefaultInstance())) + .build(); + + private final UnaryCallable getWorkloadCallable; + private final UnaryCallable listWorkloadsCallable; + private final UnaryCallable + listWorkloadsPagedCallable; + private final UnaryCallable getCustomerCallable; + private final UnaryCallable listCustomersCallable; + private final UnaryCallable + listCustomersPagedCallable; + private final UnaryCallable getEkmConnectionsCallable; + private final UnaryCallable + getPartnerPermissionsCallable; + private final UnaryCallable + listAccessApprovalRequestsCallable; + private final UnaryCallable< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsPagedCallable; + private final UnaryCallable getPartnerCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudControlsPartnerCoreStub create( + CloudControlsPartnerCoreStubSettings settings) throws IOException { + return new GrpcCloudControlsPartnerCoreStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudControlsPartnerCoreStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudControlsPartnerCoreStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudControlsPartnerCoreStub, 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 GrpcCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCloudControlsPartnerCoreCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudControlsPartnerCoreStub, 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 GrpcCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getWorkloadTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWorkloadMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listWorkloadsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listWorkloadsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getCustomerTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCustomerMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listCustomersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCustomersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getEkmConnectionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEkmConnectionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getPartnerPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPartnerPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listAccessApprovalRequestsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listAccessApprovalRequestsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getPartnerTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPartnerMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getWorkloadCallable = + callableFactory.createUnaryCallable( + getWorkloadTransportSettings, settings.getWorkloadSettings(), clientContext); + this.listWorkloadsCallable = + callableFactory.createUnaryCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.listWorkloadsPagedCallable = + callableFactory.createPagedCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.getCustomerCallable = + callableFactory.createUnaryCallable( + getCustomerTransportSettings, settings.getCustomerSettings(), clientContext); + this.listCustomersCallable = + callableFactory.createUnaryCallable( + listCustomersTransportSettings, settings.listCustomersSettings(), clientContext); + this.listCustomersPagedCallable = + callableFactory.createPagedCallable( + listCustomersTransportSettings, settings.listCustomersSettings(), clientContext); + this.getEkmConnectionsCallable = + callableFactory.createUnaryCallable( + getEkmConnectionsTransportSettings, + settings.getEkmConnectionsSettings(), + clientContext); + this.getPartnerPermissionsCallable = + callableFactory.createUnaryCallable( + getPartnerPermissionsTransportSettings, + settings.getPartnerPermissionsSettings(), + clientContext); + this.listAccessApprovalRequestsCallable = + callableFactory.createUnaryCallable( + listAccessApprovalRequestsTransportSettings, + settings.listAccessApprovalRequestsSettings(), + clientContext); + this.listAccessApprovalRequestsPagedCallable = + callableFactory.createPagedCallable( + listAccessApprovalRequestsTransportSettings, + settings.listAccessApprovalRequestsSettings(), + clientContext); + this.getPartnerCallable = + callableFactory.createUnaryCallable( + getPartnerTransportSettings, settings.getPartnerSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getWorkloadCallable() { + return getWorkloadCallable; + } + + @Override + public UnaryCallable listWorkloadsCallable() { + return listWorkloadsCallable; + } + + @Override + public UnaryCallable + listWorkloadsPagedCallable() { + return listWorkloadsPagedCallable; + } + + @Override + public UnaryCallable getCustomerCallable() { + return getCustomerCallable; + } + + @Override + public UnaryCallable listCustomersCallable() { + return listCustomersCallable; + } + + @Override + public UnaryCallable + listCustomersPagedCallable() { + return listCustomersPagedCallable; + } + + @Override + public UnaryCallable getEkmConnectionsCallable() { + return getEkmConnectionsCallable; + } + + @Override + public UnaryCallable + getPartnerPermissionsCallable() { + return getPartnerPermissionsCallable; + } + + @Override + public UnaryCallable + listAccessApprovalRequestsCallable() { + return listAccessApprovalRequestsCallable; + } + + @Override + public UnaryCallable + listAccessApprovalRequestsPagedCallable() { + return listAccessApprovalRequestsPagedCallable; + } + + @Override + public UnaryCallable getPartnerCallable() { + return getPartnerCallable; + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerMonitoringCallableFactory.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerMonitoringCallableFactory.java new file mode 100644 index 000000000000..ca80b9eb54ba --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerMonitoringCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.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 CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudControlsPartnerMonitoringCallableFactory 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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerMonitoringStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerMonitoringStub.java new file mode 100644 index 000000000000..970650cec87f --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/GrpcCloudControlsPartnerMonitoringStub.java @@ -0,0 +1,212 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.cloud.cloudcontrolspartner.v1.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +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 CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudControlsPartnerMonitoringStub extends CloudControlsPartnerMonitoringStub { + private static final MethodDescriptor + listViolationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoring/ListViolations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListViolationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListViolationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getViolationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoring/GetViolation") + .setRequestMarshaller(ProtoUtils.marshaller(GetViolationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Violation.getDefaultInstance())) + .build(); + + private final UnaryCallable listViolationsCallable; + private final UnaryCallable + listViolationsPagedCallable; + private final UnaryCallable getViolationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudControlsPartnerMonitoringStub create( + CloudControlsPartnerMonitoringStubSettings settings) throws IOException { + return new GrpcCloudControlsPartnerMonitoringStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudControlsPartnerMonitoringStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudControlsPartnerMonitoringStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcCloudControlsPartnerMonitoringStub, 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 GrpcCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCloudControlsPartnerMonitoringCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudControlsPartnerMonitoringStub, 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 GrpcCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listViolationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listViolationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getViolationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getViolationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listViolationsCallable = + callableFactory.createUnaryCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.listViolationsPagedCallable = + callableFactory.createPagedCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.getViolationCallable = + callableFactory.createUnaryCallable( + getViolationTransportSettings, settings.getViolationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listViolationsCallable() { + return listViolationsCallable; + } + + @Override + public UnaryCallable + listViolationsPagedCallable() { + return listViolationsPagedCallable; + } + + @Override + public UnaryCallable getViolationCallable() { + return getViolationCallable; + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerCoreCallableFactory.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerCoreCallableFactory.java new file mode 100644 index 000000000000..cb45057b0153 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerCoreCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +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 CloudControlsPartnerCore service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonCloudControlsPartnerCoreCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerCoreStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerCoreStub.java new file mode 100644 index 000000000000..464770f30e41 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerCoreStub.java @@ -0,0 +1,676 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Partner; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +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 CloudControlsPartnerCore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonCloudControlsPartnerCoreStub extends CloudControlsPartnerCoreStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getWorkloadMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetWorkload") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/customers/*/workloads/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Workload.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listWorkloadsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/ListWorkloads") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*/customers/*}/workloads", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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(ListWorkloadsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getCustomerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetCustomer") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/customers/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Customer.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listCustomersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/ListCustomers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/customers", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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(ListCustomersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getEkmConnectionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetEkmConnections") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/customers/*/workloads/*/ekmConnections}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EkmConnections.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getPartnerPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetPartnerPermissions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/customers/*/workloads/*/partnerPermissions}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PartnerPermissions.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsResponse> + listAccessApprovalRequestsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/ListAccessApprovalRequests") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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(ListAccessApprovalRequestsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getPartnerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore/GetPartner") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/partner}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Partner.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getWorkloadCallable; + private final UnaryCallable listWorkloadsCallable; + private final UnaryCallable + listWorkloadsPagedCallable; + private final UnaryCallable getCustomerCallable; + private final UnaryCallable listCustomersCallable; + private final UnaryCallable + listCustomersPagedCallable; + private final UnaryCallable getEkmConnectionsCallable; + private final UnaryCallable + getPartnerPermissionsCallable; + private final UnaryCallable + listAccessApprovalRequestsCallable; + private final UnaryCallable< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsPagedCallable; + private final UnaryCallable getPartnerCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudControlsPartnerCoreStub create( + CloudControlsPartnerCoreStubSettings settings) throws IOException { + return new HttpJsonCloudControlsPartnerCoreStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudControlsPartnerCoreStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudControlsPartnerCoreStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudControlsPartnerCoreStub, 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 HttpJsonCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonCloudControlsPartnerCoreCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudControlsPartnerCoreStub, 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 HttpJsonCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getWorkloadTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getWorkloadMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listWorkloadsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listWorkloadsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getCustomerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getCustomerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listCustomersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listCustomersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getEkmConnectionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEkmConnectionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getPartnerPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPartnerPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listAccessApprovalRequestsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listAccessApprovalRequestsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getPartnerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPartnerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getWorkloadCallable = + callableFactory.createUnaryCallable( + getWorkloadTransportSettings, settings.getWorkloadSettings(), clientContext); + this.listWorkloadsCallable = + callableFactory.createUnaryCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.listWorkloadsPagedCallable = + callableFactory.createPagedCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.getCustomerCallable = + callableFactory.createUnaryCallable( + getCustomerTransportSettings, settings.getCustomerSettings(), clientContext); + this.listCustomersCallable = + callableFactory.createUnaryCallable( + listCustomersTransportSettings, settings.listCustomersSettings(), clientContext); + this.listCustomersPagedCallable = + callableFactory.createPagedCallable( + listCustomersTransportSettings, settings.listCustomersSettings(), clientContext); + this.getEkmConnectionsCallable = + callableFactory.createUnaryCallable( + getEkmConnectionsTransportSettings, + settings.getEkmConnectionsSettings(), + clientContext); + this.getPartnerPermissionsCallable = + callableFactory.createUnaryCallable( + getPartnerPermissionsTransportSettings, + settings.getPartnerPermissionsSettings(), + clientContext); + this.listAccessApprovalRequestsCallable = + callableFactory.createUnaryCallable( + listAccessApprovalRequestsTransportSettings, + settings.listAccessApprovalRequestsSettings(), + clientContext); + this.listAccessApprovalRequestsPagedCallable = + callableFactory.createPagedCallable( + listAccessApprovalRequestsTransportSettings, + settings.listAccessApprovalRequestsSettings(), + clientContext); + this.getPartnerCallable = + callableFactory.createUnaryCallable( + getPartnerTransportSettings, settings.getPartnerSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getWorkloadMethodDescriptor); + methodDescriptors.add(listWorkloadsMethodDescriptor); + methodDescriptors.add(getCustomerMethodDescriptor); + methodDescriptors.add(listCustomersMethodDescriptor); + methodDescriptors.add(getEkmConnectionsMethodDescriptor); + methodDescriptors.add(getPartnerPermissionsMethodDescriptor); + methodDescriptors.add(listAccessApprovalRequestsMethodDescriptor); + methodDescriptors.add(getPartnerMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getWorkloadCallable() { + return getWorkloadCallable; + } + + @Override + public UnaryCallable listWorkloadsCallable() { + return listWorkloadsCallable; + } + + @Override + public UnaryCallable + listWorkloadsPagedCallable() { + return listWorkloadsPagedCallable; + } + + @Override + public UnaryCallable getCustomerCallable() { + return getCustomerCallable; + } + + @Override + public UnaryCallable listCustomersCallable() { + return listCustomersCallable; + } + + @Override + public UnaryCallable + listCustomersPagedCallable() { + return listCustomersPagedCallable; + } + + @Override + public UnaryCallable getEkmConnectionsCallable() { + return getEkmConnectionsCallable; + } + + @Override + public UnaryCallable + getPartnerPermissionsCallable() { + return getPartnerPermissionsCallable; + } + + @Override + public UnaryCallable + listAccessApprovalRequestsCallable() { + return listAccessApprovalRequestsCallable; + } + + @Override + public UnaryCallable + listAccessApprovalRequestsPagedCallable() { + return listAccessApprovalRequestsPagedCallable; + } + + @Override + public UnaryCallable getPartnerCallable() { + return getPartnerCallable; + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerMonitoringCallableFactory.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerMonitoringCallableFactory.java new file mode 100644 index 000000000000..e1103c83672c --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerMonitoringCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +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 CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonCloudControlsPartnerMonitoringCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerMonitoringStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerMonitoringStub.java new file mode 100644 index 000000000000..3d38ee915dbd --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1/stub/HttpJsonCloudControlsPartnerMonitoringStub.java @@ -0,0 +1,278 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.cloud.cloudcontrolspartner.v1.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +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 CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonCloudControlsPartnerMonitoringStub extends CloudControlsPartnerMonitoringStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listViolationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoring/ListViolations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*/customers/*/workloads/*}/violations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "interval", request.getInterval()); + 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(ListViolationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getViolationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoring/GetViolation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/customers/*/workloads/*/violations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Violation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listViolationsCallable; + private final UnaryCallable + listViolationsPagedCallable; + private final UnaryCallable getViolationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudControlsPartnerMonitoringStub create( + CloudControlsPartnerMonitoringStubSettings settings) throws IOException { + return new HttpJsonCloudControlsPartnerMonitoringStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudControlsPartnerMonitoringStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudControlsPartnerMonitoringStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudControlsPartnerMonitoringStub, 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 HttpJsonCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonCloudControlsPartnerMonitoringCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudControlsPartnerMonitoringStub, 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 HttpJsonCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listViolationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listViolationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getViolationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getViolationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listViolationsCallable = + callableFactory.createUnaryCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.listViolationsPagedCallable = + callableFactory.createPagedCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.getViolationCallable = + callableFactory.createUnaryCallable( + getViolationTransportSettings, settings.getViolationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listViolationsMethodDescriptor); + methodDescriptors.add(getViolationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listViolationsCallable() { + return listViolationsCallable; + } + + @Override + public UnaryCallable + listViolationsPagedCallable() { + return listViolationsPagedCallable; + } + + @Override + public UnaryCallable getViolationCallable() { + return getViolationCallable; + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClient.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClient.java new file mode 100644 index 000000000000..c04ac327ffad --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClient.java @@ -0,0 +1,1758 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.cloudcontrolspartner.v1beta.stub.CloudControlsPartnerCoreStub; +import com.google.cloud.cloudcontrolspartner.v1beta.stub.CloudControlsPartnerCoreStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create()) {
+ *   WorkloadName name =
+ *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+ *   Workload response = cloudControlsPartnerCoreClient.getWorkload(name);
+ * }
+ * }
+ * + *

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

GetWorkload

Gets details of a single workload

+ *

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

+ *
    + *
  • getWorkload(GetWorkloadRequest request) + *

+ *

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

+ *
    + *
  • getWorkload(WorkloadName name) + *

  • getWorkload(String name) + *

+ *

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

+ *
    + *
  • getWorkloadCallable() + *

+ *

ListWorkloads

Lists customer workloads for a given customer org id

+ *

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

+ *
    + *
  • listWorkloads(ListWorkloadsRequest request) + *

+ *

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

+ *
    + *
  • listWorkloads(CustomerName parent) + *

  • listWorkloads(String parent) + *

+ *

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

+ *
    + *
  • listWorkloadsPagedCallable() + *

  • listWorkloadsCallable() + *

+ *

GetCustomer

Gets details of a single customer

+ *

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

+ *
    + *
  • getCustomer(GetCustomerRequest request) + *

+ *

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

+ *
    + *
  • getCustomer(CustomerName name) + *

  • getCustomer(String name) + *

+ *

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

+ *
    + *
  • getCustomerCallable() + *

+ *

ListCustomers

Lists customers of a partner identified by its Google Cloud organization ID

+ *

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

+ *
    + *
  • listCustomers(ListCustomersRequest request) + *

+ *

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

+ *
    + *
  • listCustomers(OrganizationLocationName parent) + *

  • listCustomers(String parent) + *

+ *

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

+ *
    + *
  • listCustomersPagedCallable() + *

  • listCustomersCallable() + *

+ *

GetEkmConnections

Gets the EKM connections associated with a workload

+ *

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

+ *
    + *
  • getEkmConnections(GetEkmConnectionsRequest request) + *

+ *

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

+ *
    + *
  • getEkmConnections(EkmConnectionsName name) + *

  • getEkmConnections(String name) + *

+ *

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

+ *
    + *
  • getEkmConnectionsCallable() + *

+ *

GetPartnerPermissions

Gets the partner permissions granted for a workload

+ *

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

+ *
    + *
  • getPartnerPermissions(GetPartnerPermissionsRequest request) + *

+ *

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

+ *
    + *
  • getPartnerPermissions(PartnerPermissionsName name) + *

  • getPartnerPermissions(String name) + *

+ *

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

+ *
    + *
  • getPartnerPermissionsCallable() + *

+ *

ListAccessApprovalRequests

Lists access requests associated with a workload

+ *

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

+ *
    + *
  • listAccessApprovalRequests(ListAccessApprovalRequestsRequest request) + *

+ *

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

+ *
    + *
  • listAccessApprovalRequests(WorkloadName parent) + *

  • listAccessApprovalRequests(String parent) + *

+ *

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

+ *
    + *
  • listAccessApprovalRequestsPagedCallable() + *

  • listAccessApprovalRequestsCallable() + *

+ *

GetPartner

Get details of a Partner.

+ *

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

+ *
    + *
  • getPartner(GetPartnerRequest request) + *

+ *

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

+ *
    + *
  • getPartner(PartnerName name) + *

  • getPartner(String name) + *

+ *

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

+ *
    + *
  • getPartnerCallable() + *

+ *
+ * + *

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 + * CloudControlsPartnerCoreSettings 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
+ * CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings =
+ *     CloudControlsPartnerCoreSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings);
+ * }
+ * + *

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
+ * CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings =
+ *     CloudControlsPartnerCoreSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings);
+ * }
+ * + *

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
+ * CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings =
+ *     CloudControlsPartnerCoreSettings.newHttpJsonBuilder().build();
+ * CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings);
+ * }
+ * + *

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

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   WorkloadName name =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   Workload response = cloudControlsPartnerCoreClient.getWorkload(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workload getWorkload(WorkloadName name) { + GetWorkloadRequest request = + GetWorkloadRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString();
+   *   Workload response = cloudControlsPartnerCoreClient.getWorkload(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workload getWorkload(String name) { + GetWorkloadRequest request = GetWorkloadRequest.newBuilder().setName(name).build(); + return getWorkload(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetWorkloadRequest request =
+   *       GetWorkloadRequest.newBuilder()
+   *           .setName(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   Workload response = cloudControlsPartnerCoreClient.getWorkload(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 Workload getWorkload(GetWorkloadRequest request) { + return getWorkloadCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetWorkloadRequest request =
+   *       GetWorkloadRequest.newBuilder()
+   *           .setName(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getWorkloadCallable().futureCall(request);
+   *   // Do something.
+   *   Workload response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getWorkloadCallable() { + return stub.getWorkloadCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]");
+   *   for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * organizations/{organization}/locations/{location}/customers/{customer} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkloadsPagedResponse listWorkloads(CustomerName parent) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listWorkloads(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString();
+   *   for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * organizations/{organization}/locations/{location}/customers/{customer} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkloadsPagedResponse listWorkloads(String parent) { + ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder().setParent(parent).build(); + return listWorkloads(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListWorkloadsRequest request =
+   *       ListWorkloadsRequest.newBuilder()
+   *           .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(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 ListWorkloadsPagedResponse listWorkloads(ListWorkloadsRequest request) { + return listWorkloadsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListWorkloadsRequest request =
+   *       ListWorkloadsRequest.newBuilder()
+   *           .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.listWorkloadsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Workload element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkloadsPagedCallable() { + return stub.listWorkloadsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customer workloads for a given customer org id + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListWorkloadsRequest request =
+   *       ListWorkloadsRequest.newBuilder()
+   *           .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListWorkloadsResponse response =
+   *         cloudControlsPartnerCoreClient.listWorkloadsCallable().call(request);
+   *     for (Workload element : response.getWorkloadsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listWorkloadsCallable() { + return stub.listWorkloadsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single customer + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]");
+   *   Customer response = cloudControlsPartnerCoreClient.getCustomer(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * organizations/{organization}/locations/{location}/customers/{customer} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Customer getCustomer(CustomerName name) { + GetCustomerRequest request = + GetCustomerRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCustomer(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single customer + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString();
+   *   Customer response = cloudControlsPartnerCoreClient.getCustomer(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * organizations/{organization}/locations/{location}/customers/{customer} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Customer getCustomer(String name) { + GetCustomerRequest request = GetCustomerRequest.newBuilder().setName(name).build(); + return getCustomer(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single customer + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetCustomerRequest request =
+   *       GetCustomerRequest.newBuilder()
+   *           .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .build();
+   *   Customer response = cloudControlsPartnerCoreClient.getCustomer(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 Customer getCustomer(GetCustomerRequest request) { + return getCustomerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single customer + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetCustomerRequest request =
+   *       GetCustomerRequest.newBuilder()
+   *           .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getCustomerCallable().futureCall(request);
+   *   // Do something.
+   *   Customer response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCustomerCallable() { + return stub.getCustomerCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (Customer element : cloudControlsPartnerCoreClient.listCustomers(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * organizations/{organization}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomersPagedResponse listCustomers(OrganizationLocationName parent) { + ListCustomersRequest request = + ListCustomersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCustomers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   for (Customer element : cloudControlsPartnerCoreClient.listCustomers(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * organizations/{organization}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomersPagedResponse listCustomers(String parent) { + ListCustomersRequest request = ListCustomersRequest.newBuilder().setParent(parent).build(); + return listCustomers(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListCustomersRequest request =
+   *       ListCustomersRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Customer element : cloudControlsPartnerCoreClient.listCustomers(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 ListCustomersPagedResponse listCustomers(ListCustomersRequest request) { + return listCustomersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListCustomersRequest request =
+   *       ListCustomersRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.listCustomersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Customer element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCustomersPagedCallable() { + return stub.listCustomersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists customers of a partner identified by its Google Cloud organization ID + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListCustomersRequest request =
+   *       ListCustomersRequest.newBuilder()
+   *           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListCustomersResponse response =
+   *         cloudControlsPartnerCoreClient.listCustomersCallable().call(request);
+   *     for (Customer element : response.getCustomersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listCustomersCallable() { + return stub.listCustomersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the EKM connections associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   EkmConnectionsName name =
+   *       EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EkmConnections getEkmConnections(EkmConnectionsName name) { + GetEkmConnectionsRequest request = + GetEkmConnectionsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getEkmConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the EKM connections associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name =
+   *       EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *           .toString();
+   *   EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EkmConnections getEkmConnections(String name) { + GetEkmConnectionsRequest request = GetEkmConnectionsRequest.newBuilder().setName(name).build(); + return getEkmConnections(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the EKM connections associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetEkmConnectionsRequest request =
+   *       GetEkmConnectionsRequest.newBuilder()
+   *           .setName(
+   *               EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(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 EkmConnections getEkmConnections(GetEkmConnectionsRequest request) { + return getEkmConnectionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the EKM connections associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetEkmConnectionsRequest request =
+   *       GetEkmConnectionsRequest.newBuilder()
+   *           .setName(
+   *               EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getEkmConnectionsCallable().futureCall(request);
+   *   // Do something.
+   *   EkmConnections response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getEkmConnectionsCallable() { + return stub.getEkmConnectionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the partner permissions granted for a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   PartnerPermissionsName name =
+   *       PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource to get in the format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PartnerPermissions getPartnerPermissions(PartnerPermissionsName name) { + GetPartnerPermissionsRequest request = + GetPartnerPermissionsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getPartnerPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the partner permissions granted for a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name =
+   *       PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *           .toString();
+   *   PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource to get in the format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PartnerPermissions getPartnerPermissions(String name) { + GetPartnerPermissionsRequest request = + GetPartnerPermissionsRequest.newBuilder().setName(name).build(); + return getPartnerPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the partner permissions granted for a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetPartnerPermissionsRequest request =
+   *       GetPartnerPermissionsRequest.newBuilder()
+   *           .setName(
+   *               PartnerPermissionsName.of(
+   *                       "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(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 PartnerPermissions getPartnerPermissions(GetPartnerPermissionsRequest request) { + return getPartnerPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the partner permissions granted for a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetPartnerPermissionsRequest request =
+   *       GetPartnerPermissionsRequest.newBuilder()
+   *           .setName(
+   *               PartnerPermissionsName.of(
+   *                       "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getPartnerPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   PartnerPermissions response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getPartnerPermissionsCallable() { + return stub.getPartnerPermissionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   WorkloadName parent =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   for (AccessApprovalRequest element :
+   *       cloudControlsPartnerCoreClient.listAccessApprovalRequests(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAccessApprovalRequestsPagedResponse listAccessApprovalRequests( + WorkloadName parent) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAccessApprovalRequests(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String parent =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString();
+   *   for (AccessApprovalRequest element :
+   *       cloudControlsPartnerCoreClient.listAccessApprovalRequests(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAccessApprovalRequestsPagedResponse listAccessApprovalRequests(String parent) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder().setParent(parent).build(); + return listAccessApprovalRequests(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListAccessApprovalRequestsRequest request =
+   *       ListAccessApprovalRequestsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (AccessApprovalRequest element :
+   *       cloudControlsPartnerCoreClient.listAccessApprovalRequests(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 ListAccessApprovalRequestsPagedResponse listAccessApprovalRequests( + ListAccessApprovalRequestsRequest request) { + return listAccessApprovalRequestsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListAccessApprovalRequestsRequest request =
+   *       ListAccessApprovalRequestsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient
+   *           .listAccessApprovalRequestsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (AccessApprovalRequest element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsPagedCallable() { + return stub.listAccessApprovalRequestsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists access requests associated with a workload + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   ListAccessApprovalRequestsRequest request =
+   *       ListAccessApprovalRequestsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListAccessApprovalRequestsResponse response =
+   *         cloudControlsPartnerCoreClient.listAccessApprovalRequestsCallable().call(request);
+   *     for (AccessApprovalRequest element : response.getAccessApprovalRequestsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listAccessApprovalRequestsCallable() { + return stub.listAccessApprovalRequestsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details of a Partner. + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]");
+   *   Partner response = cloudControlsPartnerCoreClient.getPartner(name);
+   * }
+   * }
+ * + * @param name Required. Format: organizations/{organization}/locations/{location}/partner + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Partner getPartner(PartnerName name) { + GetPartnerRequest request = + GetPartnerRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPartner(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details of a Partner. + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   String name = PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   Partner response = cloudControlsPartnerCoreClient.getPartner(name);
+   * }
+   * }
+ * + * @param name Required. Format: organizations/{organization}/locations/{location}/partner + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Partner getPartner(String name) { + GetPartnerRequest request = GetPartnerRequest.newBuilder().setName(name).build(); + return getPartner(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details of a Partner. + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetPartnerRequest request =
+   *       GetPartnerRequest.newBuilder()
+   *           .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .build();
+   *   Partner response = cloudControlsPartnerCoreClient.getPartner(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 Partner getPartner(GetPartnerRequest request) { + return getPartnerCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get details of a Partner. + * + *

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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+   *     CloudControlsPartnerCoreClient.create()) {
+   *   GetPartnerRequest request =
+   *       GetPartnerRequest.newBuilder()
+   *           .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerCoreClient.getPartnerCallable().futureCall(request);
+   *   // Do something.
+   *   Partner response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getPartnerCallable() { + return stub.getPartnerCallable(); + } + + @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 ListWorkloadsPagedResponse + extends AbstractPagedListResponse< + ListWorkloadsRequest, + ListWorkloadsResponse, + Workload, + ListWorkloadsPage, + ListWorkloadsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListWorkloadsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListWorkloadsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListWorkloadsPagedResponse(ListWorkloadsPage page) { + super(page, ListWorkloadsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListWorkloadsPage + extends AbstractPage< + ListWorkloadsRequest, ListWorkloadsResponse, Workload, ListWorkloadsPage> { + + private ListWorkloadsPage( + PageContext context, + ListWorkloadsResponse response) { + super(context, response); + } + + private static ListWorkloadsPage createEmptyPage() { + return new ListWorkloadsPage(null, null); + } + + @Override + protected ListWorkloadsPage createPage( + PageContext context, + ListWorkloadsResponse response) { + return new ListWorkloadsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListWorkloadsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListWorkloadsRequest, + ListWorkloadsResponse, + Workload, + ListWorkloadsPage, + ListWorkloadsFixedSizeCollection> { + + private ListWorkloadsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListWorkloadsFixedSizeCollection createEmptyCollection() { + return new ListWorkloadsFixedSizeCollection(null, 0); + } + + @Override + protected ListWorkloadsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListWorkloadsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListCustomersPagedResponse + extends AbstractPagedListResponse< + ListCustomersRequest, + ListCustomersResponse, + Customer, + ListCustomersPage, + ListCustomersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCustomersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListCustomersPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListCustomersPagedResponse(ListCustomersPage page) { + super(page, ListCustomersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCustomersPage + extends AbstractPage< + ListCustomersRequest, ListCustomersResponse, Customer, ListCustomersPage> { + + private ListCustomersPage( + PageContext context, + ListCustomersResponse response) { + super(context, response); + } + + private static ListCustomersPage createEmptyPage() { + return new ListCustomersPage(null, null); + } + + @Override + protected ListCustomersPage createPage( + PageContext context, + ListCustomersResponse response) { + return new ListCustomersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCustomersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCustomersRequest, + ListCustomersResponse, + Customer, + ListCustomersPage, + ListCustomersFixedSizeCollection> { + + private ListCustomersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCustomersFixedSizeCollection createEmptyCollection() { + return new ListCustomersFixedSizeCollection(null, 0); + } + + @Override + protected ListCustomersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCustomersFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListAccessApprovalRequestsPagedResponse + extends AbstractPagedListResponse< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest, + ListAccessApprovalRequestsPage, + ListAccessApprovalRequestsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAccessApprovalRequestsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListAccessApprovalRequestsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListAccessApprovalRequestsPagedResponse(ListAccessApprovalRequestsPage page) { + super(page, ListAccessApprovalRequestsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAccessApprovalRequestsPage + extends AbstractPage< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest, + ListAccessApprovalRequestsPage> { + + private ListAccessApprovalRequestsPage( + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + context, + ListAccessApprovalRequestsResponse response) { + super(context, response); + } + + private static ListAccessApprovalRequestsPage createEmptyPage() { + return new ListAccessApprovalRequestsPage(null, null); + } + + @Override + protected ListAccessApprovalRequestsPage createPage( + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + context, + ListAccessApprovalRequestsResponse response) { + return new ListAccessApprovalRequestsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAccessApprovalRequestsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest, + ListAccessApprovalRequestsPage, + ListAccessApprovalRequestsFixedSizeCollection> { + + private ListAccessApprovalRequestsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAccessApprovalRequestsFixedSizeCollection createEmptyCollection() { + return new ListAccessApprovalRequestsFixedSizeCollection(null, 0); + } + + @Override + protected ListAccessApprovalRequestsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAccessApprovalRequestsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreSettings.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreSettings.java new file mode 100644 index 000000000000..26004359884c --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreSettings.java @@ -0,0 +1,301 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.cloudcontrolspartner.v1beta.stub.CloudControlsPartnerCoreStubSettings; +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 CloudControlsPartnerCoreClient}. + * + *

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

    + *
  • The default service address (cloudcontrolspartner.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 getWorkload 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
+ * CloudControlsPartnerCoreSettings.Builder cloudControlsPartnerCoreSettingsBuilder =
+ *     CloudControlsPartnerCoreSettings.newBuilder();
+ * cloudControlsPartnerCoreSettingsBuilder
+ *     .getWorkloadSettings()
+ *     .setRetrySettings(
+ *         cloudControlsPartnerCoreSettingsBuilder
+ *             .getWorkloadSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings =
+ *     cloudControlsPartnerCoreSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudControlsPartnerCoreSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to getWorkload. */ + public UnaryCallSettings getWorkloadSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).getWorkloadSettings(); + } + + /** Returns the object with the settings used for calls to listWorkloads. */ + public PagedCallSettings + listWorkloadsSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).listWorkloadsSettings(); + } + + /** Returns the object with the settings used for calls to getCustomer. */ + public UnaryCallSettings getCustomerSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).getCustomerSettings(); + } + + /** Returns the object with the settings used for calls to listCustomers. */ + public PagedCallSettings + listCustomersSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).listCustomersSettings(); + } + + /** Returns the object with the settings used for calls to getEkmConnections. */ + public UnaryCallSettings getEkmConnectionsSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).getEkmConnectionsSettings(); + } + + /** Returns the object with the settings used for calls to getPartnerPermissions. */ + public UnaryCallSettings + getPartnerPermissionsSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()) + .getPartnerPermissionsSettings(); + } + + /** Returns the object with the settings used for calls to listAccessApprovalRequests. */ + public PagedCallSettings< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()) + .listAccessApprovalRequestsSettings(); + } + + /** Returns the object with the settings used for calls to getPartner. */ + public UnaryCallSettings getPartnerSettings() { + return ((CloudControlsPartnerCoreStubSettings) getStubSettings()).getPartnerSettings(); + } + + public static final CloudControlsPartnerCoreSettings create( + CloudControlsPartnerCoreStubSettings stub) throws IOException { + return new CloudControlsPartnerCoreSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudControlsPartnerCoreStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudControlsPartnerCoreStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudControlsPartnerCoreStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudControlsPartnerCoreSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudControlsPartnerCoreSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudControlsPartnerCoreStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudControlsPartnerCoreSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudControlsPartnerCoreStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudControlsPartnerCoreStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(CloudControlsPartnerCoreStubSettings.newHttpJsonBuilder()); + } + + public CloudControlsPartnerCoreStubSettings.Builder getStubSettingsBuilder() { + return ((CloudControlsPartnerCoreStubSettings.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 getWorkload. */ + public UnaryCallSettings.Builder getWorkloadSettings() { + return getStubSettingsBuilder().getWorkloadSettings(); + } + + /** Returns the builder for the settings used for calls to listWorkloads. */ + public PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings() { + return getStubSettingsBuilder().listWorkloadsSettings(); + } + + /** Returns the builder for the settings used for calls to getCustomer. */ + public UnaryCallSettings.Builder getCustomerSettings() { + return getStubSettingsBuilder().getCustomerSettings(); + } + + /** Returns the builder for the settings used for calls to listCustomers. */ + public PagedCallSettings.Builder< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + listCustomersSettings() { + return getStubSettingsBuilder().listCustomersSettings(); + } + + /** Returns the builder for the settings used for calls to getEkmConnections. */ + public UnaryCallSettings.Builder + getEkmConnectionsSettings() { + return getStubSettingsBuilder().getEkmConnectionsSettings(); + } + + /** Returns the builder for the settings used for calls to getPartnerPermissions. */ + public UnaryCallSettings.Builder + getPartnerPermissionsSettings() { + return getStubSettingsBuilder().getPartnerPermissionsSettings(); + } + + /** Returns the builder for the settings used for calls to listAccessApprovalRequests. */ + public PagedCallSettings.Builder< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings() { + return getStubSettingsBuilder().listAccessApprovalRequestsSettings(); + } + + /** Returns the builder for the settings used for calls to getPartner. */ + public UnaryCallSettings.Builder getPartnerSettings() { + return getStubSettingsBuilder().getPartnerSettings(); + } + + @Override + public CloudControlsPartnerCoreSettings build() throws IOException { + return new CloudControlsPartnerCoreSettings(this); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClient.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClient.java new file mode 100644 index 000000000000..20bc992f8648 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClient.java @@ -0,0 +1,659 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.cloudcontrolspartner.v1beta.stub.CloudControlsPartnerMonitoringStub; +import com.google.cloud.cloudcontrolspartner.v1beta.stub.CloudControlsPartnerMonitoringStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create()) {
+ *   ViolationName name =
+ *       ViolationName.of(
+ *           "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
+ *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(name);
+ * }
+ * }
+ * + *

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

ListViolations

Lists Violations for a workload Callers may also choose to read across multiple Customers or for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of {customer} & {workload}. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`

+ *

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

+ *
    + *
  • listViolations(ListViolationsRequest request) + *

+ *

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

+ *
    + *
  • listViolations(WorkloadName parent) + *

  • listViolations(String parent) + *

+ *

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

+ *
    + *
  • listViolationsPagedCallable() + *

  • listViolationsCallable() + *

+ *

GetViolation

Gets details of a single Violation.

+ *

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

+ *
    + *
  • getViolation(GetViolationRequest request) + *

+ *

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

+ *
    + *
  • getViolation(ViolationName name) + *

  • getViolation(String name) + *

+ *

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

+ *
    + *
  • getViolationCallable() + *

+ *
+ * + *

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 + * CloudControlsPartnerMonitoringSettings 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
+ * CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings =
+ *     CloudControlsPartnerMonitoringSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings);
+ * }
+ * + *

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
+ * CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings =
+ *     CloudControlsPartnerMonitoringSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings);
+ * }
+ * + *

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
+ * CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings =
+ *     CloudControlsPartnerMonitoringSettings.newHttpJsonBuilder().build();
+ * CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringClient implements BackgroundResource { + private final CloudControlsPartnerMonitoringSettings settings; + private final CloudControlsPartnerMonitoringStub stub; + + /** Constructs an instance of CloudControlsPartnerMonitoringClient with default settings. */ + public static final CloudControlsPartnerMonitoringClient create() throws IOException { + return create(CloudControlsPartnerMonitoringSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudControlsPartnerMonitoringClient, 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 CloudControlsPartnerMonitoringClient create( + CloudControlsPartnerMonitoringSettings settings) throws IOException { + return new CloudControlsPartnerMonitoringClient(settings); + } + + /** + * Constructs an instance of CloudControlsPartnerMonitoringClient, using the given stub for making + * calls. This is for advanced usage - prefer using + * create(CloudControlsPartnerMonitoringSettings). + */ + public static final CloudControlsPartnerMonitoringClient create( + CloudControlsPartnerMonitoringStub stub) { + return new CloudControlsPartnerMonitoringClient(stub); + } + + /** + * Constructs an instance of CloudControlsPartnerMonitoringClient, 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 CloudControlsPartnerMonitoringClient(CloudControlsPartnerMonitoringSettings settings) + throws IOException { + this.settings = settings; + this.stub = + ((CloudControlsPartnerMonitoringStubSettings) settings.getStubSettings()).createStub(); + } + + protected CloudControlsPartnerMonitoringClient(CloudControlsPartnerMonitoringStub stub) { + this.settings = null; + this.stub = stub; + } + + public final CloudControlsPartnerMonitoringSettings getSettings() { + return settings; + } + + public CloudControlsPartnerMonitoringStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   WorkloadName parent =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+   *   for (Violation element :
+   *       cloudControlsPartnerMonitoringClient.listViolations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViolationsPagedResponse listViolations(WorkloadName parent) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listViolations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   String parent =
+   *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString();
+   *   for (Violation element :
+   *       cloudControlsPartnerMonitoringClient.listViolations(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent resource Format + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViolationsPagedResponse listViolations(String parent) { + ListViolationsRequest request = ListViolationsRequest.newBuilder().setParent(parent).build(); + return listViolations(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setInterval(Interval.newBuilder().build())
+   *           .build();
+   *   for (Violation element :
+   *       cloudControlsPartnerMonitoringClient.listViolations(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 ListViolationsPagedResponse listViolations(ListViolationsRequest request) { + return listViolationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setInterval(Interval.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerMonitoringClient.listViolationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Violation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listViolationsPagedCallable() { + return stub.listViolationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Violations for a workload Callers may also choose to read across multiple Customers or + * for a single customer as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or + * dash character) as a wildcard character instead of {customer} & {workload}. Format: + * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   ListViolationsRequest request =
+   *       ListViolationsRequest.newBuilder()
+   *           .setParent(
+   *               WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setInterval(Interval.newBuilder().build())
+   *           .build();
+   *   while (true) {
+   *     ListViolationsResponse response =
+   *         cloudControlsPartnerMonitoringClient.listViolationsCallable().call(request);
+   *     for (Violation element : response.getViolationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listViolationsCallable() { + return stub.listViolationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Violation. + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   ViolationName name =
+   *       ViolationName.of(
+   *           "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
+   *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Violation getViolation(ViolationName name) { + GetViolationRequest request = + GetViolationRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getViolation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Violation. + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   String name =
+   *       ViolationName.of(
+   *               "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]")
+   *           .toString();
+   *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(name);
+   * }
+   * }
+ * + * @param name Required. Format: + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Violation getViolation(String name) { + GetViolationRequest request = GetViolationRequest.newBuilder().setName(name).build(); + return getViolation(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Violation. + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   GetViolationRequest request =
+   *       GetViolationRequest.newBuilder()
+   *           .setName(
+   *               ViolationName.of(
+   *                       "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]")
+   *                   .toString())
+   *           .build();
+   *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(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 Violation getViolation(GetViolationRequest request) { + return getViolationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Violation. + * + *

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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+   *     CloudControlsPartnerMonitoringClient.create()) {
+   *   GetViolationRequest request =
+   *       GetViolationRequest.newBuilder()
+   *           .setName(
+   *               ViolationName.of(
+   *                       "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudControlsPartnerMonitoringClient.getViolationCallable().futureCall(request);
+   *   // Do something.
+   *   Violation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getViolationCallable() { + return stub.getViolationCallable(); + } + + @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 ListViolationsPagedResponse + extends AbstractPagedListResponse< + ListViolationsRequest, + ListViolationsResponse, + Violation, + ListViolationsPage, + ListViolationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListViolationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListViolationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListViolationsPagedResponse(ListViolationsPage page) { + super(page, ListViolationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListViolationsPage + extends AbstractPage< + ListViolationsRequest, ListViolationsResponse, Violation, ListViolationsPage> { + + private ListViolationsPage( + PageContext context, + ListViolationsResponse response) { + super(context, response); + } + + private static ListViolationsPage createEmptyPage() { + return new ListViolationsPage(null, null); + } + + @Override + protected ListViolationsPage createPage( + PageContext context, + ListViolationsResponse response) { + return new ListViolationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListViolationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListViolationsRequest, + ListViolationsResponse, + Violation, + ListViolationsPage, + ListViolationsFixedSizeCollection> { + + private ListViolationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListViolationsFixedSizeCollection createEmptyCollection() { + return new ListViolationsFixedSizeCollection(null, 0); + } + + @Override + protected ListViolationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListViolationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringSettings.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringSettings.java new file mode 100644 index 000000000000..b946c8905f71 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringSettings.java @@ -0,0 +1,225 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.cloudcontrolspartner.v1beta.stub.CloudControlsPartnerMonitoringStubSettings; +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 CloudControlsPartnerMonitoringClient}. + * + *

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

    + *
  • The default service address (cloudcontrolspartner.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 getViolation 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
+ * CloudControlsPartnerMonitoringSettings.Builder cloudControlsPartnerMonitoringSettingsBuilder =
+ *     CloudControlsPartnerMonitoringSettings.newBuilder();
+ * cloudControlsPartnerMonitoringSettingsBuilder
+ *     .getViolationSettings()
+ *     .setRetrySettings(
+ *         cloudControlsPartnerMonitoringSettingsBuilder
+ *             .getViolationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings =
+ *     cloudControlsPartnerMonitoringSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringSettings + extends ClientSettings { + + /** Returns the object with the settings used for calls to listViolations. */ + public PagedCallSettings< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return ((CloudControlsPartnerMonitoringStubSettings) getStubSettings()) + .listViolationsSettings(); + } + + /** Returns the object with the settings used for calls to getViolation. */ + public UnaryCallSettings getViolationSettings() { + return ((CloudControlsPartnerMonitoringStubSettings) getStubSettings()).getViolationSettings(); + } + + public static final CloudControlsPartnerMonitoringSettings create( + CloudControlsPartnerMonitoringStubSettings stub) throws IOException { + return new CloudControlsPartnerMonitoringSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudControlsPartnerMonitoringStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudControlsPartnerMonitoringStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudControlsPartnerMonitoringStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudControlsPartnerMonitoringSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudControlsPartnerMonitoringSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudControlsPartnerMonitoringStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudControlsPartnerMonitoringSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudControlsPartnerMonitoringStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudControlsPartnerMonitoringStubSettings.newBuilder()); + } + + private static Builder createHttpJsonDefault() { + return new Builder(CloudControlsPartnerMonitoringStubSettings.newHttpJsonBuilder()); + } + + public CloudControlsPartnerMonitoringStubSettings.Builder getStubSettingsBuilder() { + return ((CloudControlsPartnerMonitoringStubSettings.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 listViolations. */ + public PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return getStubSettingsBuilder().listViolationsSettings(); + } + + /** Returns the builder for the settings used for calls to getViolation. */ + public UnaryCallSettings.Builder getViolationSettings() { + return getStubSettingsBuilder().getViolationSettings(); + } + + @Override + public CloudControlsPartnerMonitoringSettings build() throws IOException { + return new CloudControlsPartnerMonitoringSettings(this); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/gapic_metadata.json b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..a174a22cc2ac --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/gapic_metadata.json @@ -0,0 +1,57 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.cloudcontrolspartner.v1beta", + "libraryPackage": "com.google.cloud.cloudcontrolspartner.v1beta", + "services": { + "CloudControlsPartnerCore": { + "clients": { + "grpc": { + "libraryClient": "CloudControlsPartnerCoreClient", + "rpcs": { + "GetCustomer": { + "methods": ["getCustomer", "getCustomer", "getCustomer", "getCustomerCallable"] + }, + "GetEkmConnections": { + "methods": ["getEkmConnections", "getEkmConnections", "getEkmConnections", "getEkmConnectionsCallable"] + }, + "GetPartner": { + "methods": ["getPartner", "getPartner", "getPartner", "getPartnerCallable"] + }, + "GetPartnerPermissions": { + "methods": ["getPartnerPermissions", "getPartnerPermissions", "getPartnerPermissions", "getPartnerPermissionsCallable"] + }, + "GetWorkload": { + "methods": ["getWorkload", "getWorkload", "getWorkload", "getWorkloadCallable"] + }, + "ListAccessApprovalRequests": { + "methods": ["listAccessApprovalRequests", "listAccessApprovalRequests", "listAccessApprovalRequests", "listAccessApprovalRequestsPagedCallable", "listAccessApprovalRequestsCallable"] + }, + "ListCustomers": { + "methods": ["listCustomers", "listCustomers", "listCustomers", "listCustomersPagedCallable", "listCustomersCallable"] + }, + "ListWorkloads": { + "methods": ["listWorkloads", "listWorkloads", "listWorkloads", "listWorkloadsPagedCallable", "listWorkloadsCallable"] + } + } + } + } + }, + "CloudControlsPartnerMonitoring": { + "clients": { + "grpc": { + "libraryClient": "CloudControlsPartnerMonitoringClient", + "rpcs": { + "GetViolation": { + "methods": ["getViolation", "getViolation", "getViolation", "getViolationCallable"] + }, + "ListViolations": { + "methods": ["listViolations", "listViolations", "listViolations", "listViolationsPagedCallable", "listViolationsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/package-info.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/package-info.java new file mode 100644 index 000000000000..6f88f6123697 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/package-info.java @@ -0,0 +1,66 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Controls Partner API + * + *

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

======================= CloudControlsPartnerCoreClient ======================= + * + *

Service Description: Service describing handlers for resources + * + *

Sample for CloudControlsPartnerCoreClient: + * + *

{@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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient =
+ *     CloudControlsPartnerCoreClient.create()) {
+ *   WorkloadName name =
+ *       WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]");
+ *   Workload response = cloudControlsPartnerCoreClient.getWorkload(name);
+ * }
+ * }
+ * + *

======================= CloudControlsPartnerMonitoringClient ======================= + * + *

Service Description: Service describing handlers for resources + * + *

Sample for CloudControlsPartnerMonitoringClient: + * + *

{@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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient =
+ *     CloudControlsPartnerMonitoringClient.create()) {
+ *   ViolationName name =
+ *       ViolationName.of(
+ *           "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]");
+ *   Violation response = cloudControlsPartnerMonitoringClient.getViolation(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.cloudcontrolspartner.v1beta; + +import javax.annotation.Generated; diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerCoreStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerCoreStub.java new file mode 100644 index 000000000000..7301475f1525 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerCoreStub.java @@ -0,0 +1,107 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Partner; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudControlsPartnerCore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CloudControlsPartnerCoreStub implements BackgroundResource { + + public UnaryCallable getWorkloadCallable() { + throw new UnsupportedOperationException("Not implemented: getWorkloadCallable()"); + } + + public UnaryCallable + listWorkloadsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkloadsPagedCallable()"); + } + + public UnaryCallable listWorkloadsCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkloadsCallable()"); + } + + public UnaryCallable getCustomerCallable() { + throw new UnsupportedOperationException("Not implemented: getCustomerCallable()"); + } + + public UnaryCallable + listCustomersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomersPagedCallable()"); + } + + public UnaryCallable listCustomersCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomersCallable()"); + } + + public UnaryCallable getEkmConnectionsCallable() { + throw new UnsupportedOperationException("Not implemented: getEkmConnectionsCallable()"); + } + + public UnaryCallable + getPartnerPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: getPartnerPermissionsCallable()"); + } + + public UnaryCallable + listAccessApprovalRequestsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listAccessApprovalRequestsPagedCallable()"); + } + + public UnaryCallable + listAccessApprovalRequestsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listAccessApprovalRequestsCallable()"); + } + + public UnaryCallable getPartnerCallable() { + throw new UnsupportedOperationException("Not implemented: getPartnerCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerCoreStubSettings.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerCoreStubSettings.java new file mode 100644 index 000000000000..1815e14ff55d --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerCoreStubSettings.java @@ -0,0 +1,757 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Partner; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +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 CloudControlsPartnerCoreStub}. + * + *

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

    + *
  • The default service address (cloudcontrolspartner.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 getWorkload 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
+ * CloudControlsPartnerCoreStubSettings.Builder cloudControlsPartnerCoreSettingsBuilder =
+ *     CloudControlsPartnerCoreStubSettings.newBuilder();
+ * cloudControlsPartnerCoreSettingsBuilder
+ *     .getWorkloadSettings()
+ *     .setRetrySettings(
+ *         cloudControlsPartnerCoreSettingsBuilder
+ *             .getWorkloadSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudControlsPartnerCoreStubSettings cloudControlsPartnerCoreSettings =
+ *     cloudControlsPartnerCoreSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudControlsPartnerCoreStubSettings + 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 UnaryCallSettings getWorkloadSettings; + private final PagedCallSettings< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings; + private final UnaryCallSettings getCustomerSettings; + private final PagedCallSettings< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + listCustomersSettings; + private final UnaryCallSettings + getEkmConnectionsSettings; + private final UnaryCallSettings + getPartnerPermissionsSettings; + private final PagedCallSettings< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings; + private final UnaryCallSettings getPartnerSettings; + + private static final PagedListDescriptor + LIST_WORKLOADS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWorkloadsRequest injectToken(ListWorkloadsRequest payload, String token) { + return ListWorkloadsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWorkloadsRequest injectPageSize(ListWorkloadsRequest payload, int pageSize) { + return ListWorkloadsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWorkloadsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWorkloadsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWorkloadsResponse payload) { + return payload.getWorkloadsList() == null + ? ImmutableList.of() + : payload.getWorkloadsList(); + } + }; + + private static final PagedListDescriptor + LIST_CUSTOMERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCustomersRequest injectToken(ListCustomersRequest payload, String token) { + return ListCustomersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCustomersRequest injectPageSize(ListCustomersRequest payload, int pageSize) { + return ListCustomersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCustomersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCustomersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCustomersResponse payload) { + return payload.getCustomersList() == null + ? ImmutableList.of() + : payload.getCustomersList(); + } + }; + + private static final PagedListDescriptor< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + LIST_ACCESS_APPROVAL_REQUESTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAccessApprovalRequestsRequest injectToken( + ListAccessApprovalRequestsRequest payload, String token) { + return ListAccessApprovalRequestsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListAccessApprovalRequestsRequest injectPageSize( + ListAccessApprovalRequestsRequest payload, int pageSize) { + return ListAccessApprovalRequestsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListAccessApprovalRequestsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAccessApprovalRequestsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListAccessApprovalRequestsResponse payload) { + return payload.getAccessApprovalRequestsList() == null + ? ImmutableList.of() + : payload.getAccessApprovalRequestsList(); + } + }; + + private static final PagedListResponseFactory< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + LIST_WORKLOADS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWorkloadsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_WORKLOADS_PAGE_STR_DESC, request, context); + return ListWorkloadsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + LIST_CUSTOMERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCustomersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CUSTOMERS_PAGE_STR_DESC, request, context); + return ListCustomersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + LIST_ACCESS_APPROVAL_REQUESTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListAccessApprovalRequestsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + AccessApprovalRequest> + pageContext = + PageContext.create( + callable, LIST_ACCESS_APPROVAL_REQUESTS_PAGE_STR_DESC, request, context); + return ListAccessApprovalRequestsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getWorkload. */ + public UnaryCallSettings getWorkloadSettings() { + return getWorkloadSettings; + } + + /** Returns the object with the settings used for calls to listWorkloads. */ + public PagedCallSettings + listWorkloadsSettings() { + return listWorkloadsSettings; + } + + /** Returns the object with the settings used for calls to getCustomer. */ + public UnaryCallSettings getCustomerSettings() { + return getCustomerSettings; + } + + /** Returns the object with the settings used for calls to listCustomers. */ + public PagedCallSettings + listCustomersSettings() { + return listCustomersSettings; + } + + /** Returns the object with the settings used for calls to getEkmConnections. */ + public UnaryCallSettings getEkmConnectionsSettings() { + return getEkmConnectionsSettings; + } + + /** Returns the object with the settings used for calls to getPartnerPermissions. */ + public UnaryCallSettings + getPartnerPermissionsSettings() { + return getPartnerPermissionsSettings; + } + + /** Returns the object with the settings used for calls to listAccessApprovalRequests. */ + public PagedCallSettings< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings() { + return listAccessApprovalRequestsSettings; + } + + /** Returns the object with the settings used for calls to getPartner. */ + public UnaryCallSettings getPartnerSettings() { + return getPartnerSettings; + } + + public CloudControlsPartnerCoreStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudControlsPartnerCoreStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudControlsPartnerCoreStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudcontrolspartner"; + } + + /** 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 "cloudcontrolspartner.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudcontrolspartner.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudControlsPartnerCoreStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudControlsPartnerCoreStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudControlsPartnerCoreStubSettings.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 CloudControlsPartnerCoreStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getWorkloadSettings = settingsBuilder.getWorkloadSettings().build(); + listWorkloadsSettings = settingsBuilder.listWorkloadsSettings().build(); + getCustomerSettings = settingsBuilder.getCustomerSettings().build(); + listCustomersSettings = settingsBuilder.listCustomersSettings().build(); + getEkmConnectionsSettings = settingsBuilder.getEkmConnectionsSettings().build(); + getPartnerPermissionsSettings = settingsBuilder.getPartnerPermissionsSettings().build(); + listAccessApprovalRequestsSettings = + settingsBuilder.listAccessApprovalRequestsSettings().build(); + getPartnerSettings = settingsBuilder.getPartnerSettings().build(); + } + + /** Builder for CloudControlsPartnerCoreStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getWorkloadSettings; + private final PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings; + private final UnaryCallSettings.Builder getCustomerSettings; + private final PagedCallSettings.Builder< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + listCustomersSettings; + private final UnaryCallSettings.Builder + getEkmConnectionsSettings; + private final UnaryCallSettings.Builder + getPartnerPermissionsSettings; + private final PagedCallSettings.Builder< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings; + private final UnaryCallSettings.Builder getPartnerSettings; + 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))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + 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); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getWorkloadSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listWorkloadsSettings = PagedCallSettings.newBuilder(LIST_WORKLOADS_PAGE_STR_FACT); + getCustomerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listCustomersSettings = PagedCallSettings.newBuilder(LIST_CUSTOMERS_PAGE_STR_FACT); + getEkmConnectionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getPartnerPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listAccessApprovalRequestsSettings = + PagedCallSettings.newBuilder(LIST_ACCESS_APPROVAL_REQUESTS_PAGE_STR_FACT); + getPartnerSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getWorkloadSettings, + listWorkloadsSettings, + getCustomerSettings, + listCustomersSettings, + getEkmConnectionsSettings, + getPartnerPermissionsSettings, + listAccessApprovalRequestsSettings, + getPartnerSettings); + initDefaults(this); + } + + protected Builder(CloudControlsPartnerCoreStubSettings settings) { + super(settings); + + getWorkloadSettings = settings.getWorkloadSettings.toBuilder(); + listWorkloadsSettings = settings.listWorkloadsSettings.toBuilder(); + getCustomerSettings = settings.getCustomerSettings.toBuilder(); + listCustomersSettings = settings.listCustomersSettings.toBuilder(); + getEkmConnectionsSettings = settings.getEkmConnectionsSettings.toBuilder(); + getPartnerPermissionsSettings = settings.getPartnerPermissionsSettings.toBuilder(); + listAccessApprovalRequestsSettings = settings.listAccessApprovalRequestsSettings.toBuilder(); + getPartnerSettings = settings.getPartnerSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getWorkloadSettings, + listWorkloadsSettings, + getCustomerSettings, + listCustomersSettings, + getEkmConnectionsSettings, + getPartnerPermissionsSettings, + listAccessApprovalRequestsSettings, + getPartnerSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getWorkloadSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listWorkloadsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getCustomerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listCustomersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getEkmConnectionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getPartnerPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listAccessApprovalRequestsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getPartnerSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_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 getWorkload. */ + public UnaryCallSettings.Builder getWorkloadSettings() { + return getWorkloadSettings; + } + + /** Returns the builder for the settings used for calls to listWorkloads. */ + public PagedCallSettings.Builder< + ListWorkloadsRequest, ListWorkloadsResponse, ListWorkloadsPagedResponse> + listWorkloadsSettings() { + return listWorkloadsSettings; + } + + /** Returns the builder for the settings used for calls to getCustomer. */ + public UnaryCallSettings.Builder getCustomerSettings() { + return getCustomerSettings; + } + + /** Returns the builder for the settings used for calls to listCustomers. */ + public PagedCallSettings.Builder< + ListCustomersRequest, ListCustomersResponse, ListCustomersPagedResponse> + listCustomersSettings() { + return listCustomersSettings; + } + + /** Returns the builder for the settings used for calls to getEkmConnections. */ + public UnaryCallSettings.Builder + getEkmConnectionsSettings() { + return getEkmConnectionsSettings; + } + + /** Returns the builder for the settings used for calls to getPartnerPermissions. */ + public UnaryCallSettings.Builder + getPartnerPermissionsSettings() { + return getPartnerPermissionsSettings; + } + + /** Returns the builder for the settings used for calls to listAccessApprovalRequests. */ + public PagedCallSettings.Builder< + ListAccessApprovalRequestsRequest, + ListAccessApprovalRequestsResponse, + ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsSettings() { + return listAccessApprovalRequestsSettings; + } + + /** Returns the builder for the settings used for calls to getPartner. */ + public UnaryCallSettings.Builder getPartnerSettings() { + return getPartnerSettings; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public CloudControlsPartnerCoreStubSettings build() throws IOException { + return new CloudControlsPartnerCoreStubSettings(this); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerMonitoringStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerMonitoringStub.java new file mode 100644 index 000000000000..3960c42443e6 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerMonitoringStub.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CloudControlsPartnerMonitoringStub implements BackgroundResource { + + public UnaryCallable + listViolationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listViolationsPagedCallable()"); + } + + public UnaryCallable listViolationsCallable() { + throw new UnsupportedOperationException("Not implemented: listViolationsCallable()"); + } + + public UnaryCallable getViolationCallable() { + throw new UnsupportedOperationException("Not implemented: getViolationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerMonitoringStubSettings.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerMonitoringStubSettings.java new file mode 100644 index 000000000000..cfd80c988b3a --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/CloudControlsPartnerMonitoringStubSettings.java @@ -0,0 +1,448 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +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 CloudControlsPartnerMonitoringStub}. + * + *

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

    + *
  • The default service address (cloudcontrolspartner.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 getViolation 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
+ * CloudControlsPartnerMonitoringStubSettings.Builder
+ *     cloudControlsPartnerMonitoringSettingsBuilder =
+ *         CloudControlsPartnerMonitoringStubSettings.newBuilder();
+ * cloudControlsPartnerMonitoringSettingsBuilder
+ *     .getViolationSettings()
+ *     .setRetrySettings(
+ *         cloudControlsPartnerMonitoringSettingsBuilder
+ *             .getViolationSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudControlsPartnerMonitoringStubSettings cloudControlsPartnerMonitoringSettings =
+ *     cloudControlsPartnerMonitoringSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringStubSettings + 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< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings; + private final UnaryCallSettings getViolationSettings; + + private static final PagedListDescriptor + LIST_VIOLATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListViolationsRequest injectToken(ListViolationsRequest payload, String token) { + return ListViolationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListViolationsRequest injectPageSize( + ListViolationsRequest payload, int pageSize) { + return ListViolationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListViolationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListViolationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListViolationsResponse payload) { + return payload.getViolationsList() == null + ? ImmutableList.of() + : payload.getViolationsList(); + } + }; + + private static final PagedListResponseFactory< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + LIST_VIOLATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListViolationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VIOLATIONS_PAGE_STR_DESC, request, context); + return ListViolationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listViolations. */ + public PagedCallSettings< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return listViolationsSettings; + } + + /** Returns the object with the settings used for calls to getViolation. */ + public UnaryCallSettings getViolationSettings() { + return getViolationSettings; + } + + public CloudControlsPartnerMonitoringStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudControlsPartnerMonitoringStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudControlsPartnerMonitoringStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "cloudcontrolspartner"; + } + + /** 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 "cloudcontrolspartner.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudcontrolspartner.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(CloudControlsPartnerMonitoringStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(CloudControlsPartnerMonitoringStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudControlsPartnerMonitoringStubSettings.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 CloudControlsPartnerMonitoringStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listViolationsSettings = settingsBuilder.listViolationsSettings().build(); + getViolationSettings = settingsBuilder.getViolationSettings().build(); + } + + /** Builder for CloudControlsPartnerMonitoringStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings; + private final UnaryCallSettings.Builder getViolationSettings; + 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); + + listViolationsSettings = PagedCallSettings.newBuilder(LIST_VIOLATIONS_PAGE_STR_FACT); + getViolationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listViolationsSettings, getViolationSettings); + initDefaults(this); + } + + protected Builder(CloudControlsPartnerMonitoringStubSettings settings) { + super(settings); + + listViolationsSettings = settings.listViolationsSettings.toBuilder(); + getViolationSettings = settings.getViolationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listViolationsSettings, getViolationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listViolationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getViolationSettings() + .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 listViolations. */ + public PagedCallSettings.Builder< + ListViolationsRequest, ListViolationsResponse, ListViolationsPagedResponse> + listViolationsSettings() { + return listViolationsSettings; + } + + /** Returns the builder for the settings used for calls to getViolation. */ + public UnaryCallSettings.Builder getViolationSettings() { + return getViolationSettings; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public CloudControlsPartnerMonitoringStubSettings build() throws IOException { + return new CloudControlsPartnerMonitoringStubSettings(this); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerCoreCallableFactory.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerCoreCallableFactory.java new file mode 100644 index 000000000000..defa3bb68d05 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerCoreCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the CloudControlsPartnerCore service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudControlsPartnerCoreCallableFactory 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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerCoreStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerCoreStub.java new file mode 100644 index 000000000000..a806343cb05c --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerCoreStub.java @@ -0,0 +1,442 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Partner; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +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 CloudControlsPartnerCore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudControlsPartnerCoreStub extends CloudControlsPartnerCoreStub { + private static final MethodDescriptor getWorkloadMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetWorkload") + .setRequestMarshaller(ProtoUtils.marshaller(GetWorkloadRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Workload.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listWorkloadsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/ListWorkloads") + .setRequestMarshaller( + ProtoUtils.marshaller(ListWorkloadsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListWorkloadsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getCustomerMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetCustomer") + .setRequestMarshaller(ProtoUtils.marshaller(GetCustomerRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Customer.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listCustomersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/ListCustomers") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCustomersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCustomersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getEkmConnectionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetEkmConnections") + .setRequestMarshaller( + ProtoUtils.marshaller(GetEkmConnectionsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(EkmConnections.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getPartnerPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetPartnerPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(GetPartnerPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PartnerPermissions.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsResponse> + listAccessApprovalRequestsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/ListAccessApprovalRequests") + .setRequestMarshaller( + ProtoUtils.marshaller(ListAccessApprovalRequestsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListAccessApprovalRequestsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getPartnerMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetPartner") + .setRequestMarshaller(ProtoUtils.marshaller(GetPartnerRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Partner.getDefaultInstance())) + .build(); + + private final UnaryCallable getWorkloadCallable; + private final UnaryCallable listWorkloadsCallable; + private final UnaryCallable + listWorkloadsPagedCallable; + private final UnaryCallable getCustomerCallable; + private final UnaryCallable listCustomersCallable; + private final UnaryCallable + listCustomersPagedCallable; + private final UnaryCallable getEkmConnectionsCallable; + private final UnaryCallable + getPartnerPermissionsCallable; + private final UnaryCallable + listAccessApprovalRequestsCallable; + private final UnaryCallable< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsPagedCallable; + private final UnaryCallable getPartnerCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudControlsPartnerCoreStub create( + CloudControlsPartnerCoreStubSettings settings) throws IOException { + return new GrpcCloudControlsPartnerCoreStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudControlsPartnerCoreStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudControlsPartnerCoreStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudControlsPartnerCoreStub, 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 GrpcCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCloudControlsPartnerCoreCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudControlsPartnerCoreStub, 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 GrpcCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getWorkloadTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWorkloadMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listWorkloadsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listWorkloadsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getCustomerTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCustomerMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listCustomersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCustomersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getEkmConnectionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getEkmConnectionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getPartnerPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPartnerPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listAccessApprovalRequestsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listAccessApprovalRequestsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getPartnerTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPartnerMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getWorkloadCallable = + callableFactory.createUnaryCallable( + getWorkloadTransportSettings, settings.getWorkloadSettings(), clientContext); + this.listWorkloadsCallable = + callableFactory.createUnaryCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.listWorkloadsPagedCallable = + callableFactory.createPagedCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.getCustomerCallable = + callableFactory.createUnaryCallable( + getCustomerTransportSettings, settings.getCustomerSettings(), clientContext); + this.listCustomersCallable = + callableFactory.createUnaryCallable( + listCustomersTransportSettings, settings.listCustomersSettings(), clientContext); + this.listCustomersPagedCallable = + callableFactory.createPagedCallable( + listCustomersTransportSettings, settings.listCustomersSettings(), clientContext); + this.getEkmConnectionsCallable = + callableFactory.createUnaryCallable( + getEkmConnectionsTransportSettings, + settings.getEkmConnectionsSettings(), + clientContext); + this.getPartnerPermissionsCallable = + callableFactory.createUnaryCallable( + getPartnerPermissionsTransportSettings, + settings.getPartnerPermissionsSettings(), + clientContext); + this.listAccessApprovalRequestsCallable = + callableFactory.createUnaryCallable( + listAccessApprovalRequestsTransportSettings, + settings.listAccessApprovalRequestsSettings(), + clientContext); + this.listAccessApprovalRequestsPagedCallable = + callableFactory.createPagedCallable( + listAccessApprovalRequestsTransportSettings, + settings.listAccessApprovalRequestsSettings(), + clientContext); + this.getPartnerCallable = + callableFactory.createUnaryCallable( + getPartnerTransportSettings, settings.getPartnerSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getWorkloadCallable() { + return getWorkloadCallable; + } + + @Override + public UnaryCallable listWorkloadsCallable() { + return listWorkloadsCallable; + } + + @Override + public UnaryCallable + listWorkloadsPagedCallable() { + return listWorkloadsPagedCallable; + } + + @Override + public UnaryCallable getCustomerCallable() { + return getCustomerCallable; + } + + @Override + public UnaryCallable listCustomersCallable() { + return listCustomersCallable; + } + + @Override + public UnaryCallable + listCustomersPagedCallable() { + return listCustomersPagedCallable; + } + + @Override + public UnaryCallable getEkmConnectionsCallable() { + return getEkmConnectionsCallable; + } + + @Override + public UnaryCallable + getPartnerPermissionsCallable() { + return getPartnerPermissionsCallable; + } + + @Override + public UnaryCallable + listAccessApprovalRequestsCallable() { + return listAccessApprovalRequestsCallable; + } + + @Override + public UnaryCallable + listAccessApprovalRequestsPagedCallable() { + return listAccessApprovalRequestsPagedCallable; + } + + @Override + public UnaryCallable getPartnerCallable() { + return getPartnerCallable; + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerMonitoringCallableFactory.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerMonitoringCallableFactory.java new file mode 100644 index 000000000000..08472b51eff7 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerMonitoringCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudControlsPartnerMonitoringCallableFactory 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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerMonitoringStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerMonitoringStub.java new file mode 100644 index 000000000000..10bafff272e8 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/GrpcCloudControlsPartnerMonitoringStub.java @@ -0,0 +1,214 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +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 CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudControlsPartnerMonitoringStub extends CloudControlsPartnerMonitoringStub { + private static final MethodDescriptor + listViolationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoring/ListViolations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListViolationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListViolationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getViolationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoring/GetViolation") + .setRequestMarshaller(ProtoUtils.marshaller(GetViolationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Violation.getDefaultInstance())) + .build(); + + private final UnaryCallable listViolationsCallable; + private final UnaryCallable + listViolationsPagedCallable; + private final UnaryCallable getViolationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudControlsPartnerMonitoringStub create( + CloudControlsPartnerMonitoringStubSettings settings) throws IOException { + return new GrpcCloudControlsPartnerMonitoringStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudControlsPartnerMonitoringStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudControlsPartnerMonitoringStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcCloudControlsPartnerMonitoringStub, 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 GrpcCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCloudControlsPartnerMonitoringCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudControlsPartnerMonitoringStub, 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 GrpcCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listViolationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listViolationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getViolationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getViolationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listViolationsCallable = + callableFactory.createUnaryCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.listViolationsPagedCallable = + callableFactory.createPagedCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.getViolationCallable = + callableFactory.createUnaryCallable( + getViolationTransportSettings, settings.getViolationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listViolationsCallable() { + return listViolationsCallable; + } + + @Override + public UnaryCallable + listViolationsPagedCallable() { + return listViolationsPagedCallable; + } + + @Override + public UnaryCallable getViolationCallable() { + return getViolationCallable; + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerCoreCallableFactory.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerCoreCallableFactory.java new file mode 100644 index 000000000000..dd53ae69bc9a --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerCoreCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the CloudControlsPartnerCore service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudControlsPartnerCoreCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerCoreStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerCoreStub.java new file mode 100644 index 000000000000..78bdc96ba7b2 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerCoreStub.java @@ -0,0 +1,678 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Partner; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +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 CloudControlsPartnerCore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudControlsPartnerCoreStub extends CloudControlsPartnerCoreStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + getWorkloadMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetWorkload") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=organizations/*/locations/*/customers/*/workloads/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Workload.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listWorkloadsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/ListWorkloads") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=organizations/*/locations/*/customers/*}/workloads", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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(ListWorkloadsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getCustomerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetCustomer") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=organizations/*/locations/*/customers/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Customer.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listCustomersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/ListCustomers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=organizations/*/locations/*}/customers", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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(ListCustomersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getEkmConnectionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetEkmConnections") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=organizations/*/locations/*/customers/*/workloads/*/ekmConnections}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EkmConnections.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getPartnerPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetPartnerPermissions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=organizations/*/locations/*/customers/*/workloads/*/partnerPermissions}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PartnerPermissions.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsResponse> + listAccessApprovalRequestsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/ListAccessApprovalRequests") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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(ListAccessApprovalRequestsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getPartnerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore/GetPartner") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=organizations/*/locations/*/partner}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Partner.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getWorkloadCallable; + private final UnaryCallable listWorkloadsCallable; + private final UnaryCallable + listWorkloadsPagedCallable; + private final UnaryCallable getCustomerCallable; + private final UnaryCallable listCustomersCallable; + private final UnaryCallable + listCustomersPagedCallable; + private final UnaryCallable getEkmConnectionsCallable; + private final UnaryCallable + getPartnerPermissionsCallable; + private final UnaryCallable + listAccessApprovalRequestsCallable; + private final UnaryCallable< + ListAccessApprovalRequestsRequest, ListAccessApprovalRequestsPagedResponse> + listAccessApprovalRequestsPagedCallable; + private final UnaryCallable getPartnerCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudControlsPartnerCoreStub create( + CloudControlsPartnerCoreStubSettings settings) throws IOException { + return new HttpJsonCloudControlsPartnerCoreStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudControlsPartnerCoreStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudControlsPartnerCoreStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudControlsPartnerCoreStub, 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 HttpJsonCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonCloudControlsPartnerCoreCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudControlsPartnerCoreStub, 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 HttpJsonCloudControlsPartnerCoreStub( + CloudControlsPartnerCoreStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings getWorkloadTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getWorkloadMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listWorkloadsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listWorkloadsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getCustomerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getCustomerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listCustomersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listCustomersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getEkmConnectionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getEkmConnectionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getPartnerPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPartnerPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listAccessApprovalRequestsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listAccessApprovalRequestsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getPartnerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPartnerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.getWorkloadCallable = + callableFactory.createUnaryCallable( + getWorkloadTransportSettings, settings.getWorkloadSettings(), clientContext); + this.listWorkloadsCallable = + callableFactory.createUnaryCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.listWorkloadsPagedCallable = + callableFactory.createPagedCallable( + listWorkloadsTransportSettings, settings.listWorkloadsSettings(), clientContext); + this.getCustomerCallable = + callableFactory.createUnaryCallable( + getCustomerTransportSettings, settings.getCustomerSettings(), clientContext); + this.listCustomersCallable = + callableFactory.createUnaryCallable( + listCustomersTransportSettings, settings.listCustomersSettings(), clientContext); + this.listCustomersPagedCallable = + callableFactory.createPagedCallable( + listCustomersTransportSettings, settings.listCustomersSettings(), clientContext); + this.getEkmConnectionsCallable = + callableFactory.createUnaryCallable( + getEkmConnectionsTransportSettings, + settings.getEkmConnectionsSettings(), + clientContext); + this.getPartnerPermissionsCallable = + callableFactory.createUnaryCallable( + getPartnerPermissionsTransportSettings, + settings.getPartnerPermissionsSettings(), + clientContext); + this.listAccessApprovalRequestsCallable = + callableFactory.createUnaryCallable( + listAccessApprovalRequestsTransportSettings, + settings.listAccessApprovalRequestsSettings(), + clientContext); + this.listAccessApprovalRequestsPagedCallable = + callableFactory.createPagedCallable( + listAccessApprovalRequestsTransportSettings, + settings.listAccessApprovalRequestsSettings(), + clientContext); + this.getPartnerCallable = + callableFactory.createUnaryCallable( + getPartnerTransportSettings, settings.getPartnerSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getWorkloadMethodDescriptor); + methodDescriptors.add(listWorkloadsMethodDescriptor); + methodDescriptors.add(getCustomerMethodDescriptor); + methodDescriptors.add(listCustomersMethodDescriptor); + methodDescriptors.add(getEkmConnectionsMethodDescriptor); + methodDescriptors.add(getPartnerPermissionsMethodDescriptor); + methodDescriptors.add(listAccessApprovalRequestsMethodDescriptor); + methodDescriptors.add(getPartnerMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable getWorkloadCallable() { + return getWorkloadCallable; + } + + @Override + public UnaryCallable listWorkloadsCallable() { + return listWorkloadsCallable; + } + + @Override + public UnaryCallable + listWorkloadsPagedCallable() { + return listWorkloadsPagedCallable; + } + + @Override + public UnaryCallable getCustomerCallable() { + return getCustomerCallable; + } + + @Override + public UnaryCallable listCustomersCallable() { + return listCustomersCallable; + } + + @Override + public UnaryCallable + listCustomersPagedCallable() { + return listCustomersPagedCallable; + } + + @Override + public UnaryCallable getEkmConnectionsCallable() { + return getEkmConnectionsCallable; + } + + @Override + public UnaryCallable + getPartnerPermissionsCallable() { + return getPartnerPermissionsCallable; + } + + @Override + public UnaryCallable + listAccessApprovalRequestsCallable() { + return listAccessApprovalRequestsCallable; + } + + @Override + public UnaryCallable + listAccessApprovalRequestsPagedCallable() { + return listAccessApprovalRequestsPagedCallable; + } + + @Override + public UnaryCallable getPartnerCallable() { + return getPartnerCallable; + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerMonitoringCallableFactory.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerMonitoringCallableFactory.java new file mode 100644 index 000000000000..8ab908c5873d --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerMonitoringCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudControlsPartnerMonitoringCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerMonitoringStub.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerMonitoringStub.java new file mode 100644 index 000000000000..54adac37adb7 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/stub/HttpJsonCloudControlsPartnerMonitoringStub.java @@ -0,0 +1,280 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +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 CloudControlsPartnerMonitoring service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudControlsPartnerMonitoringStub extends CloudControlsPartnerMonitoringStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + listViolationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoring/ListViolations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=organizations/*/locations/*/customers/*/workloads/*}/violations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "interval", request.getInterval()); + 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(ListViolationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getViolationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoring/GetViolation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=organizations/*/locations/*/customers/*/workloads/*/violations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Violation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listViolationsCallable; + private final UnaryCallable + listViolationsPagedCallable; + private final UnaryCallable getViolationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudControlsPartnerMonitoringStub create( + CloudControlsPartnerMonitoringStubSettings settings) throws IOException { + return new HttpJsonCloudControlsPartnerMonitoringStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudControlsPartnerMonitoringStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudControlsPartnerMonitoringStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudControlsPartnerMonitoringStub, 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 HttpJsonCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonCloudControlsPartnerMonitoringCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudControlsPartnerMonitoringStub, 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 HttpJsonCloudControlsPartnerMonitoringStub( + CloudControlsPartnerMonitoringStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + listViolationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listViolationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getViolationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getViolationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listViolationsCallable = + callableFactory.createUnaryCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.listViolationsPagedCallable = + callableFactory.createPagedCallable( + listViolationsTransportSettings, settings.listViolationsSettings(), clientContext); + this.getViolationCallable = + callableFactory.createUnaryCallable( + getViolationTransportSettings, settings.getViolationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listViolationsMethodDescriptor); + methodDescriptors.add(getViolationMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable listViolationsCallable() { + return listViolationsCallable; + } + + @Override + public UnaryCallable + listViolationsPagedCallable() { + return listViolationsPagedCallable; + } + + @Override + public UnaryCallable getViolationCallable() { + return getViolationCallable; + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/resources/META-INF/native-image/com.google.cloud.cloudcontrolspartner.v1/reflect-config.json b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/resources/META-INF/native-image/com.google.cloud.cloudcontrolspartner.v1/reflect-config.json new file mode 100644 index 000000000000..0de2fd3a4479 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/resources/META-INF/native-image/com.google.cloud.cloudcontrolspartner.v1/reflect-config.json @@ -0,0 +1,1883 @@ +[ + { + "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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.AccessReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.AccessReason$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.AccessReason$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.CompletionState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Customer", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Customer$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep$Step", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmConnection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmConnection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmConnection$ConnectionError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmConnection$ConnectionError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmConnection$ConnectionState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmConnections", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmConnections$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.EkmMetadata$EkmSolution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Partner", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Partner$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions$Permission", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Sku", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Sku$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation$Instructions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation$Instructions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation$Instructions$Console", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation$Instructions$Console$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation$Instructions$Gcloud", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation$Instructions$Gcloud$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$Remediation$RemediationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Violation$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Workload", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Workload$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.Workload$Partner", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep$Step", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.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.type.Interval", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Interval$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/resources/META-INF/native-image/com.google.cloud.cloudcontrolspartner.v1beta/reflect-config.json b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/resources/META-INF/native-image/com.google.cloud.cloudcontrolspartner.v1beta/reflect-config.json new file mode 100644 index 000000000000..09d2653ace57 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/main/resources/META-INF/native-image/com.google.cloud.cloudcontrolspartner.v1beta/reflect-config.json @@ -0,0 +1,1883 @@ +[ + { + "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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.AccessReason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.AccessReason$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.AccessReason$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.CompletionState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Customer", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Customer$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep$Step", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection$ConnectionError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection$ConnectionError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection$ConnectionState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata$EkmSolution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Partner", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Partner$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions$Permission", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Sku", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Sku$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation$Instructions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation$Instructions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation$Instructions$Console", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation$Instructions$Console$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation$Instructions$Gcloud", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation$Instructions$Gcloud$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$Remediation$RemediationType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Violation$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Workload", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Workload$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.Workload$Partner", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep$Step", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.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.type.Interval", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Interval$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClientHttpJsonTest.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClientHttpJsonTest.java new file mode 100644 index 000000000000..d97482379cfb --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClientHttpJsonTest.java @@ -0,0 +1,891 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.cloud.cloudcontrolspartner.v1.stub.HttpJsonCloudControlsPartnerCoreStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudControlsPartnerCoreClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudControlsPartnerCoreClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudControlsPartnerCoreStub.getMethodDescriptors(), + CloudControlsPartnerCoreSettings.getDefaultEndpoint()); + CloudControlsPartnerCoreSettings settings = + CloudControlsPartnerCoreSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudControlsPartnerCoreSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudControlsPartnerCoreClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getWorkloadTest() throws Exception { + Workload expectedResponse = + Workload.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setFolderId(527488652) + .setCreateTime(Timestamp.newBuilder().build()) + .setFolder("folder-1268966290") + .setWorkloadOnboardingState(WorkloadOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .setKeyManagementProjectId("keyManagementProjectId-288019406") + .setLocation("location1901043637") + .build(); + mockService.addResponse(expectedResponse); + + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + Workload actualResponse = client.getWorkload(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 getWorkloadExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkloadName name = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkloadTest2() throws Exception { + Workload expectedResponse = + Workload.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setFolderId(527488652) + .setCreateTime(Timestamp.newBuilder().build()) + .setFolder("folder-1268966290") + .setWorkloadOnboardingState(WorkloadOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .setKeyManagementProjectId("keyManagementProjectId-288019406") + .setLocation("location1901043637") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-9053/locations/location-9053/customers/customer-9053/workloads/workload-9053"; + + Workload actualResponse = client.getWorkload(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 getWorkloadExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-9053/locations/location-9053/customers/customer-9053/workloads/workload-9053"; + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkloadsTest() throws Exception { + Workload responsesElement = Workload.newBuilder().build(); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkloads(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().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 listWorkloadsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkloadsTest2() throws Exception { + Workload responsesElement = Workload.newBuilder().build(); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkloads(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "organizations/organization-2196/locations/location-2196/customers/customer-2196"; + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().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 listWorkloadsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "organizations/organization-2196/locations/location-2196/customers/customer-2196"; + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomerTest() throws Exception { + Customer expectedResponse = + Customer.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setDisplayName("displayName1714148973") + .setCustomerOnboardingState(CustomerOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .build(); + mockService.addResponse(expectedResponse); + + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + + Customer actualResponse = client.getCustomer(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 getCustomerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + client.getCustomer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomerTest2() throws Exception { + Customer expectedResponse = + Customer.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setDisplayName("displayName1714148973") + .setCustomerOnboardingState(CustomerOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "organizations/organization-3989/locations/location-3989/customers/customer-3989"; + + Customer actualResponse = client.getCustomer(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 getCustomerExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-3989/locations/location-3989/customers/customer-3989"; + client.getCustomer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomersTest() throws Exception { + Customer responsesElement = Customer.newBuilder().build(); + ListCustomersResponse expectedResponse = + ListCustomersResponse.newBuilder() + .setNextPageToken("") + .addAllCustomers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListCustomersPagedResponse pagedListResponse = client.listCustomers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomersList().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 listCustomersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listCustomers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomersTest2() throws Exception { + Customer responsesElement = Customer.newBuilder().build(); + ListCustomersResponse expectedResponse = + ListCustomersResponse.newBuilder() + .setNextPageToken("") + .addAllCustomers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-9365/locations/location-9365"; + + ListCustomersPagedResponse pagedListResponse = client.listCustomers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomersList().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 listCustomersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "organizations/organization-9365/locations/location-9365"; + client.listCustomers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEkmConnectionsTest() throws Exception { + EkmConnections expectedResponse = + EkmConnections.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllEkmConnections(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + EkmConnections actualResponse = client.getEkmConnections(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 getEkmConnectionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getEkmConnections(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEkmConnectionsTest2() throws Exception { + EkmConnections expectedResponse = + EkmConnections.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllEkmConnections(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-9542/locations/location-9542/customers/customer-9542/workloads/workload-9542/ekmConnections"; + + EkmConnections actualResponse = client.getEkmConnections(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 getEkmConnectionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-9542/locations/location-9542/customers/customer-9542/workloads/workload-9542/ekmConnections"; + client.getEkmConnections(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerPermissionsTest() throws Exception { + PartnerPermissions expectedResponse = + PartnerPermissions.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllPartnerPermissions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + PartnerPermissions actualResponse = client.getPartnerPermissions(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 getPartnerPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getPartnerPermissions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerPermissionsTest2() throws Exception { + PartnerPermissions expectedResponse = + PartnerPermissions.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllPartnerPermissions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-6888/locations/location-6888/customers/customer-6888/workloads/workload-6888/partnerPermissions"; + + PartnerPermissions actualResponse = client.getPartnerPermissions(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 getPartnerPermissionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-6888/locations/location-6888/customers/customer-6888/workloads/workload-6888/partnerPermissions"; + client.getPartnerPermissions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccessApprovalRequestsTest() throws Exception { + AccessApprovalRequest responsesElement = AccessApprovalRequest.newBuilder().build(); + ListAccessApprovalRequestsResponse expectedResponse = + ListAccessApprovalRequestsResponse.newBuilder() + .setNextPageToken("") + .addAllAccessApprovalRequests(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + ListAccessApprovalRequestsPagedResponse pagedListResponse = + client.listAccessApprovalRequests(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccessApprovalRequestsList().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 listAccessApprovalRequestsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.listAccessApprovalRequests(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccessApprovalRequestsTest2() throws Exception { + AccessApprovalRequest responsesElement = AccessApprovalRequest.newBuilder().build(); + ListAccessApprovalRequestsResponse expectedResponse = + ListAccessApprovalRequestsResponse.newBuilder() + .setNextPageToken("") + .addAllAccessApprovalRequests(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "organizations/organization-2148/locations/location-2148/customers/customer-2148/workloads/workload-2148"; + + ListAccessApprovalRequestsPagedResponse pagedListResponse = + client.listAccessApprovalRequests(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccessApprovalRequestsList().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 listAccessApprovalRequestsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "organizations/organization-2148/locations/location-2148/customers/customer-2148/workloads/workload-2148"; + client.listAccessApprovalRequests(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerTest() throws Exception { + Partner expectedResponse = + Partner.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .addAllSkus(new ArrayList()) + .addAllEkmSolutions(new ArrayList()) + .addAllOperatedCloudRegions(new ArrayList()) + .setPartnerProjectId("partnerProjectId2071402028") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + + Partner actualResponse = client.getPartner(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 getPartnerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + client.getPartner(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerTest2() throws Exception { + Partner expectedResponse = + Partner.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .addAllSkus(new ArrayList()) + .addAllEkmSolutions(new ArrayList()) + .addAllOperatedCloudRegions(new ArrayList()) + .setPartnerProjectId("partnerProjectId2071402028") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "organizations/organization-435/locations/location-435/partner"; + + Partner actualResponse = client.getPartner(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 getPartnerExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "organizations/organization-435/locations/location-435/partner"; + client.getPartner(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClientTest.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClientTest.java new file mode 100644 index 000000000000..2380c9a75f85 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreClientTest.java @@ -0,0 +1,792 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudControlsPartnerCoreClientTest { + private static MockCloudControlsPartnerCore mockCloudControlsPartnerCore; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudControlsPartnerCoreClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudControlsPartnerCore = new MockCloudControlsPartnerCore(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudControlsPartnerCore)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudControlsPartnerCoreSettings settings = + CloudControlsPartnerCoreSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudControlsPartnerCoreClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getWorkloadTest() throws Exception { + Workload expectedResponse = + Workload.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setFolderId(527488652) + .setCreateTime(Timestamp.newBuilder().build()) + .setFolder("folder-1268966290") + .setWorkloadOnboardingState(WorkloadOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .setKeyManagementProjectId("keyManagementProjectId-288019406") + .setLocation("location1901043637") + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + Workload actualResponse = client.getWorkload(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkloadRequest actualRequest = ((GetWorkloadRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkloadExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + WorkloadName name = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkloadTest2() throws Exception { + Workload expectedResponse = + Workload.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setFolderId(527488652) + .setCreateTime(Timestamp.newBuilder().build()) + .setFolder("folder-1268966290") + .setWorkloadOnboardingState(WorkloadOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .setKeyManagementProjectId("keyManagementProjectId-288019406") + .setLocation("location1901043637") + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + Workload actualResponse = client.getWorkload(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkloadRequest actualRequest = ((GetWorkloadRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkloadExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkloadsTest() throws Exception { + Workload responsesElement = Workload.newBuilder().build(); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkloads(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkloadsRequest actualRequest = ((ListWorkloadsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkloadsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkloadsTest2() throws Exception { + Workload responsesElement = Workload.newBuilder().build(); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkloads(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkloadsRequest actualRequest = ((ListWorkloadsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkloadsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String parent = "parent-995424086"; + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomerTest() throws Exception { + Customer expectedResponse = + Customer.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setDisplayName("displayName1714148973") + .setCustomerOnboardingState(CustomerOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + + Customer actualResponse = client.getCustomer(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomerRequest actualRequest = ((GetCustomerRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomerExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + client.getCustomer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomerTest2() throws Exception { + Customer expectedResponse = + Customer.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setDisplayName("displayName1714148973") + .setCustomerOnboardingState(CustomerOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + Customer actualResponse = client.getCustomer(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomerRequest actualRequest = ((GetCustomerRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomerExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getCustomer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomersTest() throws Exception { + Customer responsesElement = Customer.newBuilder().build(); + ListCustomersResponse expectedResponse = + ListCustomersResponse.newBuilder() + .setNextPageToken("") + .addAllCustomers(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListCustomersPagedResponse pagedListResponse = client.listCustomers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomersList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomersRequest actualRequest = ((ListCustomersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listCustomers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomersTest2() throws Exception { + Customer responsesElement = Customer.newBuilder().build(); + ListCustomersResponse expectedResponse = + ListCustomersResponse.newBuilder() + .setNextPageToken("") + .addAllCustomers(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCustomersPagedResponse pagedListResponse = client.listCustomers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomersList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomersRequest actualRequest = ((ListCustomersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCustomers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEkmConnectionsTest() throws Exception { + EkmConnections expectedResponse = + EkmConnections.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllEkmConnections(new ArrayList()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + EkmConnections actualResponse = client.getEkmConnections(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEkmConnectionsRequest actualRequest = ((GetEkmConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEkmConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getEkmConnections(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEkmConnectionsTest2() throws Exception { + EkmConnections expectedResponse = + EkmConnections.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllEkmConnections(new ArrayList()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + EkmConnections actualResponse = client.getEkmConnections(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEkmConnectionsRequest actualRequest = ((GetEkmConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEkmConnectionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getEkmConnections(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerPermissionsTest() throws Exception { + PartnerPermissions expectedResponse = + PartnerPermissions.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllPartnerPermissions(new ArrayList()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + PartnerPermissions actualResponse = client.getPartnerPermissions(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPartnerPermissionsRequest actualRequest = + ((GetPartnerPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPartnerPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getPartnerPermissions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerPermissionsTest2() throws Exception { + PartnerPermissions expectedResponse = + PartnerPermissions.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllPartnerPermissions(new ArrayList()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + PartnerPermissions actualResponse = client.getPartnerPermissions(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPartnerPermissionsRequest actualRequest = + ((GetPartnerPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPartnerPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getPartnerPermissions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccessApprovalRequestsTest() throws Exception { + AccessApprovalRequest responsesElement = AccessApprovalRequest.newBuilder().build(); + ListAccessApprovalRequestsResponse expectedResponse = + ListAccessApprovalRequestsResponse.newBuilder() + .setNextPageToken("") + .addAllAccessApprovalRequests(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + ListAccessApprovalRequestsPagedResponse pagedListResponse = + client.listAccessApprovalRequests(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccessApprovalRequestsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAccessApprovalRequestsRequest actualRequest = + ((ListAccessApprovalRequestsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAccessApprovalRequestsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.listAccessApprovalRequests(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccessApprovalRequestsTest2() throws Exception { + AccessApprovalRequest responsesElement = AccessApprovalRequest.newBuilder().build(); + ListAccessApprovalRequestsResponse expectedResponse = + ListAccessApprovalRequestsResponse.newBuilder() + .setNextPageToken("") + .addAllAccessApprovalRequests(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAccessApprovalRequestsPagedResponse pagedListResponse = + client.listAccessApprovalRequests(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccessApprovalRequestsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAccessApprovalRequestsRequest actualRequest = + ((ListAccessApprovalRequestsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAccessApprovalRequestsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAccessApprovalRequests(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerTest() throws Exception { + Partner expectedResponse = + Partner.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .addAllSkus(new ArrayList()) + .addAllEkmSolutions(new ArrayList()) + .addAllOperatedCloudRegions(new ArrayList()) + .setPartnerProjectId("partnerProjectId2071402028") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + + Partner actualResponse = client.getPartner(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPartnerRequest actualRequest = ((GetPartnerRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPartnerExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + client.getPartner(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerTest2() throws Exception { + Partner expectedResponse = + Partner.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .addAllSkus(new ArrayList()) + .addAllEkmSolutions(new ArrayList()) + .addAllOperatedCloudRegions(new ArrayList()) + .setPartnerProjectId("partnerProjectId2071402028") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + Partner actualResponse = client.getPartner(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPartnerRequest actualRequest = ((GetPartnerRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPartnerExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getPartner(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClientHttpJsonTest.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClientHttpJsonTest.java new file mode 100644 index 000000000000..20b5be4adf02 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClientHttpJsonTest.java @@ -0,0 +1,297 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.cloud.cloudcontrolspartner.v1.stub.HttpJsonCloudControlsPartnerMonitoringStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudControlsPartnerMonitoringClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudControlsPartnerMonitoringStub.getMethodDescriptors(), + CloudControlsPartnerMonitoringSettings.getDefaultEndpoint()); + CloudControlsPartnerMonitoringSettings settings = + CloudControlsPartnerMonitoringSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudControlsPartnerMonitoringSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudControlsPartnerMonitoringClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listViolationsTest() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().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 listViolationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listViolationsTest2() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "organizations/organization-2148/locations/location-2148/customers/customer-2148/workloads/workload-2148"; + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().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 listViolationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "organizations/organization-2148/locations/location-2148/customers/customer-2148/workloads/workload-2148"; + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setFolderId(527488652) + .setRemediation(Violation.Remediation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ViolationName name = + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + + Violation actualResponse = client.getViolation(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 getViolationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ViolationName name = + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest2() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setFolderId(527488652) + .setRemediation(Violation.Remediation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-9387/locations/location-9387/customers/customer-9387/workloads/workload-9387/violations/violation-9387"; + + Violation actualResponse = client.getViolation(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 getViolationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-9387/locations/location-9387/customers/customer-9387/workloads/workload-9387/violations/violation-9387"; + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClientTest.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClientTest.java new file mode 100644 index 000000000000..81116ce08d7e --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringClientTest.java @@ -0,0 +1,273 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import static com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringClientTest { + private static MockCloudControlsPartnerMonitoring mockCloudControlsPartnerMonitoring; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudControlsPartnerMonitoringClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudControlsPartnerMonitoring = new MockCloudControlsPartnerMonitoring(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudControlsPartnerMonitoring)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudControlsPartnerMonitoringSettings settings = + CloudControlsPartnerMonitoringSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudControlsPartnerMonitoringClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listViolationsTest() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerMonitoring.addResponse(expectedResponse); + + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerMonitoring.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListViolationsRequest actualRequest = ((ListViolationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listViolationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerMonitoring.addException(exception); + + try { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listViolationsTest2() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerMonitoring.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerMonitoring.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListViolationsRequest actualRequest = ((ListViolationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listViolationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerMonitoring.addException(exception); + + try { + String parent = "parent-995424086"; + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setFolderId(527488652) + .setRemediation(Violation.Remediation.newBuilder().build()) + .build(); + mockCloudControlsPartnerMonitoring.addResponse(expectedResponse); + + ViolationName name = + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + + Violation actualResponse = client.getViolation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerMonitoring.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetViolationRequest actualRequest = ((GetViolationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getViolationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerMonitoring.addException(exception); + + try { + ViolationName name = + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest2() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setFolderId(527488652) + .setRemediation(Violation.Remediation.newBuilder().build()) + .build(); + mockCloudControlsPartnerMonitoring.addResponse(expectedResponse); + + String name = "name3373707"; + + Violation actualResponse = client.getViolation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerMonitoring.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetViolationRequest actualRequest = ((GetViolationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getViolationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerMonitoring.addException(exception); + + try { + String name = "name3373707"; + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerCore.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerCore.java new file mode 100644 index 000000000000..5a83b5d230fb --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerCore.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.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 MockCloudControlsPartnerCore implements MockGrpcService { + private final MockCloudControlsPartnerCoreImpl serviceImpl; + + public MockCloudControlsPartnerCore() { + serviceImpl = new MockCloudControlsPartnerCoreImpl(); + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerCoreImpl.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerCoreImpl.java new file mode 100644 index 000000000000..c5b9357182ce --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerCoreImpl.java @@ -0,0 +1,226 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreGrpc.CloudControlsPartnerCoreImplBase; +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 MockCloudControlsPartnerCoreImpl extends CloudControlsPartnerCoreImplBase { + private List requests; + private Queue responses; + + public MockCloudControlsPartnerCoreImpl() { + 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 getWorkload(GetWorkloadRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Workload) { + requests.add(request); + responseObserver.onNext(((Workload) 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 GetWorkload, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Workload.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listWorkloads( + ListWorkloadsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListWorkloadsResponse) { + requests.add(request); + responseObserver.onNext(((ListWorkloadsResponse) 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 ListWorkloads, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListWorkloadsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCustomer(GetCustomerRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Customer) { + requests.add(request); + responseObserver.onNext(((Customer) 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 GetCustomer, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Customer.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listCustomers( + ListCustomersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListCustomersResponse) { + requests.add(request); + responseObserver.onNext(((ListCustomersResponse) 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 ListCustomers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListCustomersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEkmConnections( + GetEkmConnectionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EkmConnections) { + requests.add(request); + responseObserver.onNext(((EkmConnections) 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 GetEkmConnections, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EkmConnections.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPartnerPermissions( + GetPartnerPermissionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PartnerPermissions) { + requests.add(request); + responseObserver.onNext(((PartnerPermissions) 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 GetPartnerPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PartnerPermissions.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAccessApprovalRequests( + ListAccessApprovalRequestsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAccessApprovalRequestsResponse) { + requests.add(request); + responseObserver.onNext(((ListAccessApprovalRequestsResponse) 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 ListAccessApprovalRequests, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAccessApprovalRequestsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPartner(GetPartnerRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Partner) { + requests.add(request); + responseObserver.onNext(((Partner) 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 GetPartner, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Partner.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerMonitoring.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerMonitoring.java new file mode 100644 index 000000000000..765bf1398577 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerMonitoring.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.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 MockCloudControlsPartnerMonitoring implements MockGrpcService { + private final MockCloudControlsPartnerMonitoringImpl serviceImpl; + + public MockCloudControlsPartnerMonitoring() { + serviceImpl = new MockCloudControlsPartnerMonitoringImpl(); + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerMonitoringImpl.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerMonitoringImpl.java new file mode 100644 index 000000000000..564bf08ffefd --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1/MockCloudControlsPartnerMonitoringImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringGrpc.CloudControlsPartnerMonitoringImplBase; +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 MockCloudControlsPartnerMonitoringImpl extends CloudControlsPartnerMonitoringImplBase { + private List requests; + private Queue responses; + + public MockCloudControlsPartnerMonitoringImpl() { + 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 listViolations( + ListViolationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListViolationsResponse) { + requests.add(request); + responseObserver.onNext(((ListViolationsResponse) 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 ListViolations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListViolationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getViolation( + GetViolationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Violation) { + requests.add(request); + responseObserver.onNext(((Violation) 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 GetViolation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Violation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClientHttpJsonTest.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClientHttpJsonTest.java new file mode 100644 index 000000000000..bc0f620726f9 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClientHttpJsonTest.java @@ -0,0 +1,891 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.cloud.cloudcontrolspartner.v1beta.stub.HttpJsonCloudControlsPartnerCoreStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudControlsPartnerCoreClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudControlsPartnerCoreClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudControlsPartnerCoreStub.getMethodDescriptors(), + CloudControlsPartnerCoreSettings.getDefaultEndpoint()); + CloudControlsPartnerCoreSettings settings = + CloudControlsPartnerCoreSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudControlsPartnerCoreSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudControlsPartnerCoreClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getWorkloadTest() throws Exception { + Workload expectedResponse = + Workload.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setFolderId(527488652) + .setCreateTime(Timestamp.newBuilder().build()) + .setFolder("folder-1268966290") + .setWorkloadOnboardingState(WorkloadOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .setKeyManagementProjectId("keyManagementProjectId-288019406") + .setLocation("location1901043637") + .build(); + mockService.addResponse(expectedResponse); + + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + Workload actualResponse = client.getWorkload(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 getWorkloadExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkloadName name = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkloadTest2() throws Exception { + Workload expectedResponse = + Workload.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setFolderId(527488652) + .setCreateTime(Timestamp.newBuilder().build()) + .setFolder("folder-1268966290") + .setWorkloadOnboardingState(WorkloadOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .setKeyManagementProjectId("keyManagementProjectId-288019406") + .setLocation("location1901043637") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-9053/locations/location-9053/customers/customer-9053/workloads/workload-9053"; + + Workload actualResponse = client.getWorkload(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 getWorkloadExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-9053/locations/location-9053/customers/customer-9053/workloads/workload-9053"; + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkloadsTest() throws Exception { + Workload responsesElement = Workload.newBuilder().build(); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkloads(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().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 listWorkloadsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkloadsTest2() throws Exception { + Workload responsesElement = Workload.newBuilder().build(); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkloads(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "organizations/organization-2196/locations/location-2196/customers/customer-2196"; + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().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 listWorkloadsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "organizations/organization-2196/locations/location-2196/customers/customer-2196"; + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomerTest() throws Exception { + Customer expectedResponse = + Customer.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setDisplayName("displayName1714148973") + .setCustomerOnboardingState(CustomerOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .build(); + mockService.addResponse(expectedResponse); + + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + + Customer actualResponse = client.getCustomer(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 getCustomerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + client.getCustomer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomerTest2() throws Exception { + Customer expectedResponse = + Customer.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setDisplayName("displayName1714148973") + .setCustomerOnboardingState(CustomerOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "organizations/organization-3989/locations/location-3989/customers/customer-3989"; + + Customer actualResponse = client.getCustomer(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 getCustomerExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-3989/locations/location-3989/customers/customer-3989"; + client.getCustomer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomersTest() throws Exception { + Customer responsesElement = Customer.newBuilder().build(); + ListCustomersResponse expectedResponse = + ListCustomersResponse.newBuilder() + .setNextPageToken("") + .addAllCustomers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListCustomersPagedResponse pagedListResponse = client.listCustomers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomersList().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 listCustomersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listCustomers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomersTest2() throws Exception { + Customer responsesElement = Customer.newBuilder().build(); + ListCustomersResponse expectedResponse = + ListCustomersResponse.newBuilder() + .setNextPageToken("") + .addAllCustomers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-9365/locations/location-9365"; + + ListCustomersPagedResponse pagedListResponse = client.listCustomers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomersList().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 listCustomersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "organizations/organization-9365/locations/location-9365"; + client.listCustomers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEkmConnectionsTest() throws Exception { + EkmConnections expectedResponse = + EkmConnections.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllEkmConnections(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + EkmConnections actualResponse = client.getEkmConnections(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 getEkmConnectionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getEkmConnections(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEkmConnectionsTest2() throws Exception { + EkmConnections expectedResponse = + EkmConnections.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllEkmConnections(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-9542/locations/location-9542/customers/customer-9542/workloads/workload-9542/ekmConnections"; + + EkmConnections actualResponse = client.getEkmConnections(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 getEkmConnectionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-9542/locations/location-9542/customers/customer-9542/workloads/workload-9542/ekmConnections"; + client.getEkmConnections(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerPermissionsTest() throws Exception { + PartnerPermissions expectedResponse = + PartnerPermissions.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllPartnerPermissions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + PartnerPermissions actualResponse = client.getPartnerPermissions(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 getPartnerPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getPartnerPermissions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerPermissionsTest2() throws Exception { + PartnerPermissions expectedResponse = + PartnerPermissions.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllPartnerPermissions(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-6888/locations/location-6888/customers/customer-6888/workloads/workload-6888/partnerPermissions"; + + PartnerPermissions actualResponse = client.getPartnerPermissions(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 getPartnerPermissionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-6888/locations/location-6888/customers/customer-6888/workloads/workload-6888/partnerPermissions"; + client.getPartnerPermissions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccessApprovalRequestsTest() throws Exception { + AccessApprovalRequest responsesElement = AccessApprovalRequest.newBuilder().build(); + ListAccessApprovalRequestsResponse expectedResponse = + ListAccessApprovalRequestsResponse.newBuilder() + .setNextPageToken("") + .addAllAccessApprovalRequests(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + ListAccessApprovalRequestsPagedResponse pagedListResponse = + client.listAccessApprovalRequests(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccessApprovalRequestsList().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 listAccessApprovalRequestsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.listAccessApprovalRequests(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccessApprovalRequestsTest2() throws Exception { + AccessApprovalRequest responsesElement = AccessApprovalRequest.newBuilder().build(); + ListAccessApprovalRequestsResponse expectedResponse = + ListAccessApprovalRequestsResponse.newBuilder() + .setNextPageToken("") + .addAllAccessApprovalRequests(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "organizations/organization-2148/locations/location-2148/customers/customer-2148/workloads/workload-2148"; + + ListAccessApprovalRequestsPagedResponse pagedListResponse = + client.listAccessApprovalRequests(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccessApprovalRequestsList().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 listAccessApprovalRequestsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "organizations/organization-2148/locations/location-2148/customers/customer-2148/workloads/workload-2148"; + client.listAccessApprovalRequests(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerTest() throws Exception { + Partner expectedResponse = + Partner.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .addAllSkus(new ArrayList()) + .addAllEkmSolutions(new ArrayList()) + .addAllOperatedCloudRegions(new ArrayList()) + .setPartnerProjectId("partnerProjectId2071402028") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + + Partner actualResponse = client.getPartner(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 getPartnerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + client.getPartner(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerTest2() throws Exception { + Partner expectedResponse = + Partner.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .addAllSkus(new ArrayList()) + .addAllEkmSolutions(new ArrayList()) + .addAllOperatedCloudRegions(new ArrayList()) + .setPartnerProjectId("partnerProjectId2071402028") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "organizations/organization-435/locations/location-435/partner"; + + Partner actualResponse = client.getPartner(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 getPartnerExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "organizations/organization-435/locations/location-435/partner"; + client.getPartner(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClientTest.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClientTest.java new file mode 100644 index 000000000000..d9db1107148d --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreClientTest.java @@ -0,0 +1,792 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListAccessApprovalRequestsPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListCustomersPagedResponse; +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient.ListWorkloadsPagedResponse; + +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.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudControlsPartnerCoreClientTest { + private static MockCloudControlsPartnerCore mockCloudControlsPartnerCore; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudControlsPartnerCoreClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudControlsPartnerCore = new MockCloudControlsPartnerCore(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudControlsPartnerCore)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudControlsPartnerCoreSettings settings = + CloudControlsPartnerCoreSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudControlsPartnerCoreClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getWorkloadTest() throws Exception { + Workload expectedResponse = + Workload.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setFolderId(527488652) + .setCreateTime(Timestamp.newBuilder().build()) + .setFolder("folder-1268966290") + .setWorkloadOnboardingState(WorkloadOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .setKeyManagementProjectId("keyManagementProjectId-288019406") + .setLocation("location1901043637") + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + WorkloadName name = WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + Workload actualResponse = client.getWorkload(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkloadRequest actualRequest = ((GetWorkloadRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkloadExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + WorkloadName name = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkloadTest2() throws Exception { + Workload expectedResponse = + Workload.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setFolderId(527488652) + .setCreateTime(Timestamp.newBuilder().build()) + .setFolder("folder-1268966290") + .setWorkloadOnboardingState(WorkloadOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .setKeyManagementProjectId("keyManagementProjectId-288019406") + .setLocation("location1901043637") + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + Workload actualResponse = client.getWorkload(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkloadRequest actualRequest = ((GetWorkloadRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkloadExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getWorkload(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkloadsTest() throws Exception { + Workload responsesElement = Workload.newBuilder().build(); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkloads(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkloadsRequest actualRequest = ((ListWorkloadsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkloadsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkloadsTest2() throws Exception { + Workload responsesElement = Workload.newBuilder().build(); + ListWorkloadsResponse expectedResponse = + ListWorkloadsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkloads(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWorkloadsPagedResponse pagedListResponse = client.listWorkloads(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkloadsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkloadsRequest actualRequest = ((ListWorkloadsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkloadsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String parent = "parent-995424086"; + client.listWorkloads(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomerTest() throws Exception { + Customer expectedResponse = + Customer.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setDisplayName("displayName1714148973") + .setCustomerOnboardingState(CustomerOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + + Customer actualResponse = client.getCustomer(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomerRequest actualRequest = ((GetCustomerRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomerExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + client.getCustomer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomerTest2() throws Exception { + Customer expectedResponse = + Customer.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setDisplayName("displayName1714148973") + .setCustomerOnboardingState(CustomerOnboardingState.newBuilder().build()) + .setIsOnboarded(true) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + Customer actualResponse = client.getCustomer(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomerRequest actualRequest = ((GetCustomerRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomerExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getCustomer(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomersTest() throws Exception { + Customer responsesElement = Customer.newBuilder().build(); + ListCustomersResponse expectedResponse = + ListCustomersResponse.newBuilder() + .setNextPageToken("") + .addAllCustomers(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListCustomersPagedResponse pagedListResponse = client.listCustomers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomersList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomersRequest actualRequest = ((ListCustomersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listCustomers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomersTest2() throws Exception { + Customer responsesElement = Customer.newBuilder().build(); + ListCustomersResponse expectedResponse = + ListCustomersResponse.newBuilder() + .setNextPageToken("") + .addAllCustomers(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCustomersPagedResponse pagedListResponse = client.listCustomers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomersList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomersRequest actualRequest = ((ListCustomersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCustomers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEkmConnectionsTest() throws Exception { + EkmConnections expectedResponse = + EkmConnections.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllEkmConnections(new ArrayList()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + EkmConnections actualResponse = client.getEkmConnections(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEkmConnectionsRequest actualRequest = ((GetEkmConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEkmConnectionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getEkmConnections(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEkmConnectionsTest2() throws Exception { + EkmConnections expectedResponse = + EkmConnections.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllEkmConnections(new ArrayList()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + EkmConnections actualResponse = client.getEkmConnections(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEkmConnectionsRequest actualRequest = ((GetEkmConnectionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEkmConnectionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getEkmConnections(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerPermissionsTest() throws Exception { + PartnerPermissions expectedResponse = + PartnerPermissions.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllPartnerPermissions(new ArrayList()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + PartnerPermissions actualResponse = client.getPartnerPermissions(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPartnerPermissionsRequest actualRequest = + ((GetPartnerPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPartnerPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.getPartnerPermissions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerPermissionsTest2() throws Exception { + PartnerPermissions expectedResponse = + PartnerPermissions.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .addAllPartnerPermissions(new ArrayList()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + PartnerPermissions actualResponse = client.getPartnerPermissions(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPartnerPermissionsRequest actualRequest = + ((GetPartnerPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPartnerPermissionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getPartnerPermissions(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccessApprovalRequestsTest() throws Exception { + AccessApprovalRequest responsesElement = AccessApprovalRequest.newBuilder().build(); + ListAccessApprovalRequestsResponse expectedResponse = + ListAccessApprovalRequestsResponse.newBuilder() + .setNextPageToken("") + .addAllAccessApprovalRequests(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + ListAccessApprovalRequestsPagedResponse pagedListResponse = + client.listAccessApprovalRequests(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccessApprovalRequestsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAccessApprovalRequestsRequest actualRequest = + ((ListAccessApprovalRequestsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAccessApprovalRequestsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.listAccessApprovalRequests(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAccessApprovalRequestsTest2() throws Exception { + AccessApprovalRequest responsesElement = AccessApprovalRequest.newBuilder().build(); + ListAccessApprovalRequestsResponse expectedResponse = + ListAccessApprovalRequestsResponse.newBuilder() + .setNextPageToken("") + .addAllAccessApprovalRequests(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAccessApprovalRequestsPagedResponse pagedListResponse = + client.listAccessApprovalRequests(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAccessApprovalRequestsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAccessApprovalRequestsRequest actualRequest = + ((ListAccessApprovalRequestsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAccessApprovalRequestsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAccessApprovalRequests(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerTest() throws Exception { + Partner expectedResponse = + Partner.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .addAllSkus(new ArrayList()) + .addAllEkmSolutions(new ArrayList()) + .addAllOperatedCloudRegions(new ArrayList()) + .setPartnerProjectId("partnerProjectId2071402028") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + + Partner actualResponse = client.getPartner(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPartnerRequest actualRequest = ((GetPartnerRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPartnerExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + client.getPartner(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPartnerTest2() throws Exception { + Partner expectedResponse = + Partner.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .addAllSkus(new ArrayList()) + .addAllEkmSolutions(new ArrayList()) + .addAllOperatedCloudRegions(new ArrayList()) + .setPartnerProjectId("partnerProjectId2071402028") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockCloudControlsPartnerCore.addResponse(expectedResponse); + + String name = "name3373707"; + + Partner actualResponse = client.getPartner(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerCore.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPartnerRequest actualRequest = ((GetPartnerRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPartnerExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerCore.addException(exception); + + try { + String name = "name3373707"; + client.getPartner(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClientHttpJsonTest.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClientHttpJsonTest.java new file mode 100644 index 000000000000..884526904d5c --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClientHttpJsonTest.java @@ -0,0 +1,297 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.cloud.cloudcontrolspartner.v1beta.stub.HttpJsonCloudControlsPartnerMonitoringStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudControlsPartnerMonitoringClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudControlsPartnerMonitoringStub.getMethodDescriptors(), + CloudControlsPartnerMonitoringSettings.getDefaultEndpoint()); + CloudControlsPartnerMonitoringSettings settings = + CloudControlsPartnerMonitoringSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudControlsPartnerMonitoringSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudControlsPartnerMonitoringClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listViolationsTest() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().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 listViolationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listViolationsTest2() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = + "organizations/organization-2148/locations/location-2148/customers/customer-2148/workloads/workload-2148"; + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().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 listViolationsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = + "organizations/organization-2148/locations/location-2148/customers/customer-2148/workloads/workload-2148"; + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setFolderId(527488652) + .setRemediation(Violation.Remediation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + ViolationName name = + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + + Violation actualResponse = client.getViolation(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 getViolationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ViolationName name = + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest2() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setFolderId(527488652) + .setRemediation(Violation.Remediation.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-9387/locations/location-9387/customers/customer-9387/workloads/workload-9387/violations/violation-9387"; + + Violation actualResponse = client.getViolation(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 getViolationExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-9387/locations/location-9387/customers/customer-9387/workloads/workload-9387/violations/violation-9387"; + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClientTest.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClientTest.java new file mode 100644 index 000000000000..738134a43adf --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringClientTest.java @@ -0,0 +1,273 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import static com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient.ListViolationsPagedResponse; + +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.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudControlsPartnerMonitoringClientTest { + private static MockCloudControlsPartnerMonitoring mockCloudControlsPartnerMonitoring; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudControlsPartnerMonitoringClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudControlsPartnerMonitoring = new MockCloudControlsPartnerMonitoring(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudControlsPartnerMonitoring)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudControlsPartnerMonitoringSettings settings = + CloudControlsPartnerMonitoringSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudControlsPartnerMonitoringClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listViolationsTest() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerMonitoring.addResponse(expectedResponse); + + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerMonitoring.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListViolationsRequest actualRequest = ((ListViolationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listViolationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerMonitoring.addException(exception); + + try { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listViolationsTest2() throws Exception { + Violation responsesElement = Violation.newBuilder().build(); + ListViolationsResponse expectedResponse = + ListViolationsResponse.newBuilder() + .setNextPageToken("") + .addAllViolations(Arrays.asList(responsesElement)) + .build(); + mockCloudControlsPartnerMonitoring.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListViolationsPagedResponse pagedListResponse = client.listViolations(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViolationsList().get(0), resources.get(0)); + + List actualRequests = mockCloudControlsPartnerMonitoring.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListViolationsRequest actualRequest = ((ListViolationsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listViolationsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerMonitoring.addException(exception); + + try { + String parent = "parent-995424086"; + client.listViolations(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setFolderId(527488652) + .setRemediation(Violation.Remediation.newBuilder().build()) + .build(); + mockCloudControlsPartnerMonitoring.addResponse(expectedResponse); + + ViolationName name = + ViolationName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + + Violation actualResponse = client.getViolation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerMonitoring.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetViolationRequest actualRequest = ((GetViolationRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getViolationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerMonitoring.addException(exception); + + try { + ViolationName name = + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViolationTest2() throws Exception { + Violation expectedResponse = + Violation.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .setDescription("description-1724546052") + .setBeginTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setResolveTime(Timestamp.newBuilder().build()) + .setCategory("category50511102") + .setNonCompliantOrgPolicy("nonCompliantOrgPolicy-1928466552") + .setFolderId(527488652) + .setRemediation(Violation.Remediation.newBuilder().build()) + .build(); + mockCloudControlsPartnerMonitoring.addResponse(expectedResponse); + + String name = "name3373707"; + + Violation actualResponse = client.getViolation(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudControlsPartnerMonitoring.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetViolationRequest actualRequest = ((GetViolationRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getViolationExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCloudControlsPartnerMonitoring.addException(exception); + + try { + String name = "name3373707"; + client.getViolation(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerCore.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerCore.java new file mode 100644 index 000000000000..fdc3f879da74 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerCore.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCloudControlsPartnerCore implements MockGrpcService { + private final MockCloudControlsPartnerCoreImpl serviceImpl; + + public MockCloudControlsPartnerCore() { + serviceImpl = new MockCloudControlsPartnerCoreImpl(); + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerCoreImpl.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerCoreImpl.java new file mode 100644 index 000000000000..001de4646e68 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerCoreImpl.java @@ -0,0 +1,226 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreGrpc.CloudControlsPartnerCoreImplBase; +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 MockCloudControlsPartnerCoreImpl extends CloudControlsPartnerCoreImplBase { + private List requests; + private Queue responses; + + public MockCloudControlsPartnerCoreImpl() { + 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 getWorkload(GetWorkloadRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Workload) { + requests.add(request); + responseObserver.onNext(((Workload) 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 GetWorkload, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Workload.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listWorkloads( + ListWorkloadsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListWorkloadsResponse) { + requests.add(request); + responseObserver.onNext(((ListWorkloadsResponse) 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 ListWorkloads, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListWorkloadsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCustomer(GetCustomerRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Customer) { + requests.add(request); + responseObserver.onNext(((Customer) 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 GetCustomer, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Customer.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listCustomers( + ListCustomersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListCustomersResponse) { + requests.add(request); + responseObserver.onNext(((ListCustomersResponse) 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 ListCustomers, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListCustomersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getEkmConnections( + GetEkmConnectionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EkmConnections) { + requests.add(request); + responseObserver.onNext(((EkmConnections) 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 GetEkmConnections, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EkmConnections.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPartnerPermissions( + GetPartnerPermissionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PartnerPermissions) { + requests.add(request); + responseObserver.onNext(((PartnerPermissions) 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 GetPartnerPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PartnerPermissions.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAccessApprovalRequests( + ListAccessApprovalRequestsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAccessApprovalRequestsResponse) { + requests.add(request); + responseObserver.onNext(((ListAccessApprovalRequestsResponse) 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 ListAccessApprovalRequests, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAccessApprovalRequestsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPartner(GetPartnerRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Partner) { + requests.add(request); + responseObserver.onNext(((Partner) 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 GetPartner, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Partner.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerMonitoring.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerMonitoring.java new file mode 100644 index 000000000000..f86f93d2e159 --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerMonitoring.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockCloudControlsPartnerMonitoring implements MockGrpcService { + private final MockCloudControlsPartnerMonitoringImpl serviceImpl; + + public MockCloudControlsPartnerMonitoring() { + serviceImpl = new MockCloudControlsPartnerMonitoringImpl(); + } + + @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-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerMonitoringImpl.java b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerMonitoringImpl.java new file mode 100644 index 000000000000..a98d6c8f432c --- /dev/null +++ b/java-cloudcontrolspartner/google-cloud-cloudcontrolspartner/src/test/java/com/google/cloud/cloudcontrolspartner/v1beta/MockCloudControlsPartnerMonitoringImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringGrpc.CloudControlsPartnerMonitoringImplBase; +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 MockCloudControlsPartnerMonitoringImpl extends CloudControlsPartnerMonitoringImplBase { + private List requests; + private Queue responses; + + public MockCloudControlsPartnerMonitoringImpl() { + 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 listViolations( + ListViolationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListViolationsResponse) { + requests.add(request); + responseObserver.onNext(((ListViolationsResponse) 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 ListViolations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListViolationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getViolation( + GetViolationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Violation) { + requests.add(request); + responseObserver.onNext(((Violation) 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 GetViolation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Violation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/pom.xml b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/pom.xml new file mode 100644 index 000000000000..7ef239f4ab3c --- /dev/null +++ b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-cloudcontrolspartner-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-cloudcontrolspartner-v1 + GRPC library for google-cloud-cloudcontrolspartner + + com.google.cloud + google-cloud-cloudcontrolspartner-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-cloudcontrolspartner-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreGrpc.java b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreGrpc.java new file mode 100644 index 000000000000..ba6b515ab55c --- /dev/null +++ b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerCoreGrpc.java @@ -0,0 +1,1256 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.cloudcontrolspartner.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/cloudcontrolspartner/v1/core.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudControlsPartnerCoreGrpc { + + private CloudControlsPartnerCoreGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCore"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest, + com.google.cloud.cloudcontrolspartner.v1.Workload> + getGetWorkloadMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWorkload", + requestType = com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.Workload.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest, + com.google.cloud.cloudcontrolspartner.v1.Workload> + getGetWorkloadMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest, + com.google.cloud.cloudcontrolspartner.v1.Workload> + getGetWorkloadMethod; + if ((getGetWorkloadMethod = CloudControlsPartnerCoreGrpc.getGetWorkloadMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetWorkloadMethod = CloudControlsPartnerCoreGrpc.getGetWorkloadMethod) == null) { + CloudControlsPartnerCoreGrpc.getGetWorkloadMethod = + getGetWorkloadMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetWorkload")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.Workload + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("GetWorkload")) + .build(); + } + } + } + return getGetWorkloadMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse> + getListWorkloadsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWorkloads", + requestType = com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse> + getListWorkloadsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse> + getListWorkloadsMethod; + if ((getListWorkloadsMethod = CloudControlsPartnerCoreGrpc.getListWorkloadsMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getListWorkloadsMethod = CloudControlsPartnerCoreGrpc.getListWorkloadsMethod) + == null) { + CloudControlsPartnerCoreGrpc.getListWorkloadsMethod = + getListWorkloadsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListWorkloads")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("ListWorkloads")) + .build(); + } + } + } + return getListWorkloadsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest, + com.google.cloud.cloudcontrolspartner.v1.Customer> + getGetCustomerMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCustomer", + requestType = com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.Customer.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest, + com.google.cloud.cloudcontrolspartner.v1.Customer> + getGetCustomerMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest, + com.google.cloud.cloudcontrolspartner.v1.Customer> + getGetCustomerMethod; + if ((getGetCustomerMethod = CloudControlsPartnerCoreGrpc.getGetCustomerMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetCustomerMethod = CloudControlsPartnerCoreGrpc.getGetCustomerMethod) == null) { + CloudControlsPartnerCoreGrpc.getGetCustomerMethod = + getGetCustomerMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCustomer")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.Customer + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("GetCustomer")) + .build(); + } + } + } + return getGetCustomerMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest, + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse> + getListCustomersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCustomers", + requestType = com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest, + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse> + getListCustomersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest, + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse> + getListCustomersMethod; + if ((getListCustomersMethod = CloudControlsPartnerCoreGrpc.getListCustomersMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getListCustomersMethod = CloudControlsPartnerCoreGrpc.getListCustomersMethod) + == null) { + CloudControlsPartnerCoreGrpc.getListCustomersMethod = + getListCustomersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCustomers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("ListCustomers")) + .build(); + } + } + } + return getListCustomersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest, + com.google.cloud.cloudcontrolspartner.v1.EkmConnections> + getGetEkmConnectionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEkmConnections", + requestType = com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.EkmConnections.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest, + com.google.cloud.cloudcontrolspartner.v1.EkmConnections> + getGetEkmConnectionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest, + com.google.cloud.cloudcontrolspartner.v1.EkmConnections> + getGetEkmConnectionsMethod; + if ((getGetEkmConnectionsMethod = CloudControlsPartnerCoreGrpc.getGetEkmConnectionsMethod) + == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetEkmConnectionsMethod = CloudControlsPartnerCoreGrpc.getGetEkmConnectionsMethod) + == null) { + CloudControlsPartnerCoreGrpc.getGetEkmConnectionsMethod = + getGetEkmConnectionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEkmConnections")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.EkmConnections + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("GetEkmConnections")) + .build(); + } + } + } + return getGetEkmConnectionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest, + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions> + getGetPartnerPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPartnerPermissions", + requestType = com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest, + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions> + getGetPartnerPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest, + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions> + getGetPartnerPermissionsMethod; + if ((getGetPartnerPermissionsMethod = + CloudControlsPartnerCoreGrpc.getGetPartnerPermissionsMethod) + == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetPartnerPermissionsMethod = + CloudControlsPartnerCoreGrpc.getGetPartnerPermissionsMethod) + == null) { + CloudControlsPartnerCoreGrpc.getGetPartnerPermissionsMethod = + getGetPartnerPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetPartnerPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier( + "GetPartnerPermissions")) + .build(); + } + } + } + return getGetPartnerPermissionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse> + getListAccessApprovalRequestsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAccessApprovalRequests", + requestType = + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest.class, + responseType = + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse> + getListAccessApprovalRequestsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse> + getListAccessApprovalRequestsMethod; + if ((getListAccessApprovalRequestsMethod = + CloudControlsPartnerCoreGrpc.getListAccessApprovalRequestsMethod) + == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getListAccessApprovalRequestsMethod = + CloudControlsPartnerCoreGrpc.getListAccessApprovalRequestsMethod) + == null) { + CloudControlsPartnerCoreGrpc.getListAccessApprovalRequestsMethod = + getListAccessApprovalRequestsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListAccessApprovalRequests")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1 + .ListAccessApprovalRequestsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1 + .ListAccessApprovalRequestsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier( + "ListAccessApprovalRequests")) + .build(); + } + } + } + return getListAccessApprovalRequestsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest, + com.google.cloud.cloudcontrolspartner.v1.Partner> + getGetPartnerMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPartner", + requestType = com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.Partner.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest, + com.google.cloud.cloudcontrolspartner.v1.Partner> + getGetPartnerMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest, + com.google.cloud.cloudcontrolspartner.v1.Partner> + getGetPartnerMethod; + if ((getGetPartnerMethod = CloudControlsPartnerCoreGrpc.getGetPartnerMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetPartnerMethod = CloudControlsPartnerCoreGrpc.getGetPartnerMethod) == null) { + CloudControlsPartnerCoreGrpc.getGetPartnerMethod = + getGetPartnerMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPartner")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.Partner + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("GetPartner")) + .build(); + } + } + } + return getGetPartnerMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudControlsPartnerCoreStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerCoreStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreStub(channel, callOptions); + } + }; + return CloudControlsPartnerCoreStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudControlsPartnerCoreBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerCoreBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreBlockingStub(channel, callOptions); + } + }; + return CloudControlsPartnerCoreBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudControlsPartnerCoreFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerCoreFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreFutureStub(channel, callOptions); + } + }; + return CloudControlsPartnerCoreFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Gets details of a single workload
+     * 
+ */ + default void getWorkload( + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetWorkloadMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists customer workloads for a given customer org id
+     * 
+ */ + default void listWorkloads( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListWorkloadsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single customer
+     * 
+ */ + default void getCustomer( + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetCustomerMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists customers of a partner identified by its Google Cloud organization ID
+     * 
+ */ + default void listCustomers( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListCustomersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the EKM connections associated with a workload
+     * 
+ */ + default void getEkmConnections( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetEkmConnectionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the partner permissions granted for a workload
+     * 
+ */ + default void getPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetPartnerPermissionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists access requests associated with a workload
+     * 
+ */ + default void listAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAccessApprovalRequestsMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details of a Partner.
+     * 
+ */ + default void getPartner( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPartnerMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudControlsPartnerCore. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public abstract static class CloudControlsPartnerCoreImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudControlsPartnerCoreGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudControlsPartnerCore. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerCoreStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudControlsPartnerCoreStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerCoreStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets details of a single workload
+     * 
+ */ + public void getWorkload( + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetWorkloadMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists customer workloads for a given customer org id
+     * 
+ */ + public void listWorkloads( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListWorkloadsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single customer
+     * 
+ */ + public void getCustomer( + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCustomerMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists customers of a partner identified by its Google Cloud organization ID
+     * 
+ */ + public void listCustomers( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListCustomersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the EKM connections associated with a workload
+     * 
+ */ + public void getEkmConnections( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEkmConnectionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the partner permissions granted for a workload
+     * 
+ */ + public void getPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPartnerPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists access requests associated with a workload
+     * 
+ */ + public void listAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAccessApprovalRequestsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get details of a Partner.
+     * 
+ */ + public void getPartner( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPartnerMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudControlsPartnerCore. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerCoreBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudControlsPartnerCoreBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerCoreBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets details of a single workload
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.Workload getWorkload( + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetWorkloadMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists customer workloads for a given customer org id
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse listWorkloads( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListWorkloadsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single customer
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.Customer getCustomer( + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCustomerMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists customers of a partner identified by its Google Cloud organization ID
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse listCustomers( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListCustomersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the EKM connections associated with a workload
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnections getEkmConnections( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEkmConnectionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the partner permissions granted for a workload
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions getPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPartnerPermissionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists access requests associated with a workload
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + listAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAccessApprovalRequestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details of a Partner.
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.Partner getPartner( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPartnerMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * CloudControlsPartnerCore. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerCoreFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudControlsPartnerCoreFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerCoreFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets details of a single workload
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.Workload> + getWorkload(com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetWorkloadMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists customer workloads for a given customer org id
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse> + listWorkloads(com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListWorkloadsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single customer
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.Customer> + getCustomer(com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCustomerMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists customers of a partner identified by its Google Cloud organization ID
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse> + listCustomers(com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListCustomersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the EKM connections associated with a workload
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.EkmConnections> + getEkmConnections( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEkmConnectionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the partner permissions granted for a workload
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions> + getPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPartnerPermissionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists access requests associated with a workload
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse> + listAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAccessApprovalRequestsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details of a Partner.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.Partner> + getPartner(com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPartnerMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_WORKLOAD = 0; + private static final int METHODID_LIST_WORKLOADS = 1; + private static final int METHODID_GET_CUSTOMER = 2; + private static final int METHODID_LIST_CUSTOMERS = 3; + private static final int METHODID_GET_EKM_CONNECTIONS = 4; + private static final int METHODID_GET_PARTNER_PERMISSIONS = 5; + private static final int METHODID_LIST_ACCESS_APPROVAL_REQUESTS = 6; + private static final int METHODID_GET_PARTNER = 7; + + 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_GET_WORKLOAD: + serviceImpl.getWorkload( + (com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_WORKLOADS: + serviceImpl.listWorkloads( + (com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse>) + responseObserver); + break; + case METHODID_GET_CUSTOMER: + serviceImpl.getCustomer( + (com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CUSTOMERS: + serviceImpl.listCustomers( + (com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse>) + responseObserver); + break; + case METHODID_GET_EKM_CONNECTIONS: + serviceImpl.getEkmConnections( + (com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_PARTNER_PERMISSIONS: + serviceImpl.getPartnerPermissions( + (com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions>) + responseObserver); + break; + case METHODID_LIST_ACCESS_APPROVAL_REQUESTS: + serviceImpl.listAccessApprovalRequests( + (com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse>) + responseObserver); + break; + case METHODID_GET_PARTNER: + serviceImpl.getPartner( + (com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest) 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( + getGetWorkloadMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest, + com.google.cloud.cloudcontrolspartner.v1.Workload>( + service, METHODID_GET_WORKLOAD))) + .addMethod( + getListWorkloadsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse>( + service, METHODID_LIST_WORKLOADS))) + .addMethod( + getGetCustomerMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest, + com.google.cloud.cloudcontrolspartner.v1.Customer>( + service, METHODID_GET_CUSTOMER))) + .addMethod( + getListCustomersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest, + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse>( + service, METHODID_LIST_CUSTOMERS))) + .addMethod( + getGetEkmConnectionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest, + com.google.cloud.cloudcontrolspartner.v1.EkmConnections>( + service, METHODID_GET_EKM_CONNECTIONS))) + .addMethod( + getGetPartnerPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest, + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions>( + service, METHODID_GET_PARTNER_PERMISSIONS))) + .addMethod( + getListAccessApprovalRequestsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse>( + service, METHODID_LIST_ACCESS_APPROVAL_REQUESTS))) + .addMethod( + getGetPartnerMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest, + com.google.cloud.cloudcontrolspartner.v1.Partner>( + service, METHODID_GET_PARTNER))) + .build(); + } + + private abstract static class CloudControlsPartnerCoreBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudControlsPartnerCoreBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CoreProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudControlsPartnerCore"); + } + } + + private static final class CloudControlsPartnerCoreFileDescriptorSupplier + extends CloudControlsPartnerCoreBaseDescriptorSupplier { + CloudControlsPartnerCoreFileDescriptorSupplier() {} + } + + private static final class CloudControlsPartnerCoreMethodDescriptorSupplier + extends CloudControlsPartnerCoreBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudControlsPartnerCoreMethodDescriptorSupplier(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 (CloudControlsPartnerCoreGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudControlsPartnerCoreFileDescriptorSupplier()) + .addMethod(getGetWorkloadMethod()) + .addMethod(getListWorkloadsMethod()) + .addMethod(getGetCustomerMethod()) + .addMethod(getListCustomersMethod()) + .addMethod(getGetEkmConnectionsMethod()) + .addMethod(getGetPartnerPermissionsMethod()) + .addMethod(getListAccessApprovalRequestsMethod()) + .addMethod(getGetPartnerMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringGrpc.java b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringGrpc.java new file mode 100644 index 000000000000..6373413defc7 --- /dev/null +++ b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CloudControlsPartnerMonitoringGrpc.java @@ -0,0 +1,538 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.cloudcontrolspartner.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/cloudcontrolspartner/v1/monitoring.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudControlsPartnerMonitoringGrpc { + + private CloudControlsPartnerMonitoringGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoring"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse> + getListViolationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListViolations", + requestType = com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse> + getListViolationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse> + getListViolationsMethod; + if ((getListViolationsMethod = CloudControlsPartnerMonitoringGrpc.getListViolationsMethod) + == null) { + synchronized (CloudControlsPartnerMonitoringGrpc.class) { + if ((getListViolationsMethod = CloudControlsPartnerMonitoringGrpc.getListViolationsMethod) + == null) { + CloudControlsPartnerMonitoringGrpc.getListViolationsMethod = + getListViolationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListViolations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerMonitoringMethodDescriptorSupplier( + "ListViolations")) + .build(); + } + } + } + return getListViolationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest, + com.google.cloud.cloudcontrolspartner.v1.Violation> + getGetViolationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetViolation", + requestType = com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1.Violation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest, + com.google.cloud.cloudcontrolspartner.v1.Violation> + getGetViolationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest, + com.google.cloud.cloudcontrolspartner.v1.Violation> + getGetViolationMethod; + if ((getGetViolationMethod = CloudControlsPartnerMonitoringGrpc.getGetViolationMethod) + == null) { + synchronized (CloudControlsPartnerMonitoringGrpc.class) { + if ((getGetViolationMethod = CloudControlsPartnerMonitoringGrpc.getGetViolationMethod) + == null) { + CloudControlsPartnerMonitoringGrpc.getGetViolationMethod = + getGetViolationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetViolation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1.Violation + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerMonitoringMethodDescriptorSupplier( + "GetViolation")) + .build(); + } + } + } + return getGetViolationMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudControlsPartnerMonitoringStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerMonitoringStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringStub(channel, callOptions); + } + }; + return CloudControlsPartnerMonitoringStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudControlsPartnerMonitoringBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerMonitoringBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringBlockingStub(channel, callOptions); + } + }; + return CloudControlsPartnerMonitoringBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudControlsPartnerMonitoringFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerMonitoringFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringFutureStub(channel, callOptions); + } + }; + return CloudControlsPartnerMonitoringFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists Violations for a workload
+     * Callers may also choose to read across multiple Customers or for a single
+     * customer as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of {customer} & {workload}.
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ */ + default void listViolations( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListViolationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Violation.
+     * 
+ */ + default void getViolation( + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetViolationMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudControlsPartnerMonitoring. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public abstract static class CloudControlsPartnerMonitoringImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudControlsPartnerMonitoringGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudControlsPartnerMonitoring. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerMonitoringStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudControlsPartnerMonitoringStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerMonitoringStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Violations for a workload
+     * Callers may also choose to read across multiple Customers or for a single
+     * customer as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of {customer} & {workload}.
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ */ + public void listViolations( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListViolationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Violation.
+     * 
+ */ + public void getViolation( + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetViolationMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudControlsPartnerMonitoring. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerMonitoringBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudControlsPartnerMonitoringBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerMonitoringBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Violations for a workload
+     * Callers may also choose to read across multiple Customers or for a single
+     * customer as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of {customer} & {workload}.
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse listViolations( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListViolationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Violation.
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1.Violation getViolation( + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetViolationMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * CloudControlsPartnerMonitoring. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerMonitoringFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudControlsPartnerMonitoringFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerMonitoringFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Violations for a workload
+     * Callers may also choose to read across multiple Customers or for a single
+     * customer as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of {customer} & {workload}.
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse> + listViolations(com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListViolationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Violation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1.Violation> + getViolation(com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetViolationMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_VIOLATIONS = 0; + private static final int METHODID_GET_VIOLATION = 1; + + 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_VIOLATIONS: + serviceImpl.listViolations( + (com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse>) + responseObserver); + break; + case METHODID_GET_VIOLATION: + serviceImpl.getViolation( + (com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest) 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( + getListViolationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest, + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse>( + service, METHODID_LIST_VIOLATIONS))) + .addMethod( + getGetViolationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest, + com.google.cloud.cloudcontrolspartner.v1.Violation>( + service, METHODID_GET_VIOLATION))) + .build(); + } + + private abstract static class CloudControlsPartnerMonitoringBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudControlsPartnerMonitoringBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.MonitoringProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudControlsPartnerMonitoring"); + } + } + + private static final class CloudControlsPartnerMonitoringFileDescriptorSupplier + extends CloudControlsPartnerMonitoringBaseDescriptorSupplier { + CloudControlsPartnerMonitoringFileDescriptorSupplier() {} + } + + private static final class CloudControlsPartnerMonitoringMethodDescriptorSupplier + extends CloudControlsPartnerMonitoringBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudControlsPartnerMonitoringMethodDescriptorSupplier(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 (CloudControlsPartnerMonitoringGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new CloudControlsPartnerMonitoringFileDescriptorSupplier()) + .addMethod(getListViolationsMethod()) + .addMethod(getGetViolationMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/pom.xml b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/pom.xml new file mode 100644 index 000000000000..272aef10f7c8 --- /dev/null +++ b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-cloudcontrolspartner-v1beta + 0.0.1-SNAPSHOT + grpc-google-cloud-cloudcontrolspartner-v1beta + GRPC library for google-cloud-cloudcontrolspartner + + com.google.cloud + google-cloud-cloudcontrolspartner-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-cloudcontrolspartner-v1beta + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreGrpc.java b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreGrpc.java new file mode 100644 index 000000000000..6d07e8b2e16a --- /dev/null +++ b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerCoreGrpc.java @@ -0,0 +1,1267 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.cloudcontrolspartner.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/cloudcontrolspartner/v1beta/core.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudControlsPartnerCoreGrpc { + + private CloudControlsPartnerCoreGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Workload> + getGetWorkloadMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWorkload", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.Workload.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Workload> + getGetWorkloadMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Workload> + getGetWorkloadMethod; + if ((getGetWorkloadMethod = CloudControlsPartnerCoreGrpc.getGetWorkloadMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetWorkloadMethod = CloudControlsPartnerCoreGrpc.getGetWorkloadMethod) == null) { + CloudControlsPartnerCoreGrpc.getGetWorkloadMethod = + getGetWorkloadMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetWorkload")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.Workload + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("GetWorkload")) + .build(); + } + } + } + return getGetWorkloadMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse> + getListWorkloadsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWorkloads", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse> + getListWorkloadsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse> + getListWorkloadsMethod; + if ((getListWorkloadsMethod = CloudControlsPartnerCoreGrpc.getListWorkloadsMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getListWorkloadsMethod = CloudControlsPartnerCoreGrpc.getListWorkloadsMethod) + == null) { + CloudControlsPartnerCoreGrpc.getListWorkloadsMethod = + getListWorkloadsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListWorkloads")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("ListWorkloads")) + .build(); + } + } + } + return getListWorkloadsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Customer> + getGetCustomerMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCustomer", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.Customer.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Customer> + getGetCustomerMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Customer> + getGetCustomerMethod; + if ((getGetCustomerMethod = CloudControlsPartnerCoreGrpc.getGetCustomerMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetCustomerMethod = CloudControlsPartnerCoreGrpc.getGetCustomerMethod) == null) { + CloudControlsPartnerCoreGrpc.getGetCustomerMethod = + getGetCustomerMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCustomer")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.Customer + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("GetCustomer")) + .build(); + } + } + } + return getGetCustomerMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse> + getListCustomersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCustomers", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse> + getListCustomersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse> + getListCustomersMethod; + if ((getListCustomersMethod = CloudControlsPartnerCoreGrpc.getListCustomersMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getListCustomersMethod = CloudControlsPartnerCoreGrpc.getListCustomersMethod) + == null) { + CloudControlsPartnerCoreGrpc.getListCustomersMethod = + getListCustomersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCustomers")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("ListCustomers")) + .build(); + } + } + } + return getListCustomersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections> + getGetEkmConnectionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetEkmConnections", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections> + getGetEkmConnectionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections> + getGetEkmConnectionsMethod; + if ((getGetEkmConnectionsMethod = CloudControlsPartnerCoreGrpc.getGetEkmConnectionsMethod) + == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetEkmConnectionsMethod = CloudControlsPartnerCoreGrpc.getGetEkmConnectionsMethod) + == null) { + CloudControlsPartnerCoreGrpc.getGetEkmConnectionsMethod = + getGetEkmConnectionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetEkmConnections")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("GetEkmConnections")) + .build(); + } + } + } + return getGetEkmConnectionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions> + getGetPartnerPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPartnerPermissions", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions> + getGetPartnerPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions> + getGetPartnerPermissionsMethod; + if ((getGetPartnerPermissionsMethod = + CloudControlsPartnerCoreGrpc.getGetPartnerPermissionsMethod) + == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetPartnerPermissionsMethod = + CloudControlsPartnerCoreGrpc.getGetPartnerPermissionsMethod) + == null) { + CloudControlsPartnerCoreGrpc.getGetPartnerPermissionsMethod = + getGetPartnerPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetPartnerPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta + .GetPartnerPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier( + "GetPartnerPermissions")) + .build(); + } + } + } + return getGetPartnerPermissionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse> + getListAccessApprovalRequestsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAccessApprovalRequests", + requestType = + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest.class, + responseType = + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse> + getListAccessApprovalRequestsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse> + getListAccessApprovalRequestsMethod; + if ((getListAccessApprovalRequestsMethod = + CloudControlsPartnerCoreGrpc.getListAccessApprovalRequestsMethod) + == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getListAccessApprovalRequestsMethod = + CloudControlsPartnerCoreGrpc.getListAccessApprovalRequestsMethod) + == null) { + CloudControlsPartnerCoreGrpc.getListAccessApprovalRequestsMethod = + getListAccessApprovalRequestsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListAccessApprovalRequests")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta + .ListAccessApprovalRequestsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta + .ListAccessApprovalRequestsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier( + "ListAccessApprovalRequests")) + .build(); + } + } + } + return getListAccessApprovalRequestsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Partner> + getGetPartnerMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPartner", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.Partner.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Partner> + getGetPartnerMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Partner> + getGetPartnerMethod; + if ((getGetPartnerMethod = CloudControlsPartnerCoreGrpc.getGetPartnerMethod) == null) { + synchronized (CloudControlsPartnerCoreGrpc.class) { + if ((getGetPartnerMethod = CloudControlsPartnerCoreGrpc.getGetPartnerMethod) == null) { + CloudControlsPartnerCoreGrpc.getGetPartnerMethod = + getGetPartnerMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPartner")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.Partner + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerCoreMethodDescriptorSupplier("GetPartner")) + .build(); + } + } + } + return getGetPartnerMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudControlsPartnerCoreStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerCoreStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreStub(channel, callOptions); + } + }; + return CloudControlsPartnerCoreStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudControlsPartnerCoreBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerCoreBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreBlockingStub(channel, callOptions); + } + }; + return CloudControlsPartnerCoreBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudControlsPartnerCoreFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerCoreFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreFutureStub(channel, callOptions); + } + }; + return CloudControlsPartnerCoreFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Gets details of a single workload
+     * 
+ */ + default void getWorkload( + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetWorkloadMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists customer workloads for a given customer org id
+     * 
+ */ + default void listWorkloads( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListWorkloadsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single customer
+     * 
+ */ + default void getCustomer( + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetCustomerMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists customers of a partner identified by its Google Cloud organization ID
+     * 
+ */ + default void listCustomers( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListCustomersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the EKM connections associated with a workload
+     * 
+ */ + default void getEkmConnections( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetEkmConnectionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the partner permissions granted for a workload
+     * 
+ */ + default void getPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetPartnerPermissionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists access requests associated with a workload
+     * 
+ */ + default void listAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListAccessApprovalRequestsMethod(), responseObserver); + } + + /** + * + * + *
+     * Get details of a Partner.
+     * 
+ */ + default void getPartner( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPartnerMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudControlsPartnerCore. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public abstract static class CloudControlsPartnerCoreImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudControlsPartnerCoreGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudControlsPartnerCore. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerCoreStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudControlsPartnerCoreStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerCoreStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets details of a single workload
+     * 
+ */ + public void getWorkload( + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetWorkloadMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists customer workloads for a given customer org id
+     * 
+ */ + public void listWorkloads( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListWorkloadsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single customer
+     * 
+ */ + public void getCustomer( + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCustomerMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists customers of a partner identified by its Google Cloud organization ID
+     * 
+ */ + public void listCustomers( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListCustomersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the EKM connections associated with a workload
+     * 
+ */ + public void getEkmConnections( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetEkmConnectionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the partner permissions granted for a workload
+     * 
+ */ + public void getPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPartnerPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists access requests associated with a workload
+     * 
+ */ + public void listAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListAccessApprovalRequestsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Get details of a Partner.
+     * 
+ */ + public void getPartner( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPartnerMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudControlsPartnerCore. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerCoreBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudControlsPartnerCoreBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerCoreBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets details of a single workload
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.Workload getWorkload( + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetWorkloadMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists customer workloads for a given customer org id
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse listWorkloads( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListWorkloadsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single customer
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.Customer getCustomer( + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCustomerMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists customers of a partner identified by its Google Cloud organization ID
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse listCustomers( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListCustomersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the EKM connections associated with a workload
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections getEkmConnections( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEkmConnectionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the partner permissions granted for a workload
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions getPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPartnerPermissionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists access requests associated with a workload
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + listAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAccessApprovalRequestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Get details of a Partner.
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.Partner getPartner( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPartnerMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * CloudControlsPartnerCore. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerCoreFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudControlsPartnerCoreFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerCoreFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerCoreFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Gets details of a single workload
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.Workload> + getWorkload(com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetWorkloadMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists customer workloads for a given customer org id
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse> + listWorkloads(com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListWorkloadsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single customer
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.Customer> + getCustomer(com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCustomerMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists customers of a partner identified by its Google Cloud organization ID
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse> + listCustomers(com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListCustomersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the EKM connections associated with a workload
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections> + getEkmConnections( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEkmConnectionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the partner permissions granted for a workload
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions> + getPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPartnerPermissionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists access requests associated with a workload
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse> + listAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListAccessApprovalRequestsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Get details of a Partner.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.Partner> + getPartner(com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPartnerMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_WORKLOAD = 0; + private static final int METHODID_LIST_WORKLOADS = 1; + private static final int METHODID_GET_CUSTOMER = 2; + private static final int METHODID_LIST_CUSTOMERS = 3; + private static final int METHODID_GET_EKM_CONNECTIONS = 4; + private static final int METHODID_GET_PARTNER_PERMISSIONS = 5; + private static final int METHODID_LIST_ACCESS_APPROVAL_REQUESTS = 6; + private static final int METHODID_GET_PARTNER = 7; + + 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_GET_WORKLOAD: + serviceImpl.getWorkload( + (com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_WORKLOADS: + serviceImpl.listWorkloads( + (com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse>) + responseObserver); + break; + case METHODID_GET_CUSTOMER: + serviceImpl.getCustomer( + (com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CUSTOMERS: + serviceImpl.listCustomers( + (com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse>) + responseObserver); + break; + case METHODID_GET_EKM_CONNECTIONS: + serviceImpl.getEkmConnections( + (com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections>) + responseObserver); + break; + case METHODID_GET_PARTNER_PERMISSIONS: + serviceImpl.getPartnerPermissions( + (com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions>) + responseObserver); + break; + case METHODID_LIST_ACCESS_APPROVAL_REQUESTS: + serviceImpl.listAccessApprovalRequests( + (com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) + request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta + .ListAccessApprovalRequestsResponse>) + responseObserver); + break; + case METHODID_GET_PARTNER: + serviceImpl.getPartner( + (com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) 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( + getGetWorkloadMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Workload>( + service, METHODID_GET_WORKLOAD))) + .addMethod( + getListWorkloadsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse>( + service, METHODID_LIST_WORKLOADS))) + .addMethod( + getGetCustomerMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Customer>( + service, METHODID_GET_CUSTOMER))) + .addMethod( + getListCustomersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse>( + service, METHODID_LIST_CUSTOMERS))) + .addMethod( + getGetEkmConnectionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections>( + service, METHODID_GET_EKM_CONNECTIONS))) + .addMethod( + getGetPartnerPermissionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions>( + service, METHODID_GET_PARTNER_PERMISSIONS))) + .addMethod( + getListAccessApprovalRequestsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest, + com.google.cloud.cloudcontrolspartner.v1beta + .ListAccessApprovalRequestsResponse>( + service, METHODID_LIST_ACCESS_APPROVAL_REQUESTS))) + .addMethod( + getGetPartnerMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Partner>( + service, METHODID_GET_PARTNER))) + .build(); + } + + private abstract static class CloudControlsPartnerCoreBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudControlsPartnerCoreBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CoreProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudControlsPartnerCore"); + } + } + + private static final class CloudControlsPartnerCoreFileDescriptorSupplier + extends CloudControlsPartnerCoreBaseDescriptorSupplier { + CloudControlsPartnerCoreFileDescriptorSupplier() {} + } + + private static final class CloudControlsPartnerCoreMethodDescriptorSupplier + extends CloudControlsPartnerCoreBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudControlsPartnerCoreMethodDescriptorSupplier(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 (CloudControlsPartnerCoreGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudControlsPartnerCoreFileDescriptorSupplier()) + .addMethod(getGetWorkloadMethod()) + .addMethod(getListWorkloadsMethod()) + .addMethod(getGetCustomerMethod()) + .addMethod(getListCustomersMethod()) + .addMethod(getGetEkmConnectionsMethod()) + .addMethod(getGetPartnerPermissionsMethod()) + .addMethod(getListAccessApprovalRequestsMethod()) + .addMethod(getGetPartnerMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringGrpc.java b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringGrpc.java new file mode 100644 index 000000000000..0e4f24afdfa7 --- /dev/null +++ b/java-cloudcontrolspartner/grpc-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CloudControlsPartnerMonitoringGrpc.java @@ -0,0 +1,540 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.cloudcontrolspartner.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/cloudcontrolspartner/v1beta/monitoring.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudControlsPartnerMonitoringGrpc { + + private CloudControlsPartnerMonitoringGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoring"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse> + getListViolationsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListViolations", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse> + getListViolationsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse> + getListViolationsMethod; + if ((getListViolationsMethod = CloudControlsPartnerMonitoringGrpc.getListViolationsMethod) + == null) { + synchronized (CloudControlsPartnerMonitoringGrpc.class) { + if ((getListViolationsMethod = CloudControlsPartnerMonitoringGrpc.getListViolationsMethod) + == null) { + CloudControlsPartnerMonitoringGrpc.getListViolationsMethod = + getListViolationsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListViolations")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerMonitoringMethodDescriptorSupplier( + "ListViolations")) + .build(); + } + } + } + return getListViolationsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Violation> + getGetViolationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetViolation", + requestType = com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest.class, + responseType = com.google.cloud.cloudcontrolspartner.v1beta.Violation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Violation> + getGetViolationMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Violation> + getGetViolationMethod; + if ((getGetViolationMethod = CloudControlsPartnerMonitoringGrpc.getGetViolationMethod) + == null) { + synchronized (CloudControlsPartnerMonitoringGrpc.class) { + if ((getGetViolationMethod = CloudControlsPartnerMonitoringGrpc.getGetViolationMethod) + == null) { + CloudControlsPartnerMonitoringGrpc.getGetViolationMethod = + getGetViolationMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetViolation")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.cloudcontrolspartner.v1beta.Violation + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudControlsPartnerMonitoringMethodDescriptorSupplier( + "GetViolation")) + .build(); + } + } + } + return getGetViolationMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudControlsPartnerMonitoringStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerMonitoringStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringStub(channel, callOptions); + } + }; + return CloudControlsPartnerMonitoringStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudControlsPartnerMonitoringBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerMonitoringBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringBlockingStub(channel, callOptions); + } + }; + return CloudControlsPartnerMonitoringBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudControlsPartnerMonitoringFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudControlsPartnerMonitoringFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringFutureStub(channel, callOptions); + } + }; + return CloudControlsPartnerMonitoringFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists Violations for a workload
+     * Callers may also choose to read across multiple Customers or for a single
+     * customer as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of {customer} & {workload}.
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ */ + default void listViolations( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListViolationsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Violation.
+     * 
+ */ + default void getViolation( + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetViolationMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudControlsPartnerMonitoring. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public abstract static class CloudControlsPartnerMonitoringImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudControlsPartnerMonitoringGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudControlsPartnerMonitoring. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerMonitoringStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudControlsPartnerMonitoringStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerMonitoringStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Violations for a workload
+     * Callers may also choose to read across multiple Customers or for a single
+     * customer as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of {customer} & {workload}.
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ */ + public void listViolations( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListViolationsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Violation.
+     * 
+ */ + public void getViolation( + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetViolationMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudControlsPartnerMonitoring. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerMonitoringBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudControlsPartnerMonitoringBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerMonitoringBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Violations for a workload
+     * Callers may also choose to read across multiple Customers or for a single
+     * customer as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of {customer} & {workload}.
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse listViolations( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListViolationsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Violation.
+     * 
+ */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation getViolation( + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetViolationMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * CloudControlsPartnerMonitoring. + * + *
+   * Service describing handlers for resources
+   * 
+ */ + public static final class CloudControlsPartnerMonitoringFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudControlsPartnerMonitoringFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudControlsPartnerMonitoringFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudControlsPartnerMonitoringFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Violations for a workload
+     * Callers may also choose to read across multiple Customers or for a single
+     * customer as per
+     * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
+     * character) as a wildcard character instead of {customer} & {workload}.
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse> + listViolations(com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListViolationsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Violation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.cloudcontrolspartner.v1beta.Violation> + getViolation(com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetViolationMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_VIOLATIONS = 0; + private static final int METHODID_GET_VIOLATION = 1; + + 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_VIOLATIONS: + serviceImpl.listViolations( + (com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse>) + responseObserver); + break; + case METHODID_GET_VIOLATION: + serviceImpl.getViolation( + (com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) 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( + getListViolationsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest, + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse>( + service, METHODID_LIST_VIOLATIONS))) + .addMethod( + getGetViolationMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest, + com.google.cloud.cloudcontrolspartner.v1beta.Violation>( + service, METHODID_GET_VIOLATION))) + .build(); + } + + private abstract static class CloudControlsPartnerMonitoringBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudControlsPartnerMonitoringBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.MonitoringProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudControlsPartnerMonitoring"); + } + } + + private static final class CloudControlsPartnerMonitoringFileDescriptorSupplier + extends CloudControlsPartnerMonitoringBaseDescriptorSupplier { + CloudControlsPartnerMonitoringFileDescriptorSupplier() {} + } + + private static final class CloudControlsPartnerMonitoringMethodDescriptorSupplier + extends CloudControlsPartnerMonitoringBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudControlsPartnerMonitoringMethodDescriptorSupplier(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 (CloudControlsPartnerMonitoringGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new CloudControlsPartnerMonitoringFileDescriptorSupplier()) + .addMethod(getListViolationsMethod()) + .addMethod(getGetViolationMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-cloudcontrolspartner/owlbot.py b/java-cloudcontrolspartner/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-cloudcontrolspartner/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-cloudcontrolspartner/pom.xml b/java-cloudcontrolspartner/pom.xml new file mode 100644 index 000000000000..f5efc9a4d38a --- /dev/null +++ b/java-cloudcontrolspartner/pom.xml @@ -0,0 +1,66 @@ + + + 4.0.0 + com.google.cloud + google-cloud-cloudcontrolspartner-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Controls Partner API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.31.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-cloudcontrolspartner-parent + + + + + + com.google.cloud + google-cloud-cloudcontrolspartner + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudcontrolspartner-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-cloudcontrolspartner-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-cloudcontrolspartner-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-cloudcontrolspartner-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-cloudcontrolspartner + grpc-google-cloud-cloudcontrolspartner-v1 + grpc-google-cloud-cloudcontrolspartner-v1beta + proto-google-cloud-cloudcontrolspartner-v1beta + proto-google-cloud-cloudcontrolspartner-v1 + google-cloud-cloudcontrolspartner-bom + + + diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/clirr-ignored-differences.xml b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..551b951634dc --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/cloudcontrolspartner/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/cloudcontrolspartner/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/cloudcontrolspartner/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/pom.xml b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/pom.xml new file mode 100644 index 000000000000..08c3ca663016 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-cloudcontrolspartner-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-cloudcontrolspartner-v1 + Proto library for google-cloud-cloudcontrolspartner + + com.google.cloud + google-cloud-cloudcontrolspartner-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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequest.java new file mode 100644 index 000000000000..08d893f35187 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequest.java @@ -0,0 +1,1476 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Details about the Access request.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest} + */ +public final class AccessApprovalRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest) + AccessApprovalRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessApprovalRequest.newBuilder() to construct. + private AccessApprovalRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessApprovalRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessApprovalRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.class, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int REQUESTED_REASON_FIELD_NUMBER = 3; + private com.google.cloud.cloudcontrolspartner.v1.AccessReason requestedReason_; + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + @java.lang.Override + public boolean hasRequestedReason() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessReason getRequestedReason() { + return requestedReason_ == null + ? com.google.cloud.cloudcontrolspartner.v1.AccessReason.getDefaultInstance() + : requestedReason_; + } + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessReasonOrBuilder + getRequestedReasonOrBuilder() { + return requestedReason_ == null + ? com.google.cloud.cloudcontrolspartner.v1.AccessReason.getDefaultInstance() + : requestedReason_; + } + + public static final int REQUESTED_EXPIRATION_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp requestedExpirationTime_; + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return Whether the requestedExpirationTime field is set. + */ + @java.lang.Override + public boolean hasRequestedExpirationTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return The requestedExpirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestedExpirationTime() { + return requestedExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpirationTime_; + } + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestedExpirationTimeOrBuilder() { + return requestedExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpirationTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getRequestedReason()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getRequestedExpirationTime()); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestedReason()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRequestedExpirationTime()); + } + 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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest other = + (com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasRequestedReason() != other.hasRequestedReason()) return false; + if (hasRequestedReason()) { + if (!getRequestedReason().equals(other.getRequestedReason())) return false; + } + if (hasRequestedExpirationTime() != other.hasRequestedExpirationTime()) return false; + if (hasRequestedExpirationTime()) { + if (!getRequestedExpirationTime().equals(other.getRequestedExpirationTime())) 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 (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasRequestedReason()) { + hash = (37 * hash) + REQUESTED_REASON_FIELD_NUMBER; + hash = (53 * hash) + getRequestedReason().hashCode(); + } + if (hasRequestedExpirationTime()) { + hash = (37 * hash) + REQUESTED_EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestedExpirationTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest 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; + } + /** + * + * + *
+   * Details about the Access request.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest) + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.class, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRequestTimeFieldBuilder(); + getRequestedReasonFieldBuilder(); + getRequestedExpirationTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + requestedReason_ = null; + if (requestedReasonBuilder_ != null) { + requestedReasonBuilder_.dispose(); + requestedReasonBuilder_ = null; + } + requestedExpirationTime_ = null; + if (requestedExpirationTimeBuilder_ != null) { + requestedExpirationTimeBuilder_.dispose(); + requestedExpirationTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest build() { + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest result = + new com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestedReason_ = + requestedReasonBuilder_ == null ? requestedReason_ : requestedReasonBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestedExpirationTime_ = + requestedExpirationTimeBuilder_ == null + ? requestedExpirationTime_ + : requestedExpirationTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasRequestedReason()) { + mergeRequestedReason(other.getRequestedReason()); + } + if (other.hasRequestedExpirationTime()) { + mergeRequestedExpirationTime(other.getRequestedExpirationTime()); + } + 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: + { + input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getRequestedReasonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + getRequestedExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRequestTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.cloud.cloudcontrolspartner.v1.AccessReason requestedReason_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.AccessReason, + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Builder, + com.google.cloud.cloudcontrolspartner.v1.AccessReasonOrBuilder> + requestedReasonBuilder_; + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + public boolean hasRequestedReason() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + public com.google.cloud.cloudcontrolspartner.v1.AccessReason getRequestedReason() { + if (requestedReasonBuilder_ == null) { + return requestedReason_ == null + ? com.google.cloud.cloudcontrolspartner.v1.AccessReason.getDefaultInstance() + : requestedReason_; + } else { + return requestedReasonBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + public Builder setRequestedReason(com.google.cloud.cloudcontrolspartner.v1.AccessReason value) { + if (requestedReasonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedReason_ = value; + } else { + requestedReasonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + public Builder setRequestedReason( + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Builder builderForValue) { + if (requestedReasonBuilder_ == null) { + requestedReason_ = builderForValue.build(); + } else { + requestedReasonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + public Builder mergeRequestedReason( + com.google.cloud.cloudcontrolspartner.v1.AccessReason value) { + if (requestedReasonBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && requestedReason_ != null + && requestedReason_ + != com.google.cloud.cloudcontrolspartner.v1.AccessReason.getDefaultInstance()) { + getRequestedReasonBuilder().mergeFrom(value); + } else { + requestedReason_ = value; + } + } else { + requestedReasonBuilder_.mergeFrom(value); + } + if (requestedReason_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + public Builder clearRequestedReason() { + bitField0_ = (bitField0_ & ~0x00000004); + requestedReason_ = null; + if (requestedReasonBuilder_ != null) { + requestedReasonBuilder_.dispose(); + requestedReasonBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1.AccessReason.Builder + getRequestedReasonBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getRequestedReasonFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1.AccessReasonOrBuilder + getRequestedReasonOrBuilder() { + if (requestedReasonBuilder_ != null) { + return requestedReasonBuilder_.getMessageOrBuilder(); + } else { + return requestedReason_ == null + ? com.google.cloud.cloudcontrolspartner.v1.AccessReason.getDefaultInstance() + : requestedReason_; + } + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.AccessReason, + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Builder, + com.google.cloud.cloudcontrolspartner.v1.AccessReasonOrBuilder> + getRequestedReasonFieldBuilder() { + if (requestedReasonBuilder_ == null) { + requestedReasonBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.AccessReason, + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Builder, + com.google.cloud.cloudcontrolspartner.v1.AccessReasonOrBuilder>( + getRequestedReason(), getParentForChildren(), isClean()); + requestedReason_ = null; + } + return requestedReasonBuilder_; + } + + private com.google.protobuf.Timestamp requestedExpirationTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestedExpirationTimeBuilder_; + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return Whether the requestedExpirationTime field is set. + */ + public boolean hasRequestedExpirationTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return The requestedExpirationTime. + */ + public com.google.protobuf.Timestamp getRequestedExpirationTime() { + if (requestedExpirationTimeBuilder_ == null) { + return requestedExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpirationTime_; + } else { + return requestedExpirationTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public Builder setRequestedExpirationTime(com.google.protobuf.Timestamp value) { + if (requestedExpirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedExpirationTime_ = value; + } else { + requestedExpirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public Builder setRequestedExpirationTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestedExpirationTimeBuilder_ == null) { + requestedExpirationTime_ = builderForValue.build(); + } else { + requestedExpirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public Builder mergeRequestedExpirationTime(com.google.protobuf.Timestamp value) { + if (requestedExpirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && requestedExpirationTime_ != null + && requestedExpirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestedExpirationTimeBuilder().mergeFrom(value); + } else { + requestedExpirationTime_ = value; + } + } else { + requestedExpirationTimeBuilder_.mergeFrom(value); + } + if (requestedExpirationTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public Builder clearRequestedExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000008); + requestedExpirationTime_ = null; + if (requestedExpirationTimeBuilder_ != null) { + requestedExpirationTimeBuilder_.dispose(); + requestedExpirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getRequestedExpirationTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getRequestedExpirationTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getRequestedExpirationTimeOrBuilder() { + if (requestedExpirationTimeBuilder_ != null) { + return requestedExpirationTimeBuilder_.getMessageOrBuilder(); + } else { + return requestedExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpirationTime_; + } + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRequestedExpirationTimeFieldBuilder() { + if (requestedExpirationTimeBuilder_ == null) { + requestedExpirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestedExpirationTime(), getParentForChildren(), isClean()); + requestedExpirationTime_ = null; + } + return requestedExpirationTimeBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestName.java new file mode 100644 index 000000000000..9dfd2607a60e --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestName.java @@ -0,0 +1,308 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class AccessApprovalRequestName implements ResourceName { + private static final PathTemplate + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_ACCESS_APPROVAL_REQUEST = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + private final String accessApprovalRequest; + + @Deprecated + protected AccessApprovalRequestName() { + organization = null; + location = null; + customer = null; + workload = null; + accessApprovalRequest = null; + } + + private AccessApprovalRequestName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + accessApprovalRequest = Preconditions.checkNotNull(builder.getAccessApprovalRequest()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public String getAccessApprovalRequest() { + return accessApprovalRequest; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AccessApprovalRequestName of( + String organization, + String location, + String customer, + String workload, + String accessApprovalRequest) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .setAccessApprovalRequest(accessApprovalRequest) + .build(); + } + + public static String format( + String organization, + String location, + String customer, + String workload, + String accessApprovalRequest) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .setAccessApprovalRequest(accessApprovalRequest) + .build() + .toString(); + } + + public static AccessApprovalRequestName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_ACCESS_APPROVAL_REQUEST.validatedMatch( + formattedString, + "AccessApprovalRequestName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload"), + matchMap.get("access_approval_request")); + } + + 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 (AccessApprovalRequestName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_ACCESS_APPROVAL_REQUEST.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + if (accessApprovalRequest != null) { + fieldMapBuilder.put("access_approval_request", accessApprovalRequest); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_ACCESS_APPROVAL_REQUEST.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload, + "access_approval_request", + accessApprovalRequest); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AccessApprovalRequestName that = ((AccessApprovalRequestName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload) + && Objects.equals(this.accessApprovalRequest, that.accessApprovalRequest); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + h *= 1000003; + h ^= Objects.hashCode(accessApprovalRequest); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + private String accessApprovalRequest; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public String getAccessApprovalRequest() { + return accessApprovalRequest; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + public Builder setAccessApprovalRequest(String accessApprovalRequest) { + this.accessApprovalRequest = accessApprovalRequest; + return this; + } + + private Builder(AccessApprovalRequestName accessApprovalRequestName) { + this.organization = accessApprovalRequestName.organization; + this.location = accessApprovalRequestName.location; + this.customer = accessApprovalRequestName.customer; + this.workload = accessApprovalRequestName.workload; + this.accessApprovalRequest = accessApprovalRequestName.accessApprovalRequest; + } + + public AccessApprovalRequestName build() { + return new AccessApprovalRequestName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestOrBuilder.java new file mode 100644 index 000000000000..a52fe9457f82 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface AccessApprovalRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + boolean hasRequestedReason(); + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + com.google.cloud.cloudcontrolspartner.v1.AccessReason getRequestedReason(); + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason requested_reason = 3; + */ + com.google.cloud.cloudcontrolspartner.v1.AccessReasonOrBuilder getRequestedReasonOrBuilder(); + + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return Whether the requestedExpirationTime field is set. + */ + boolean hasRequestedExpirationTime(); + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return The requestedExpirationTime. + */ + com.google.protobuf.Timestamp getRequestedExpirationTime(); + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getRequestedExpirationTimeOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestsProto.java new file mode 100644 index 000000000000..cbc8bc0d2f73 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessApprovalRequestsProto.java @@ -0,0 +1,153 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class AccessApprovalRequestsProto { + private AccessApprovalRequestsProto() {} + + 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_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nCgoogle/cloud/cloudcontrolspartner/v1/a" + + "ccess_approval_requests.proto\022$google.cl" + + "oud.cloudcontrolspartner.v1\032\037google/api/" + + "field_behavior.proto\032\031google/api/resourc" + + "e.proto\032\037google/protobuf/timestamp.proto" + + "\"\351\003\n\025AccessApprovalRequest\022\021\n\004name\030\001 \001(\t" + + "B\003\340A\010\0220\n\014request_time\030\002 \001(\0132\032.google.pro" + + "tobuf.Timestamp\022L\n\020requested_reason\030\003 \001(" + + "\01322.google.cloud.cloudcontrolspartner.v1" + + ".AccessReason\022=\n\031requested_expiration_ti" + + "me\030\004 \001(\0132\032.google.protobuf.Timestamp:\375\001\352" + + "A\371\001\n9cloudcontrolspartner.googleapis.com" + + "/AccessApprovalRequest\022\214\001organizations/{" + + "organization}/locations/{location}/custo" + + "mers/{customer}/workloads/{workload}/acc" + + "essApprovalRequests/{access_approval_req" + + "uest}*\026accessApprovalRequests2\025accessApp" + + "rovalRequest\"\323\001\n!ListAccessApprovalReque" + + "stsRequest\022Q\n\006parent\030\001 \001(\tBA\340A\002\372A;\0229clou" + + "dcontrolspartner.googleapis.com/AccessAp" + + "provalRequest\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n" + + "\npage_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003" + + "\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\261\001\n\"ListAcces" + + "sApprovalRequestsResponse\022]\n\030access_appr" + + "oval_requests\030\001 \003(\0132;.google.cloud.cloud" + + "controlspartner.v1.AccessApprovalRequest" + + "\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable" + + "\030\003 \003(\t\"\302\002\n\014AccessReason\022E\n\004type\030\001 \001(\01627." + + "google.cloud.cloudcontrolspartner.v1.Acc" + + "essReason.Type\022\016\n\006detail\030\002 \001(\t\"\332\001\n\004Type\022" + + "\024\n\020TYPE_UNSPECIFIED\020\000\022\036\n\032CUSTOMER_INITIA" + + "TED_SUPPORT\020\001\022\034\n\030GOOGLE_INITIATED_SERVIC" + + "E\020\002\022\033\n\027GOOGLE_INITIATED_REVIEW\020\003\022\034\n\030THIR" + + "D_PARTY_DATA_REQUEST\020\004\022\'\n#GOOGLE_RESPONS" + + "E_TO_PRODUCTION_ALERT\020\005\022\032\n\026CLOUD_INITIAT" + + "ED_ACCESS\020\006B\237\002\n(com.google.cloud.cloudco" + + "ntrolspartner.v1B\033AccessApprovalRequests" + + "ProtoP\001Z\\cloud.google.com/go/cloudcontro" + + "lspartner/apiv1/cloudcontrolspartnerpb;c" + + "loudcontrolspartnerpb\252\002$Google.Cloud.Clo" + + "udControlsPartner.V1\312\002$Google\\Cloud\\Clou" + + "dControlsPartner\\V1\352\002\'Google::Cloud::Clo" + + "udControlsPartner::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(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_AccessApprovalRequest_descriptor, + new java.lang.String[] { + "Name", "RequestTime", "RequestedReason", "RequestedExpirationTime", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_descriptor, + new java.lang.String[] { + "AccessApprovalRequests", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_descriptor, + new java.lang.String[] { + "Type", "Detail", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessReason.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessReason.java new file mode 100644 index 000000000000..13ea1e05759f --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessReason.java @@ -0,0 +1,1065 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Reason for the access.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.AccessReason} + */ +public final class AccessReason extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.AccessReason) + AccessReasonOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessReason.newBuilder() to construct. + private AccessReason(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessReason() { + type_ = 0; + detail_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessReason(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.AccessReason.class, + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Builder.class); + } + + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.AccessReason.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value for proto, shouldn't be used.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Customer made a request or raised an issue that required the principal to
+     * access customer data. `detail` is of the form ("#####" is the issue ID):
+     *
+     * - "Feedback Report: #####"
+     * - "Case Number: #####"
+     * - "Case ID: #####"
+     * - "E-PIN Reference: #####"
+     * - "Google-#####"
+     * - "T-#####"
+     * 
+ * + * CUSTOMER_INITIATED_SUPPORT = 1; + */ + CUSTOMER_INITIATED_SUPPORT(1), + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services. Often this access is used to confirm that
+     * customers are not affected by a suspected service issue or to remediate a
+     * reversible system issue.
+     * 
+ * + * GOOGLE_INITIATED_SERVICE = 2; + */ + GOOGLE_INITIATED_SERVICE(2), + /** + * + * + *
+     * Google initiated service for security, fraud, abuse, or compliance
+     * purposes.
+     * 
+ * + * GOOGLE_INITIATED_REVIEW = 3; + */ + GOOGLE_INITIATED_REVIEW(3), + /** + * + * + *
+     * The principal was compelled to access customer data in order to respond
+     * to a legal third party data request or process, including legal processes
+     * from customers themselves.
+     * 
+ * + * THIRD_PARTY_DATA_REQUEST = 4; + */ + THIRD_PARTY_DATA_REQUEST(4), + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services or a known outage.
+     * 
+ * + * GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 5; + */ + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT(5), + /** + * + * + *
+     * Similar to 'GOOGLE_INITIATED_SERVICE' or 'GOOGLE_INITIATED_REVIEW', but
+     * with universe agnostic naming. The principal accessed customer data in
+     * order to diagnose or resolve a suspected issue in services or a known
+     * outage, or for security, fraud, abuse, or compliance review purposes.
+     * 
+ * + * CLOUD_INITIATED_ACCESS = 6; + */ + CLOUD_INITIATED_ACCESS(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value for proto, shouldn't be used.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Customer made a request or raised an issue that required the principal to
+     * access customer data. `detail` is of the form ("#####" is the issue ID):
+     *
+     * - "Feedback Report: #####"
+     * - "Case Number: #####"
+     * - "Case ID: #####"
+     * - "E-PIN Reference: #####"
+     * - "Google-#####"
+     * - "T-#####"
+     * 
+ * + * CUSTOMER_INITIATED_SUPPORT = 1; + */ + public static final int CUSTOMER_INITIATED_SUPPORT_VALUE = 1; + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services. Often this access is used to confirm that
+     * customers are not affected by a suspected service issue or to remediate a
+     * reversible system issue.
+     * 
+ * + * GOOGLE_INITIATED_SERVICE = 2; + */ + public static final int GOOGLE_INITIATED_SERVICE_VALUE = 2; + /** + * + * + *
+     * Google initiated service for security, fraud, abuse, or compliance
+     * purposes.
+     * 
+ * + * GOOGLE_INITIATED_REVIEW = 3; + */ + public static final int GOOGLE_INITIATED_REVIEW_VALUE = 3; + /** + * + * + *
+     * The principal was compelled to access customer data in order to respond
+     * to a legal third party data request or process, including legal processes
+     * from customers themselves.
+     * 
+ * + * THIRD_PARTY_DATA_REQUEST = 4; + */ + public static final int THIRD_PARTY_DATA_REQUEST_VALUE = 4; + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services or a known outage.
+     * 
+ * + * GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 5; + */ + public static final int GOOGLE_RESPONSE_TO_PRODUCTION_ALERT_VALUE = 5; + /** + * + * + *
+     * Similar to 'GOOGLE_INITIATED_SERVICE' or 'GOOGLE_INITIATED_REVIEW', but
+     * with universe agnostic naming. The principal accessed customer data in
+     * order to diagnose or resolve a suspected issue in services or a known
+     * outage, or for security, fraud, abuse, or compliance review purposes.
+     * 
+ * + * CLOUD_INITIATED_ACCESS = 6; + */ + public static final int CLOUD_INITIATED_ACCESS_VALUE = 6; + + 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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return CUSTOMER_INITIATED_SUPPORT; + case 2: + return GOOGLE_INITIATED_SERVICE; + case 3: + return GOOGLE_INITIATED_REVIEW; + case 4: + return THIRD_PARTY_DATA_REQUEST; + case 5: + return GOOGLE_RESPONSE_TO_PRODUCTION_ALERT; + case 6: + return CLOUD_INITIATED_ACCESS; + 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 Type findValueByNumber(int number) { + return Type.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.cloud.cloudcontrolspartner.v1.AccessReason.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.AccessReason.Type) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type getType() { + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type result = + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type.forNumber(type_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type.UNRECOGNIZED + : result; + } + + public static final int DETAIL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object detail_ = ""; + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The detail. + */ + @java.lang.Override + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + 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(); + detail_ = s; + return s; + } + } + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = 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 (type_ + != com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type.TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, detail_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type.TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, detail_); + } + 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.cloud.cloudcontrolspartner.v1.AccessReason)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.AccessReason other = + (com.google.cloud.cloudcontrolspartner.v1.AccessReason) obj; + + if (type_ != other.type_) return false; + if (!getDetail().equals(other.getDetail())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason 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.cloud.cloudcontrolspartner.v1.AccessReason parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason 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.cloud.cloudcontrolspartner.v1.AccessReason parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason 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.cloud.cloudcontrolspartner.v1.AccessReason parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason 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.cloud.cloudcontrolspartner.v1.AccessReason 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; + } + /** + * + * + *
+   * Reason for the access.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.AccessReason} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.AccessReason) + com.google.cloud.cloudcontrolspartner.v1.AccessReasonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.AccessReason.class, + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.AccessReason.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + detail_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_AccessReason_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessReason getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.AccessReason.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessReason build() { + com.google.cloud.cloudcontrolspartner.v1.AccessReason result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessReason buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.AccessReason result = + new com.google.cloud.cloudcontrolspartner.v1.AccessReason(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.AccessReason result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.detail_ = detail_; + } + } + + @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.cloud.cloudcontrolspartner.v1.AccessReason) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.AccessReason) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.AccessReason other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.AccessReason.getDefaultInstance()) + return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + detail_ = 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 int type_ = 0; + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type getType() { + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type result = + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type.forNumber(type_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return This builder for chaining. + */ + public Builder clearDetail() { + detail_ = getDefaultInstance().getDetail(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + detail_ = 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.cloud.cloudcontrolspartner.v1.AccessReason) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.AccessReason) + private static final com.google.cloud.cloudcontrolspartner.v1.AccessReason DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.AccessReason(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.AccessReason getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessReason 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.cloud.cloudcontrolspartner.v1.AccessReason getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessReasonOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessReasonOrBuilder.java new file mode 100644 index 000000000000..5c3d9dfb9cf0 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/AccessReasonOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface AccessReasonOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.AccessReason) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.AccessReason.Type type = 1; + * + * @return The type. + */ + com.google.cloud.cloudcontrolspartner.v1.AccessReason.Type getType(); + + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The detail. + */ + java.lang.String getDetail(); + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + com.google.protobuf.ByteString getDetailBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CompletionState.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CompletionState.java new file mode 100644 index 000000000000..6f77bc14a55b --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CompletionState.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/completion_state.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Enum for possible completion states.
+ * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.CompletionState} + */ +public enum CompletionState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified completion state.
+   * 
+ * + * COMPLETION_STATE_UNSPECIFIED = 0; + */ + COMPLETION_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * Task started (has start date) but not yet completed.
+   * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + * + * + *
+   * Succeeded state.
+   * 
+ * + * SUCCEEDED = 2; + */ + SUCCEEDED(2), + /** + * + * + *
+   * Failed state.
+   * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+   * Not applicable state.
+   * 
+ * + * NOT_APPLICABLE = 4; + */ + NOT_APPLICABLE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified completion state.
+   * 
+ * + * COMPLETION_STATE_UNSPECIFIED = 0; + */ + public static final int COMPLETION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Task started (has start date) but not yet completed.
+   * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + /** + * + * + *
+   * Succeeded state.
+   * 
+ * + * SUCCEEDED = 2; + */ + public static final int SUCCEEDED_VALUE = 2; + /** + * + * + *
+   * Failed state.
+   * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+   * Not applicable state.
+   * 
+ * + * NOT_APPLICABLE = 4; + */ + public static final int NOT_APPLICABLE_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CompletionState 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 CompletionState forNumber(int value) { + switch (value) { + case 0: + return COMPLETION_STATE_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return SUCCEEDED; + case 3: + return FAILED; + case 4: + return NOT_APPLICABLE; + 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 CompletionState findValueByNumber(int number) { + return CompletionState.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.cloud.cloudcontrolspartner.v1.CompletionStateProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final CompletionState[] VALUES = values(); + + public static CompletionState 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 CompletionState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.CompletionState) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CompletionStateProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CompletionStateProto.java new file mode 100644 index 000000000000..10c148cedf90 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CompletionStateProto.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/completion_state.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class CompletionStateProto { + private CompletionStateProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + 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/cloud/cloudcontrolspartner/v1/c" + + "ompletion_state.proto\022$google.cloud.clou" + + "dcontrolspartner.v1*o\n\017CompletionState\022 " + + "\n\034COMPLETION_STATE_UNSPECIFIED\020\000\022\013\n\007PEND" + + "ING\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n\006FAILED\020\003\022\022\n\016NOT_" + + "APPLICABLE\020\004B\230\002\n(com.google.cloud.cloudc" + + "ontrolspartner.v1B\024CompletionStateProtoP" + + "\001Z\\cloud.google.com/go/cloudcontrolspart" + + "ner/apiv1/cloudcontrolspartnerpb;cloudco" + + "ntrolspartnerpb\252\002$Google.Cloud.CloudCont" + + "rolsPartner.V1\312\002$Google\\Cloud\\CloudContr" + + "olsPartner\\V1\352\002\'Google::Cloud::CloudCont" + + "rolsPartner::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CoreProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CoreProto.java new file mode 100644 index 000000000000..0c8437098379 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CoreProto.java @@ -0,0 +1,178 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/core.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class CoreProto { + private CoreProto() {} + + 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_cloud_cloudcontrolspartner_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_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/cloud/cloudcontrolspartner/v1/c" + + "ore.proto\022$google.cloud.cloudcontrolspar" + + "tner.v1\032\034google/api/annotations.proto\032\027g" + + "oogle/api/client.proto\032\037google/api/field" + + "_behavior.proto\032\031google/api/resource.pro" + + "to\032Cgoogle/cloud/cloudcontrolspartner/v1" + + "/access_approval_requests.proto\032=google/" + + "cloud/cloudcontrolspartner/v1/customer_w" + + "orkloads.proto\0324google/cloud/cloudcontro" + + "lspartner/v1/customers.proto\032:google/clo" + + "ud/cloudcontrolspartner/v1/ekm_connectio" + + "ns.proto\032>google/cloud/cloudcontrolspart" + + "ner/v1/partner_permissions.proto\0323google" + + "/cloud/cloudcontrolspartner/v1/partners." + + "proto\032\037google/protobuf/timestamp.proto\"\200" + + "\002\n\021OperationMetadata\0224\n\013create_time\030\001 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003\0221\n\010en" + + "d_time\030\002 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\t" + + "B\003\340A\003\022\033\n\016status_message\030\005 \001(\tB\003\340A\003\022#\n\026re" + + "quested_cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_v" + + "ersion\030\007 \001(\tB\003\340A\0032\333\016\n\030CloudControlsPartn" + + "erCore\022\306\001\n\013GetWorkload\0228.google.cloud.cl" + + "oudcontrolspartner.v1.GetWorkloadRequest" + + "\032..google.cloud.cloudcontrolspartner.v1." + + "Workload\"M\332A\004name\202\323\344\223\002@\022>/v1/{name=organ" + + "izations/*/locations/*/customers/*/workl" + + "oads/*}\022\331\001\n\rListWorkloads\022:.google.cloud" + + ".cloudcontrolspartner.v1.ListWorkloadsRe" + + "quest\032;.google.cloud.cloudcontrolspartne" + + "r.v1.ListWorkloadsResponse\"O\332A\006parent\202\323\344" + + "\223\002@\022>/v1/{parent=organizations/*/locatio" + + "ns/*/customers/*}/workloads\022\272\001\n\013GetCusto" + + "mer\0228.google.cloud.cloudcontrolspartner." + + "v1.GetCustomerRequest\032..google.cloud.clo" + + "udcontrolspartner.v1.Customer\"A\332A\004name\202\323" + + "\344\223\0024\0222/v1/{name=organizations/*/location" + + "s/*/customers/*}\022\315\001\n\rListCustomers\022:.goo" + + "gle.cloud.cloudcontrolspartner.v1.ListCu" + + "stomersRequest\032;.google.cloud.cloudcontr" + + "olspartner.v1.ListCustomersResponse\"C\332A\006" + + "parent\202\323\344\223\0024\0222/v1/{parent=organizations/" + + "*/locations/*}/customers\022\347\001\n\021GetEkmConne" + + "ctions\022>.google.cloud.cloudcontrolspartn" + + "er.v1.GetEkmConnectionsRequest\0324.google." + + "cloud.cloudcontrolspartner.v1.EkmConnect" + + "ions\"\\\332A\004name\202\323\344\223\002O\022M/v1/{name=organizat" + + "ions/*/locations/*/customers/*/workloads" + + "/*/ekmConnections}\022\367\001\n\025GetPartnerPermiss" + + "ions\022B.google.cloud.cloudcontrolspartner" + + ".v1.GetPartnerPermissionsRequest\0328.googl" + + "e.cloud.cloudcontrolspartner.v1.PartnerP" + + "ermissions\"`\332A\004name\202\323\344\223\002S\022Q/v1/{name=org" + + "anizations/*/locations/*/customers/*/wor" + + "kloads/*/partnerPermissions}\022\231\002\n\032ListAcc" + + "essApprovalRequests\022G.google.cloud.cloud" + + "controlspartner.v1.ListAccessApprovalReq" + + "uestsRequest\032H.google.cloud.cloudcontrol" + + "spartner.v1.ListAccessApprovalRequestsRe" + + "sponse\"h\332A\006parent\202\323\344\223\002Y\022W/v1/{parent=org" + + "anizations/*/locations/*/customers/*/wor" + + "kloads/*}/accessApprovalRequests\022\263\001\n\nGet" + + "Partner\0227.google.cloud.cloudcontrolspart" + + "ner.v1.GetPartnerRequest\032-.google.cloud." + + "cloudcontrolspartner.v1.Partner\"=\332A\004name" + + "\202\323\344\223\0020\022./v1/{name=organizations/*/locati" + + "ons/*/partner}\032W\312A#cloudcontrolspartner." + + "googleapis.com\322A.https://www.googleapis." + + "com/auth/cloud-platformB\375\002\n(com.google.c" + + "loud.cloudcontrolspartner.v1B\tCoreProtoP" + + "\001Z\\cloud.google.com/go/cloudcontrolspart" + + "ner/apiv1/cloudcontrolspartnerpb;cloudco" + + "ntrolspartnerpb\252\002$Google.Cloud.CloudCont" + + "rolsPartner.V1\312\002$Google\\Cloud\\CloudContr" + + "olsPartner\\V1\352\002\'Google::Cloud::CloudCont" + + "rolsPartner::V1\352Am\n8cloudcontrolspartner" + + ".googleapis.com/OrganizationLocation\0221or" + + "ganizations/{organization}/locations/{lo" + + "cation}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1.CustomersProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1.PartnersProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + 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); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.CustomersProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.PartnersProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Customer.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Customer.java new file mode 100644 index 000000000000..657246bd51a6 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Customer.java @@ -0,0 +1,1226 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Contains metadata around a Cloud Controls Partner Customer
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Customer} + */ +public final class Customer extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Customer) + CustomerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Customer.newBuilder() to construct. + private Customer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Customer() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Customer(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Customer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Customer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Customer.class, + com.google.cloud.cloudcontrolspartner.v1.Customer.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The customer organization's display name. E.g. "google.com".
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The customer organization's display name. E.g. "google.com".
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOMER_ONBOARDING_STATE_FIELD_NUMBER = 3; + private com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customerOnboardingState_; + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return Whether the customerOnboardingState field is set. + */ + @java.lang.Override + public boolean hasCustomerOnboardingState() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return The customerOnboardingState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState + getCustomerOnboardingState() { + return customerOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.getDefaultInstance() + : customerOnboardingState_; + } + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStateOrBuilder + getCustomerOnboardingStateOrBuilder() { + return customerOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.getDefaultInstance() + : customerOnboardingState_; + } + + public static final int IS_ONBOARDED_FIELD_NUMBER = 4; + private boolean isOnboarded_ = false; + /** + * + * + *
+   * Indicates whether a customer is fully onboarded
+   * 
+ * + * bool is_onboarded = 4; + * + * @return The isOnboarded. + */ + @java.lang.Override + public boolean getIsOnboarded() { + return isOnboarded_; + } + + 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(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCustomerOnboardingState()); + } + if (isOnboarded_ != false) { + output.writeBool(4, isOnboarded_); + } + 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(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCustomerOnboardingState()); + } + if (isOnboarded_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, isOnboarded_); + } + 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.cloud.cloudcontrolspartner.v1.Customer)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Customer other = + (com.google.cloud.cloudcontrolspartner.v1.Customer) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasCustomerOnboardingState() != other.hasCustomerOnboardingState()) return false; + if (hasCustomerOnboardingState()) { + if (!getCustomerOnboardingState().equals(other.getCustomerOnboardingState())) return false; + } + if (getIsOnboarded() != other.getIsOnboarded()) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasCustomerOnboardingState()) { + hash = (37 * hash) + CUSTOMER_ONBOARDING_STATE_FIELD_NUMBER; + hash = (53 * hash) + getCustomerOnboardingState().hashCode(); + } + hash = (37 * hash) + IS_ONBOARDED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsOnboarded()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer 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.cloud.cloudcontrolspartner.v1.Customer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer 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.cloud.cloudcontrolspartner.v1.Customer parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer 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.cloud.cloudcontrolspartner.v1.Customer parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer 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.cloud.cloudcontrolspartner.v1.Customer 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; + } + /** + * + * + *
+   * Contains metadata around a Cloud Controls Partner Customer
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Customer} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Customer) + com.google.cloud.cloudcontrolspartner.v1.CustomerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Customer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Customer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Customer.class, + com.google.cloud.cloudcontrolspartner.v1.Customer.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.Customer.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCustomerOnboardingStateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + customerOnboardingState_ = null; + if (customerOnboardingStateBuilder_ != null) { + customerOnboardingStateBuilder_.dispose(); + customerOnboardingStateBuilder_ = null; + } + isOnboarded_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Customer_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Customer getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Customer.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Customer build() { + com.google.cloud.cloudcontrolspartner.v1.Customer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Customer buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Customer result = + new com.google.cloud.cloudcontrolspartner.v1.Customer(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.Customer result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.customerOnboardingState_ = + customerOnboardingStateBuilder_ == null + ? customerOnboardingState_ + : customerOnboardingStateBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.isOnboarded_ = isOnboarded_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.Customer) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.Customer) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.Customer other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.Customer.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCustomerOnboardingState()) { + mergeCustomerOnboardingState(other.getCustomerOnboardingState()); + } + if (other.getIsOnboarded() != false) { + setIsOnboarded(other.getIsOnboarded()); + } + 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: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getCustomerOnboardingStateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + isOnboarded_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState + customerOnboardingState_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStateOrBuilder> + customerOnboardingStateBuilder_; + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return Whether the customerOnboardingState field is set. + */ + public boolean hasCustomerOnboardingState() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return The customerOnboardingState. + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState + getCustomerOnboardingState() { + if (customerOnboardingStateBuilder_ == null) { + return customerOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.getDefaultInstance() + : customerOnboardingState_; + } else { + return customerOnboardingStateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public Builder setCustomerOnboardingState( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState value) { + if (customerOnboardingStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customerOnboardingState_ = value; + } else { + customerOnboardingStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public Builder setCustomerOnboardingState( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.Builder builderForValue) { + if (customerOnboardingStateBuilder_ == null) { + customerOnboardingState_ = builderForValue.build(); + } else { + customerOnboardingStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public Builder mergeCustomerOnboardingState( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState value) { + if (customerOnboardingStateBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && customerOnboardingState_ != null + && customerOnboardingState_ + != com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState + .getDefaultInstance()) { + getCustomerOnboardingStateBuilder().mergeFrom(value); + } else { + customerOnboardingState_ = value; + } + } else { + customerOnboardingStateBuilder_.mergeFrom(value); + } + if (customerOnboardingState_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public Builder clearCustomerOnboardingState() { + bitField0_ = (bitField0_ & ~0x00000004); + customerOnboardingState_ = null; + if (customerOnboardingStateBuilder_ != null) { + customerOnboardingStateBuilder_.dispose(); + customerOnboardingStateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.Builder + getCustomerOnboardingStateBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCustomerOnboardingStateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStateOrBuilder + getCustomerOnboardingStateOrBuilder() { + if (customerOnboardingStateBuilder_ != null) { + return customerOnboardingStateBuilder_.getMessageOrBuilder(); + } else { + return customerOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.getDefaultInstance() + : customerOnboardingState_; + } + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStateOrBuilder> + getCustomerOnboardingStateFieldBuilder() { + if (customerOnboardingStateBuilder_ == null) { + customerOnboardingStateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStateOrBuilder>( + getCustomerOnboardingState(), getParentForChildren(), isClean()); + customerOnboardingState_ = null; + } + return customerOnboardingStateBuilder_; + } + + private boolean isOnboarded_; + /** + * + * + *
+     * Indicates whether a customer is fully onboarded
+     * 
+ * + * bool is_onboarded = 4; + * + * @return The isOnboarded. + */ + @java.lang.Override + public boolean getIsOnboarded() { + return isOnboarded_; + } + /** + * + * + *
+     * Indicates whether a customer is fully onboarded
+     * 
+ * + * bool is_onboarded = 4; + * + * @param value The isOnboarded to set. + * @return This builder for chaining. + */ + public Builder setIsOnboarded(boolean value) { + + isOnboarded_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether a customer is fully onboarded
+     * 
+ * + * bool is_onboarded = 4; + * + * @return This builder for chaining. + */ + public Builder clearIsOnboarded() { + bitField0_ = (bitField0_ & ~0x00000008); + isOnboarded_ = false; + 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.cloud.cloudcontrolspartner.v1.Customer) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Customer) + private static final com.google.cloud.cloudcontrolspartner.v1.Customer DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.Customer(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Customer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Customer 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.cloud.cloudcontrolspartner.v1.Customer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerName.java new file mode 100644 index 000000000000..01dc287a3342 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CustomerName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + + @Deprecated + protected CustomerName() { + organization = null; + location = null; + customer = null; + } + + private CustomerName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CustomerName of(String organization, String location, String customer) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .build(); + } + + public static String format(String organization, String location, String customer) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .build() + .toString(); + } + + public static CustomerName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER.validatedMatch( + formattedString, "CustomerName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location"), matchMap.get("customer")); + } + + 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 (CustomerName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER.instantiate( + "organization", organization, "location", location, "customer", customer); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + CustomerName that = ((CustomerName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}/customers/{customer}. */ + public static class Builder { + private String organization; + private String location; + private String customer; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + private Builder(CustomerName customerName) { + this.organization = customerName.organization; + this.location = customerName.location; + this.customer = customerName.customer; + } + + public CustomerName build() { + return new CustomerName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingState.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingState.java new file mode 100644 index 000000000000..268b7ac840ca --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingState.java @@ -0,0 +1,1019 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Container for customer onboarding steps
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState} + */ +public final class CustomerOnboardingState extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState) + CustomerOnboardingStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomerOnboardingState.newBuilder() to construct. + private CustomerOnboardingState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomerOnboardingState() { + onboardingSteps_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomerOnboardingState(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.class, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.Builder.class); + } + + public static final int ONBOARDING_STEPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + onboardingSteps_; + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public java.util.List + getOnboardingStepsList() { + return onboardingSteps_; + } + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList() { + return onboardingSteps_; + } + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public int getOnboardingStepsCount() { + return onboardingSteps_.size(); + } + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep getOnboardingSteps( + int index) { + return onboardingSteps_.get(index); + } + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index) { + return onboardingSteps_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < onboardingSteps_.size(); i++) { + output.writeMessage(1, onboardingSteps_.get(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 < onboardingSteps_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, onboardingSteps_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState other = + (com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState) obj; + + if (!getOnboardingStepsList().equals(other.getOnboardingStepsList())) 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 (getOnboardingStepsCount() > 0) { + hash = (37 * hash) + ONBOARDING_STEPS_FIELD_NUMBER; + hash = (53 * hash) + getOnboardingStepsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingState parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingState parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingState parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingState 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; + } + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState) + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.class, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (onboardingStepsBuilder_ == null) { + onboardingSteps_ = java.util.Collections.emptyList(); + } else { + onboardingSteps_ = null; + onboardingStepsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState build() { + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState result = + new com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState result) { + if (onboardingStepsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + onboardingSteps_ = java.util.Collections.unmodifiableList(onboardingSteps_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.onboardingSteps_ = onboardingSteps_; + } else { + result.onboardingSteps_ = onboardingStepsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState.getDefaultInstance()) + return this; + if (onboardingStepsBuilder_ == null) { + if (!other.onboardingSteps_.isEmpty()) { + if (onboardingSteps_.isEmpty()) { + onboardingSteps_ = other.onboardingSteps_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.addAll(other.onboardingSteps_); + } + onChanged(); + } + } else { + if (!other.onboardingSteps_.isEmpty()) { + if (onboardingStepsBuilder_.isEmpty()) { + onboardingStepsBuilder_.dispose(); + onboardingStepsBuilder_ = null; + onboardingSteps_ = other.onboardingSteps_; + bitField0_ = (bitField0_ & ~0x00000001); + onboardingStepsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOnboardingStepsFieldBuilder() + : null; + } else { + onboardingStepsBuilder_.addAllMessages(other.onboardingSteps_); + } + } + } + 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.parser(), + extensionRegistry); + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(m); + } else { + onboardingStepsBuilder_.addMessage(m); + } + 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.util.List + onboardingSteps_ = java.util.Collections.emptyList(); + + private void ensureOnboardingStepsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + onboardingSteps_ = + new java.util.ArrayList< + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep>(onboardingSteps_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder> + onboardingStepsBuilder_; + + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List + getOnboardingStepsList() { + if (onboardingStepsBuilder_ == null) { + return java.util.Collections.unmodifiableList(onboardingSteps_); + } else { + return onboardingStepsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public int getOnboardingStepsCount() { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.size(); + } else { + return onboardingStepsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep getOnboardingSteps( + int index) { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.get(index); + } else { + return onboardingStepsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder setOnboardingSteps( + int index, com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.set(index, value); + onChanged(); + } else { + onboardingStepsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder setOnboardingSteps( + int index, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.set(index, builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(value); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + int index, com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(index, value); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + int index, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(index, builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addAllOnboardingSteps( + java.lang.Iterable< + ? extends com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep> + values) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, onboardingSteps_); + onChanged(); + } else { + onboardingStepsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder clearOnboardingSteps() { + if (onboardingStepsBuilder_ == null) { + onboardingSteps_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + onboardingStepsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder removeOnboardingSteps(int index) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.remove(index); + onChanged(); + } else { + onboardingStepsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder + getOnboardingStepsBuilder(int index) { + return getOnboardingStepsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index) { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.get(index); + } else { + return onboardingStepsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList() { + if (onboardingStepsBuilder_ != null) { + return onboardingStepsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(onboardingSteps_); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder + addOnboardingStepsBuilder() { + return getOnboardingStepsFieldBuilder() + .addBuilder( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.getDefaultInstance()); + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder + addOnboardingStepsBuilder(int index) { + return getOnboardingStepsFieldBuilder() + .addBuilder( + index, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.getDefaultInstance()); + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List + getOnboardingStepsBuilderList() { + return getOnboardingStepsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder> + getOnboardingStepsFieldBuilder() { + if (onboardingStepsBuilder_ == null) { + onboardingStepsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder>( + onboardingSteps_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + onboardingSteps_ = null; + } + return onboardingStepsBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1.CustomerOnboardingState) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState) + private static final com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingState + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStateOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStateOrBuilder.java new file mode 100644 index 000000000000..a8fa9a62da0c --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStateOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface CustomerOnboardingStateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + java.util.List + getOnboardingStepsList(); + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep getOnboardingSteps(int index); + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + int getOnboardingStepsCount(); + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + java.util.List + getOnboardingStepsOrBuilderList(); + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep onboarding_steps = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStep.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStep.java new file mode 100644 index 000000000000..c5d2ab24785e --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStep.java @@ -0,0 +1,1478 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Container for customer onboarding information
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep} + */ +public final class CustomerOnboardingStep extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep) + CustomerOnboardingStepOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomerOnboardingStep.newBuilder() to construct. + private CustomerOnboardingStep(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomerOnboardingStep() { + step_ = 0; + completionState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomerOnboardingStep(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.class, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder.class); + } + + /** + * + * + *
+   * Enum for possible onboarding steps
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step} + */ + public enum Step implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified step
+     * 
+ * + * STEP_UNSPECIFIED = 0; + */ + STEP_UNSPECIFIED(0), + /** + * + * + *
+     * KAJ Enrollment
+     * 
+ * + * KAJ_ENROLLMENT = 1; + */ + KAJ_ENROLLMENT(1), + /** + * + * + *
+     * Customer Environment
+     * 
+ * + * CUSTOMER_ENVIRONMENT = 2; + */ + CUSTOMER_ENVIRONMENT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified step
+     * 
+ * + * STEP_UNSPECIFIED = 0; + */ + public static final int STEP_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * KAJ Enrollment
+     * 
+ * + * KAJ_ENROLLMENT = 1; + */ + public static final int KAJ_ENROLLMENT_VALUE = 1; + /** + * + * + *
+     * Customer Environment
+     * 
+ * + * CUSTOMER_ENVIRONMENT = 2; + */ + public static final int CUSTOMER_ENVIRONMENT_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 Step 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 Step forNumber(int value) { + switch (value) { + case 0: + return STEP_UNSPECIFIED; + case 1: + return KAJ_ENROLLMENT; + case 2: + return CUSTOMER_ENVIRONMENT; + 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 Step findValueByNumber(int number) { + return Step.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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Step[] VALUES = values(); + + public static Step 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 Step(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step) + } + + private int bitField0_; + public static final int STEP_FIELD_NUMBER = 1; + private int step_ = 0; + /** + * + * + *
+   * The onboarding step
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+   * The onboarding step
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step getStep() { + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step result = + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step.forNumber(step_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step.UNRECOGNIZED + : result; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int COMPLETION_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp completionTime_; + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + @java.lang.Override + public boolean hasCompletionTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCompletionTime() { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder() { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + + public static final int COMPLETION_STATE_FIELD_NUMBER = 4; + private int completionState_ = 0; + /** + * + * + *
+   * Output only. Current state of the step
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + @java.lang.Override + public int getCompletionStateValue() { + return completionState_; + } + /** + * + * + *
+   * Output only. Current state of the step
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CompletionState getCompletionState() { + com.google.cloud.cloudcontrolspartner.v1.CompletionState result = + com.google.cloud.cloudcontrolspartner.v1.CompletionState.forNumber(completionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.CompletionState.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 (step_ + != com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step.STEP_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, step_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getCompletionTime()); + } + if (completionState_ + != com.google.cloud.cloudcontrolspartner.v1.CompletionState.COMPLETION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, completionState_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (step_ + != com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step.STEP_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, step_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCompletionTime()); + } + if (completionState_ + != com.google.cloud.cloudcontrolspartner.v1.CompletionState.COMPLETION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, completionState_); + } + 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep other = + (com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep) obj; + + if (step_ != other.step_) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasCompletionTime() != other.hasCompletionTime()) return false; + if (hasCompletionTime()) { + if (!getCompletionTime().equals(other.getCompletionTime())) return false; + } + if (completionState_ != other.completionState_) 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) + STEP_FIELD_NUMBER; + hash = (53 * hash) + step_; + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasCompletionTime()) { + hash = (37 * hash) + COMPLETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCompletionTime().hashCode(); + } + hash = (37 * hash) + COMPLETION_STATE_FIELD_NUMBER; + hash = (53 * hash) + completionState_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep 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; + } + /** + * + * + *
+   * Container for customer onboarding information
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep) + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStepOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.class, + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getCompletionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + step_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + completionTime_ = null; + if (completionTimeBuilder_ != null) { + completionTimeBuilder_.dispose(); + completionTimeBuilder_ = null; + } + completionState_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep build() { + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep result = + new com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.step_ = step_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.completionTime_ = + completionTimeBuilder_ == null ? completionTime_ : completionTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.completionState_ = completionState_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.getDefaultInstance()) + return this; + if (other.step_ != 0) { + setStepValue(other.getStepValue()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasCompletionTime()) { + mergeCompletionTime(other.getCompletionTime()); + } + if (other.completionState_ != 0) { + setCompletionStateValue(other.getCompletionStateValue()); + } + 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: + { + step_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCompletionTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + completionState_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 int step_ = 0; + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @param value The enum numeric value on the wire for step to set. + * @return This builder for chaining. + */ + public Builder setStepValue(int value) { + step_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step getStep() { + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step result = + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step.forNumber(step_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @param value The step to set. + * @return This builder for chaining. + */ + public Builder setStep( + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + step_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @return This builder for chaining. + */ + public Builder clearStep() { + bitField0_ = (bitField0_ & ~0x00000001); + step_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp completionTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + completionTimeBuilder_; + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + public boolean hasCompletionTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + public com.google.protobuf.Timestamp getCompletionTime() { + if (completionTimeBuilder_ == null) { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } else { + return completionTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder setCompletionTime(com.google.protobuf.Timestamp value) { + if (completionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionTime_ = value; + } else { + completionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder setCompletionTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (completionTimeBuilder_ == null) { + completionTime_ = builderForValue.build(); + } else { + completionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder mergeCompletionTime(com.google.protobuf.Timestamp value) { + if (completionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && completionTime_ != null + && completionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCompletionTimeBuilder().mergeFrom(value); + } else { + completionTime_ = value; + } + } else { + completionTimeBuilder_.mergeFrom(value); + } + if (completionTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder clearCompletionTime() { + bitField0_ = (bitField0_ & ~0x00000004); + completionTime_ = null; + if (completionTimeBuilder_ != null) { + completionTimeBuilder_.dispose(); + completionTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCompletionTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCompletionTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder() { + if (completionTimeBuilder_ != null) { + return completionTimeBuilder_.getMessageOrBuilder(); + } else { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCompletionTimeFieldBuilder() { + if (completionTimeBuilder_ == null) { + completionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCompletionTime(), getParentForChildren(), isClean()); + completionTime_ = null; + } + return completionTimeBuilder_; + } + + private int completionState_ = 0; + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + @java.lang.Override + public int getCompletionStateValue() { + return completionState_; + } + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for completionState to set. + * @return This builder for chaining. + */ + public Builder setCompletionStateValue(int value) { + completionState_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CompletionState getCompletionState() { + com.google.cloud.cloudcontrolspartner.v1.CompletionState result = + com.google.cloud.cloudcontrolspartner.v1.CompletionState.forNumber(completionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.CompletionState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The completionState to set. + * @return This builder for chaining. + */ + public Builder setCompletionState( + com.google.cloud.cloudcontrolspartner.v1.CompletionState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + completionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCompletionState() { + bitField0_ = (bitField0_ & ~0x00000008); + completionState_ = 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep) + private static final com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStepOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStepOrBuilder.java new file mode 100644 index 000000000000..f908a2df5dea --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOnboardingStepOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface CustomerOnboardingStepOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The onboarding step
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + int getStepValue(); + /** + * + * + *
+   * The onboarding step
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step step = 1; + * + * @return The step. + */ + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStep.Step getStep(); + + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + boolean hasCompletionTime(); + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + com.google.protobuf.Timestamp getCompletionTime(); + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Current state of the step
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + int getCompletionStateValue(); + /** + * + * + *
+   * Output only. Current state of the step
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + com.google.cloud.cloudcontrolspartner.v1.CompletionState getCompletionState(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOrBuilder.java new file mode 100644 index 000000000000..aa9bb9a6c5a2 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface CustomerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Customer) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The customer organization's display name. E.g. "google.com".
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The customer organization's display name. E.g. "google.com".
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return Whether the customerOnboardingState field is set. + */ + boolean hasCustomerOnboardingState(); + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return The customerOnboardingState. + */ + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState getCustomerOnboardingState(); + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + com.google.cloud.cloudcontrolspartner.v1.CustomerOnboardingStateOrBuilder + getCustomerOnboardingStateOrBuilder(); + + /** + * + * + *
+   * Indicates whether a customer is fully onboarded
+   * 
+ * + * bool is_onboarded = 4; + * + * @return The isOnboarded. + */ + boolean getIsOnboarded(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerWorkloadsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerWorkloadsProto.java new file mode 100644 index 000000000000..89df7569ba66 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomerWorkloadsProto.java @@ -0,0 +1,202 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class CustomerWorkloadsProto { + private CustomerWorkloadsProto() {} + + 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_cloud_cloudcontrolspartner_v1_Workload_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Workload_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_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/cloud/cloudcontrolspartner/v1/c" + + "ustomer_workloads.proto\022$google.cloud.cl" + + "oudcontrolspartner.v1\032\037google/api/field_" + + "behavior.proto\032\031google/api/resource.prot" + + "o\032;google/cloud/cloudcontrolspartner/v1/" + + "completion_state.proto\032\037google/protobuf/" + + "timestamp.proto\"\302\006\n\010Workload\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\010\022\026\n\tfolder_id\030\002 \001(\003B\003\340A\003\0224\n\013creat" + + "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\022\023\n\006folder\030\004 \001(\tB\003\340A\003\022`\n\031workload_o" + + "nboarding_state\030\005 \001(\0132=.google.cloud.clo" + + "udcontrolspartner.v1.WorkloadOnboardingS" + + "tate\022\024\n\014is_onboarded\030\006 \001(\010\022!\n\031key_manage" + + "ment_project_id\030\007 \001(\t\022\020\n\010location\030\010 \001(\t\022" + + "G\n\007partner\030\t \001(\01626.google.cloud.cloudcon" + + "trolspartner.v1.Workload.Partner\"\242\002\n\007Par" + + "tner\022\027\n\023PARTNER_UNSPECIFIED\020\000\022\"\n\036PARTNER" + + "_LOCAL_CONTROLS_BY_S3NS\020\001\022+\n\'PARTNER_SOV" + + "EREIGN_CONTROLS_BY_T_SYSTEMS\020\002\022-\n)PARTNE" + + "R_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT\020\003\022%\n" + + "!PARTNER_SOVEREIGN_CONTROLS_BY_PSN\020\004\022\'\n#" + + "PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT\020\006\022.\n" + + "*PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_" + + "EKM\020\007:\244\001\352A\240\001\n,cloudcontrolspartner.googl" + + "eapis.com/Workload\022[organizations/{organ" + + "ization}/locations/{location}/customers/" + + "{customer}/workloads/{workload}*\tworkloa" + + "ds2\010workload\"\257\001\n\024ListWorkloadsRequest\022D\n" + + "\006parent\030\001 \001(\tB4\340A\002\372A.\022,cloudcontrolspart" + + "ner.googleapis.com/Workload\022\021\n\tpage_size" + + "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\023\n\006filter\030\004 \001" + + "(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\210\001\n\025ListW" + + "orkloadsResponse\022A\n\tworkloads\030\001 \003(\0132..go" + + "ogle.cloud.cloudcontrolspartner.v1.Workl" + + "oad\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreacha" + + "ble\030\003 \003(\t\"X\n\022GetWorkloadRequest\022B\n\004name\030" + + "\001 \001(\tB4\340A\002\372A.\n,cloudcontrolspartner.goog" + + "leapis.com/Workload\"q\n\027WorkloadOnboardin" + + "gState\022V\n\020onboarding_steps\030\001 \003(\0132<.googl" + + "e.cloud.cloudcontrolspartner.v1.Workload" + + "OnboardingStep\"\376\002\n\026WorkloadOnboardingSte" + + "p\022O\n\004step\030\001 \001(\0162A.google.cloud.cloudcont" + + "rolspartner.v1.WorkloadOnboardingStep.St" + + "ep\022.\n\nstart_time\030\002 \001(\0132\032.google.protobuf" + + ".Timestamp\0223\n\017completion_time\030\003 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022T\n\020completion_st" + + "ate\030\004 \001(\01625.google.cloud.cloudcontrolspa" + + "rtner.v1.CompletionStateB\003\340A\003\"X\n\004Step\022\024\n" + + "\020STEP_UNSPECIFIED\020\000\022\023\n\017EKM_PROVISIONED\020\001" + + "\022%\n!SIGNED_ACCESS_APPROVAL_CONFIGURED\020\002B" + + "\232\002\n(com.google.cloud.cloudcontrolspartne" + + "r.v1B\026CustomerWorkloadsProtoP\001Z\\cloud.go" + + "ogle.com/go/cloudcontrolspartner/apiv1/c" + + "loudcontrolspartnerpb;cloudcontrolspartn" + + "erpb\252\002$Google.Cloud.CloudControlsPartner" + + ".V1\312\002$Google\\Cloud\\CloudControlsPartner\\" + + "V1\352\002\'Google::Cloud::CloudControlsPartner" + + "::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.cloud.cloudcontrolspartner.v1.CompletionStateProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Workload_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_Workload_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Workload_descriptor, + new java.lang.String[] { + "Name", + "FolderId", + "CreateTime", + "Folder", + "WorkloadOnboardingState", + "IsOnboarded", + "KeyManagementProjectId", + "Location", + "Partner", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_descriptor, + new java.lang.String[] { + "Workloads", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_descriptor, + new java.lang.String[] { + "OnboardingSteps", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_descriptor, + new java.lang.String[] { + "Step", "StartTime", "CompletionTime", "CompletionState", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.CompletionStateProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomersProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomersProto.java new file mode 100644 index 000000000000..627d54db4ab0 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/CustomersProto.java @@ -0,0 +1,180 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class CustomersProto { + private CustomersProto() {} + + 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_cloud_cloudcontrolspartner_v1_Customer_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Customer_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/cloudcontrolspartner/v1/c" + + "ustomers.proto\022$google.cloud.cloudcontro" + + "lspartner.v1\032\037google/api/field_behavior." + + "proto\032\031google/api/resource.proto\032;google" + + "/cloud/cloudcontrolspartner/v1/completio" + + "n_state.proto\032\037google/protobuf/timestamp" + + ".proto\"\275\002\n\010Customer\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\024" + + "\n\014display_name\030\002 \001(\t\022`\n\031customer_onboard" + + "ing_state\030\003 \001(\0132=.google.cloud.cloudcont" + + "rolspartner.v1.CustomerOnboardingState\022\024" + + "\n\014is_onboarded\030\004 \001(\010:\217\001\352A\213\001\n,cloudcontro" + + "lspartner.googleapis.com/Customer\022Forgan" + + "izations/{organization}/locations/{locat" + + "ion}/customers/{customer}*\tcustomers2\010cu" + + "stomer\"\257\001\n\024ListCustomersRequest\022D\n\006paren" + + "t\030\001 \001(\tB4\340A\002\372A.\022,cloudcontrolspartner.go" + + "ogleapis.com/Customer\022\021\n\tpage_size\030\002 \001(\005" + + "\022\022\n\npage_token\030\003 \001(\t\022\023\n\006filter\030\004 \001(\tB\003\340A" + + "\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\210\001\n\025ListCustome" + + "rsResponse\022A\n\tcustomers\030\001 \003(\0132..google.c" + + "loud.cloudcontrolspartner.v1.Customer\022\027\n" + + "\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 " + + "\003(\t\"X\n\022GetCustomerRequest\022B\n\004name\030\001 \001(\tB" + + "4\340A\002\372A.\n,cloudcontrolspartner.googleapis" + + ".com/Customer\"q\n\027CustomerOnboardingState" + + "\022V\n\020onboarding_steps\030\001 \003(\0132<.google.clou" + + "d.cloudcontrolspartner.v1.CustomerOnboar" + + "dingStep\"\360\002\n\026CustomerOnboardingStep\022O\n\004s" + + "tep\030\001 \001(\0162A.google.cloud.cloudcontrolspa" + + "rtner.v1.CustomerOnboardingStep.Step\022.\n\n" + + "start_time\030\002 \001(\0132\032.google.protobuf.Times" + + "tamp\0223\n\017completion_time\030\003 \001(\0132\032.google.p" + + "rotobuf.Timestamp\022T\n\020completion_state\030\004 " + + "\001(\01625.google.cloud.cloudcontrolspartner." + + "v1.CompletionStateB\003\340A\003\"J\n\004Step\022\024\n\020STEP_" + + "UNSPECIFIED\020\000\022\022\n\016KAJ_ENROLLMENT\020\001\022\030\n\024CUS" + + "TOMER_ENVIRONMENT\020\002B\222\002\n(com.google.cloud" + + ".cloudcontrolspartner.v1B\016CustomersProto" + + "P\001Z\\cloud.google.com/go/cloudcontrolspar" + + "tner/apiv1/cloudcontrolspartnerpb;cloudc" + + "ontrolspartnerpb\252\002$Google.Cloud.CloudCon" + + "trolsPartner.V1\312\002$Google\\Cloud\\CloudCont" + + "rolsPartner\\V1\352\002\'Google::Cloud::CloudCon" + + "trolsPartner::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.cloud.cloudcontrolspartner.v1.CompletionStateProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Customer_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_Customer_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Customer_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "CustomerOnboardingState", "IsOnboarded", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_descriptor, + new java.lang.String[] { + "Customers", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingState_descriptor, + new java.lang.String[] { + "OnboardingSteps", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_CustomerOnboardingStep_descriptor, + new java.lang.String[] { + "Step", "StartTime", "CompletionTime", "CompletionState", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.CompletionStateProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnection.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnection.java new file mode 100644 index 000000000000..4a353e63ed72 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnection.java @@ -0,0 +1,2198 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Details about the EKM connection
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.EkmConnection} + */ +public final class EkmConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.EkmConnection) + EkmConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use EkmConnection.newBuilder() to construct. + private EkmConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EkmConnection() { + connectionName_ = ""; + connectionState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EkmConnection(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.class, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder.class); + } + + /** + * + * + *
+   * The EKM connection state.
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState} + */ + public enum ConnectionState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified EKM connection state
+     * 
+ * + * CONNECTION_STATE_UNSPECIFIED = 0; + */ + CONNECTION_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Available EKM connection state
+     * 
+ * + * AVAILABLE = 1; + */ + AVAILABLE(1), + /** + * + * + *
+     * Not available EKM connection state
+     * 
+ * + * NOT_AVAILABLE = 2; + */ + NOT_AVAILABLE(2), + /** + * + * + *
+     * Error EKM connection state
+     * 
+ * + * ERROR = 3; + */ + ERROR(3), + /** + * + * + *
+     * Permission denied EKM connection state
+     * 
+ * + * PERMISSION_DENIED = 4; + */ + PERMISSION_DENIED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified EKM connection state
+     * 
+ * + * CONNECTION_STATE_UNSPECIFIED = 0; + */ + public static final int CONNECTION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Available EKM connection state
+     * 
+ * + * AVAILABLE = 1; + */ + public static final int AVAILABLE_VALUE = 1; + /** + * + * + *
+     * Not available EKM connection state
+     * 
+ * + * NOT_AVAILABLE = 2; + */ + public static final int NOT_AVAILABLE_VALUE = 2; + /** + * + * + *
+     * Error EKM connection state
+     * 
+ * + * ERROR = 3; + */ + public static final int ERROR_VALUE = 3; + /** + * + * + *
+     * Permission denied EKM connection state
+     * 
+ * + * PERMISSION_DENIED = 4; + */ + public static final int PERMISSION_DENIED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConnectionState 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 ConnectionState forNumber(int value) { + switch (value) { + case 0: + return CONNECTION_STATE_UNSPECIFIED; + case 1: + return AVAILABLE; + case 2: + return NOT_AVAILABLE; + case 3: + return ERROR; + case 4: + return PERMISSION_DENIED; + 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 ConnectionState findValueByNumber(int number) { + return ConnectionState.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.cloud.cloudcontrolspartner.v1.EkmConnection.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ConnectionState[] VALUES = values(); + + public static ConnectionState 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 ConnectionState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState) + } + + public interface ConnectionErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The error domain for the error
+     * 
+ * + * string error_domain = 1; + * + * @return The errorDomain. + */ + java.lang.String getErrorDomain(); + /** + * + * + *
+     * The error domain for the error
+     * 
+ * + * string error_domain = 1; + * + * @return The bytes for errorDomain. + */ + com.google.protobuf.ByteString getErrorDomainBytes(); + + /** + * + * + *
+     * The error message for the error
+     * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * + * + *
+     * The error message for the error
+     * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); + } + /** + * + * + *
+   * Information around the error that occurred if the connection state is
+   * anything other than available or unspecified
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError} + */ + public static final class ConnectionError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError) + ConnectionErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionError.newBuilder() to construct. + private ConnectionError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionError() { + errorDomain_ = ""; + errorMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.class, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.Builder.class); + } + + public static final int ERROR_DOMAIN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorDomain_ = ""; + /** + * + * + *
+     * The error domain for the error
+     * 
+ * + * string error_domain = 1; + * + * @return The errorDomain. + */ + @java.lang.Override + public java.lang.String getErrorDomain() { + java.lang.Object ref = errorDomain_; + 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(); + errorDomain_ = s; + return s; + } + } + /** + * + * + *
+     * The error domain for the error
+     * 
+ * + * string error_domain = 1; + * + * @return The bytes for errorDomain. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorDomainBytes() { + java.lang.Object ref = errorDomain_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorDomain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + /** + * + * + *
+     * The error message for the error
+     * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + 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(); + errorMessage_ = s; + return s; + } + } + /** + * + * + *
+     * The error message for the error
+     * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = 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(errorDomain_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, errorDomain_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); + } + 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(errorDomain_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, errorDomain_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); + } + 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.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError other = + (com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError) obj; + + if (!getErrorDomain().equals(other.getErrorDomain())) return false; + if (!getErrorMessage().equals(other.getErrorMessage())) 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) + ERROR_DOMAIN_FIELD_NUMBER; + hash = (53 * hash) + getErrorDomain().hashCode(); + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError 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.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError 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.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + 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.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError 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.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError 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; + } + /** + * + * + *
+     * Information around the error that occurred if the connection state is
+     * anything other than available or unspecified
+     * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError) + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.class, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.Builder + .class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + errorDomain_ = ""; + errorMessage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError build() { + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError result = + new com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.errorDomain_ = errorDomain_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorMessage_ = errorMessage_; + } + } + + @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.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + .getDefaultInstance()) return this; + if (!other.getErrorDomain().isEmpty()) { + errorDomain_ = other.errorDomain_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + 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: + { + errorDomain_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + errorMessage_ = 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.lang.Object errorDomain_ = ""; + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @return The errorDomain. + */ + public java.lang.String getErrorDomain() { + java.lang.Object ref = errorDomain_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorDomain_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @return The bytes for errorDomain. + */ + public com.google.protobuf.ByteString getErrorDomainBytes() { + java.lang.Object ref = errorDomain_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorDomain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @param value The errorDomain to set. + * @return This builder for chaining. + */ + public Builder setErrorDomain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorDomain_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @return This builder for chaining. + */ + public Builder clearErrorDomain() { + errorDomain_ = getDefaultInstance().getErrorDomain(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @param value The bytes for errorDomain to set. + * @return This builder for chaining. + */ + public Builder setErrorDomainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorDomain_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMessage_ = 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.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError) + private static final com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionError 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.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int CONNECTION_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object connectionName_ = ""; + /** + * + * + *
+   * Resource name of the EKM connection in the format:
+   * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+   * 
+ * + * string connection_name = 1; + * + * @return The connectionName. + */ + @java.lang.Override + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + 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(); + connectionName_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the EKM connection in the format:
+   * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+   * 
+ * + * string connection_name = 1; + * + * @return The bytes for connectionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTION_STATE_FIELD_NUMBER = 2; + private int connectionState_ = 0; + /** + * + * + *
+   * Output only. The connection state
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionState. + */ + @java.lang.Override + public int getConnectionStateValue() { + return connectionState_; + } + /** + * + * + *
+   * Output only. The connection state
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState + getConnectionState() { + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState result = + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState.forNumber( + connectionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState.UNRECOGNIZED + : result; + } + + public static final int CONNECTION_ERROR_FIELD_NUMBER = 3; + private com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connectionError_; + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return Whether the connectionError field is set. + */ + @java.lang.Override + public boolean hasConnectionError() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return The connectionError. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + getConnectionError() { + return connectionError_ == null + ? com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + .getDefaultInstance() + : connectionError_; + } + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionErrorOrBuilder + getConnectionErrorOrBuilder() { + return connectionError_ == null + ? com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + .getDefaultInstance() + : connectionError_; + } + + 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(connectionName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, connectionName_); + } + if (connectionState_ + != com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState + .CONNECTION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, connectionState_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getConnectionError()); + } + 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(connectionName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, connectionName_); + } + if (connectionState_ + != com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState + .CONNECTION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, connectionState_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getConnectionError()); + } + 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.cloud.cloudcontrolspartner.v1.EkmConnection)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.EkmConnection other = + (com.google.cloud.cloudcontrolspartner.v1.EkmConnection) obj; + + if (!getConnectionName().equals(other.getConnectionName())) return false; + if (connectionState_ != other.connectionState_) return false; + if (hasConnectionError() != other.hasConnectionError()) return false; + if (hasConnectionError()) { + if (!getConnectionError().equals(other.getConnectionError())) 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) + CONNECTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getConnectionName().hashCode(); + hash = (37 * hash) + CONNECTION_STATE_FIELD_NUMBER; + hash = (53 * hash) + connectionState_; + if (hasConnectionError()) { + hash = (37 * hash) + CONNECTION_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getConnectionError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection 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.cloud.cloudcontrolspartner.v1.EkmConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection 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.cloud.cloudcontrolspartner.v1.EkmConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection 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.cloud.cloudcontrolspartner.v1.EkmConnection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection 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.cloud.cloudcontrolspartner.v1.EkmConnection 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; + } + /** + * + * + *
+   * Details about the EKM connection
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.EkmConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.EkmConnection) + com.google.cloud.cloudcontrolspartner.v1.EkmConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.class, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.EkmConnection.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConnectionErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + connectionName_ = ""; + connectionState_ = 0; + connectionError_ = null; + if (connectionErrorBuilder_ != null) { + connectionErrorBuilder_.dispose(); + connectionErrorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection build() { + com.google.cloud.cloudcontrolspartner.v1.EkmConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.EkmConnection result = + new com.google.cloud.cloudcontrolspartner.v1.EkmConnection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.EkmConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.connectionName_ = connectionName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.connectionState_ = connectionState_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.connectionError_ = + connectionErrorBuilder_ == null ? connectionError_ : connectionErrorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.EkmConnection) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.EkmConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.EkmConnection other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.EkmConnection.getDefaultInstance()) + return this; + if (!other.getConnectionName().isEmpty()) { + connectionName_ = other.connectionName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.connectionState_ != 0) { + setConnectionStateValue(other.getConnectionStateValue()); + } + if (other.hasConnectionError()) { + mergeConnectionError(other.getConnectionError()); + } + 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: + { + connectionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + connectionState_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getConnectionErrorFieldBuilder().getBuilder(), extensionRegistry); + 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 connectionName_ = ""; + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @return The connectionName. + */ + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @return The bytes for connectionName. + */ + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @param value The connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + connectionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearConnectionName() { + connectionName_ = getDefaultInstance().getConnectionName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @param value The bytes for connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + connectionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int connectionState_ = 0; + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionState. + */ + @java.lang.Override + public int getConnectionStateValue() { + return connectionState_; + } + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for connectionState to set. + * @return This builder for chaining. + */ + public Builder setConnectionStateValue(int value) { + connectionState_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState + getConnectionState() { + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState result = + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState.forNumber( + connectionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The connectionState to set. + * @return This builder for chaining. + */ + public Builder setConnectionState( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + connectionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionState() { + bitField0_ = (bitField0_ & ~0x00000002); + connectionState_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connectionError_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionErrorOrBuilder> + connectionErrorBuilder_; + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return Whether the connectionError field is set. + */ + public boolean hasConnectionError() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return The connectionError. + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + getConnectionError() { + if (connectionErrorBuilder_ == null) { + return connectionError_ == null + ? com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + .getDefaultInstance() + : connectionError_; + } else { + return connectionErrorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + public Builder setConnectionError( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError value) { + if (connectionErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionError_ = value; + } else { + connectionErrorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + public Builder setConnectionError( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.Builder + builderForValue) { + if (connectionErrorBuilder_ == null) { + connectionError_ = builderForValue.build(); + } else { + connectionErrorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + public Builder mergeConnectionError( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError value) { + if (connectionErrorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && connectionError_ != null + && connectionError_ + != com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + .getDefaultInstance()) { + getConnectionErrorBuilder().mergeFrom(value); + } else { + connectionError_ = value; + } + } else { + connectionErrorBuilder_.mergeFrom(value); + } + if (connectionError_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + public Builder clearConnectionError() { + bitField0_ = (bitField0_ & ~0x00000004); + connectionError_ = null; + if (connectionErrorBuilder_ != null) { + connectionErrorBuilder_.dispose(); + connectionErrorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.Builder + getConnectionErrorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getConnectionErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionErrorOrBuilder + getConnectionErrorOrBuilder() { + if (connectionErrorBuilder_ != null) { + return connectionErrorBuilder_.getMessageOrBuilder(); + } else { + return connectionError_ == null + ? com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError + .getDefaultInstance() + : connectionError_; + } + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionErrorOrBuilder> + getConnectionErrorFieldBuilder() { + if (connectionErrorBuilder_ == null) { + connectionErrorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionErrorOrBuilder>( + getConnectionError(), getParentForChildren(), isClean()); + connectionError_ = null; + } + return connectionErrorBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1.EkmConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.EkmConnection) + private static final com.google.cloud.cloudcontrolspartner.v1.EkmConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.EkmConnection(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EkmConnection 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.cloud.cloudcontrolspartner.v1.EkmConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionOrBuilder.java new file mode 100644 index 000000000000..a399118ab390 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface EkmConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.EkmConnection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the EKM connection in the format:
+   * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+   * 
+ * + * string connection_name = 1; + * + * @return The connectionName. + */ + java.lang.String getConnectionName(); + /** + * + * + *
+   * Resource name of the EKM connection in the format:
+   * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+   * 
+ * + * string connection_name = 1; + * + * @return The bytes for connectionName. + */ + com.google.protobuf.ByteString getConnectionNameBytes(); + + /** + * + * + *
+   * Output only. The connection state
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionState. + */ + int getConnectionStateValue(); + /** + * + * + *
+   * Output only. The connection state
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionState. + */ + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionState getConnectionState(); + + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return Whether the connectionError field is set. + */ + boolean hasConnectionError(); + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return The connectionError. + */ + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError getConnectionError(); + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionError connection_error = 3; + * + */ + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.ConnectionErrorOrBuilder + getConnectionErrorOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnections.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnections.java new file mode 100644 index 000000000000..b5d71e180e84 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnections.java @@ -0,0 +1,1162 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * The EKM connections associated with a workload
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.EkmConnections} + */ +public final class EkmConnections extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.EkmConnections) + EkmConnectionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use EkmConnections.newBuilder() to construct. + private EkmConnections(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EkmConnections() { + name_ = ""; + ekmConnections_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EkmConnections(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.EkmConnections.class, + com.google.cloud.cloudcontrolspartner.v1.EkmConnections.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EKM_CONNECTIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List ekmConnections_; + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + @java.lang.Override + public java.util.List + getEkmConnectionsList() { + return ekmConnections_; + } + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + @java.lang.Override + public java.util.List + getEkmConnectionsOrBuilderList() { + return ekmConnections_; + } + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + @java.lang.Override + public int getEkmConnectionsCount() { + return ekmConnections_.size(); + } + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection getEkmConnections(int index) { + return ekmConnections_.get(index); + } + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnectionOrBuilder getEkmConnectionsOrBuilder( + int index) { + return ekmConnections_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < ekmConnections_.size(); i++) { + output.writeMessage(2, ekmConnections_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < ekmConnections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, ekmConnections_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.cloudcontrolspartner.v1.EkmConnections)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.EkmConnections other = + (com.google.cloud.cloudcontrolspartner.v1.EkmConnections) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEkmConnectionsList().equals(other.getEkmConnectionsList())) 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 (getEkmConnectionsCount() > 0) { + hash = (37 * hash) + EKM_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getEkmConnectionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections 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.cloud.cloudcontrolspartner.v1.EkmConnections parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections 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.cloud.cloudcontrolspartner.v1.EkmConnections parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections 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.cloud.cloudcontrolspartner.v1.EkmConnections parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections 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.cloud.cloudcontrolspartner.v1.EkmConnections 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 EKM connections associated with a workload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.EkmConnections} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.EkmConnections) + com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.EkmConnections.class, + com.google.cloud.cloudcontrolspartner.v1.EkmConnections.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.EkmConnections.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (ekmConnectionsBuilder_ == null) { + ekmConnections_ = java.util.Collections.emptyList(); + } else { + ekmConnections_ = null; + ekmConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnections getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnections.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnections build() { + com.google.cloud.cloudcontrolspartner.v1.EkmConnections result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmConnections buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.EkmConnections result = + new com.google.cloud.cloudcontrolspartner.v1.EkmConnections(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.EkmConnections result) { + if (ekmConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + ekmConnections_ = java.util.Collections.unmodifiableList(ekmConnections_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ekmConnections_ = ekmConnections_; + } else { + result.ekmConnections_ = ekmConnectionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.EkmConnections 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.cloud.cloudcontrolspartner.v1.EkmConnections) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.EkmConnections) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.EkmConnections other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.EkmConnections.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (ekmConnectionsBuilder_ == null) { + if (!other.ekmConnections_.isEmpty()) { + if (ekmConnections_.isEmpty()) { + ekmConnections_ = other.ekmConnections_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEkmConnectionsIsMutable(); + ekmConnections_.addAll(other.ekmConnections_); + } + onChanged(); + } + } else { + if (!other.ekmConnections_.isEmpty()) { + if (ekmConnectionsBuilder_.isEmpty()) { + ekmConnectionsBuilder_.dispose(); + ekmConnectionsBuilder_ = null; + ekmConnections_ = other.ekmConnections_; + bitField0_ = (bitField0_ & ~0x00000002); + ekmConnectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEkmConnectionsFieldBuilder() + : null; + } else { + ekmConnectionsBuilder_.addAllMessages(other.ekmConnections_); + } + } + } + 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.cloud.cloudcontrolspartner.v1.EkmConnection m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.parser(), + extensionRegistry); + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(m); + } else { + ekmConnectionsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List ekmConnections_ = + java.util.Collections.emptyList(); + + private void ensureEkmConnectionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ekmConnections_ = + new java.util.ArrayList( + ekmConnections_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmConnection, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmConnectionOrBuilder> + ekmConnectionsBuilder_; + + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public java.util.List + getEkmConnectionsList() { + if (ekmConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(ekmConnections_); + } else { + return ekmConnectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public int getEkmConnectionsCount() { + if (ekmConnectionsBuilder_ == null) { + return ekmConnections_.size(); + } else { + return ekmConnectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection getEkmConnections(int index) { + if (ekmConnectionsBuilder_ == null) { + return ekmConnections_.get(index); + } else { + return ekmConnectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder setEkmConnections( + int index, com.google.cloud.cloudcontrolspartner.v1.EkmConnection value) { + if (ekmConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmConnectionsIsMutable(); + ekmConnections_.set(index, value); + onChanged(); + } else { + ekmConnectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder setEkmConnections( + int index, com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder builderForValue) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + ekmConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder addEkmConnections(com.google.cloud.cloudcontrolspartner.v1.EkmConnection value) { + if (ekmConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(value); + onChanged(); + } else { + ekmConnectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder addEkmConnections( + int index, com.google.cloud.cloudcontrolspartner.v1.EkmConnection value) { + if (ekmConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(index, value); + onChanged(); + } else { + ekmConnectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder addEkmConnections( + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder builderForValue) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(builderForValue.build()); + onChanged(); + } else { + ekmConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder addEkmConnections( + int index, com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder builderForValue) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + ekmConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder addAllEkmConnections( + java.lang.Iterable + values) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ekmConnections_); + onChanged(); + } else { + ekmConnectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder clearEkmConnections() { + if (ekmConnectionsBuilder_ == null) { + ekmConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + ekmConnectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public Builder removeEkmConnections(int index) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.remove(index); + onChanged(); + } else { + ekmConnectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder getEkmConnectionsBuilder( + int index) { + return getEkmConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnectionOrBuilder + getEkmConnectionsOrBuilder(int index) { + if (ekmConnectionsBuilder_ == null) { + return ekmConnections_.get(index); + } else { + return ekmConnectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public java.util.List + getEkmConnectionsOrBuilderList() { + if (ekmConnectionsBuilder_ != null) { + return ekmConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ekmConnections_); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder + addEkmConnectionsBuilder() { + return getEkmConnectionsFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1.EkmConnection.getDefaultInstance()); + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder addEkmConnectionsBuilder( + int index) { + return getEkmConnectionsFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1.EkmConnection.getDefaultInstance()); + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + * + */ + public java.util.List + getEkmConnectionsBuilderList() { + return getEkmConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmConnection, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmConnectionOrBuilder> + getEkmConnectionsFieldBuilder() { + if (ekmConnectionsBuilder_ == null) { + ekmConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmConnection, + com.google.cloud.cloudcontrolspartner.v1.EkmConnection.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmConnectionOrBuilder>( + ekmConnections_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + ekmConnections_ = null; + } + return ekmConnectionsBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1.EkmConnections) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.EkmConnections) + private static final com.google.cloud.cloudcontrolspartner.v1.EkmConnections DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.EkmConnections(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmConnections getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EkmConnections 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.cloud.cloudcontrolspartner.v1.EkmConnections getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsName.java new file mode 100644 index 000000000000..a28c8eb9e751 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class EkmConnectionsName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + + @Deprecated + protected EkmConnectionsName() { + organization = null; + location = null; + customer = null; + workload = null; + } + + private EkmConnectionsName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static EkmConnectionsName of( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build(); + } + + public static String format( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build() + .toString(); + } + + public static EkmConnectionsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.validatedMatch( + formattedString, "EkmConnectionsName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload")); + } + + 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 (EkmConnectionsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + EkmConnectionsName that = ((EkmConnectionsName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + private Builder(EkmConnectionsName ekmConnectionsName) { + this.organization = ekmConnectionsName.organization; + this.location = ekmConnectionsName.location; + this.customer = ekmConnectionsName.customer; + this.workload = ekmConnectionsName.workload; + } + + public EkmConnectionsName build() { + return new EkmConnectionsName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsOrBuilder.java new file mode 100644 index 000000000000..b2bef4201a2e --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface EkmConnectionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.EkmConnections) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + java.util.List getEkmConnectionsList(); + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + com.google.cloud.cloudcontrolspartner.v1.EkmConnection getEkmConnections(int index); + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + int getEkmConnectionsCount(); + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + java.util.List + getEkmConnectionsOrBuilderList(); + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmConnection ekm_connections = 2; + */ + com.google.cloud.cloudcontrolspartner.v1.EkmConnectionOrBuilder getEkmConnectionsOrBuilder( + int index); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsProto.java new file mode 100644 index 000000000000..84e61f99bcd6 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmConnectionsProto.java @@ -0,0 +1,142 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class EkmConnectionsProto { + private EkmConnectionsProto() {} + + 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_cloud_cloudcontrolspartner_v1_EkmConnections_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_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/cloud/cloudcontrolspartner/v1/e" + + "km_connections.proto\022$google.cloud.cloud" + + "controlspartner.v1\032\037google/api/field_beh" + + "avior.proto\032\031google/api/resource.proto\"\230" + + "\002\n\016EkmConnections\022\021\n\004name\030\001 \001(\tB\003\340A\010\022L\n\017" + + "ekm_connections\030\002 \003(\01323.google.cloud.clo" + + "udcontrolspartner.v1.EkmConnection:\244\001\352A\240" + + "\001\n2cloudcontrolspartner.googleapis.com/E" + + "kmConnections\022jorganizations/{organizati" + + "on}/locations/{location}/customers/{cust" + + "omer}/workloads/{workload}/ekmConnection" + + "s\"d\n\030GetEkmConnectionsRequest\022H\n\004name\030\001 " + + "\001(\tB:\340A\002\372A4\n2cloudcontrolspartner.google" + + "apis.com/EkmConnections\"\244\003\n\rEkmConnectio" + + "n\022\027\n\017connection_name\030\001 \001(\t\022b\n\020connection" + + "_state\030\002 \001(\0162C.google.cloud.cloudcontrol" + + "spartner.v1.EkmConnection.ConnectionStat" + + "eB\003\340A\003\022]\n\020connection_error\030\003 \001(\0132C.googl" + + "e.cloud.cloudcontrolspartner.v1.EkmConne" + + "ction.ConnectionError\032>\n\017ConnectionError" + + "\022\024\n\014error_domain\030\001 \001(\t\022\025\n\rerror_message\030" + + "\002 \001(\t\"w\n\017ConnectionState\022 \n\034CONNECTION_S" + + "TATE_UNSPECIFIED\020\000\022\r\n\tAVAILABLE\020\001\022\021\n\rNOT" + + "_AVAILABLE\020\002\022\t\n\005ERROR\020\003\022\025\n\021PERMISSION_DE" + + "NIED\020\004B\227\002\n(com.google.cloud.cloudcontrol" + + "spartner.v1B\023EkmConnectionsProtoP\001Z\\clou" + + "d.google.com/go/cloudcontrolspartner/api" + + "v1/cloudcontrolspartnerpb;cloudcontrolsp" + + "artnerpb\252\002$Google.Cloud.CloudControlsPar" + + "tner.V1\312\002$Google\\Cloud\\CloudControlsPart" + + "ner\\V1\352\002\'Google::Cloud::CloudControlsPar" + + "tner::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(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnections_descriptor, + new java.lang.String[] { + "Name", "EkmConnections", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_descriptor, + new java.lang.String[] { + "ConnectionName", "ConnectionState", "ConnectionError", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_EkmConnection_ConnectionError_descriptor, + new java.lang.String[] { + "ErrorDomain", "ErrorMessage", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmMetadata.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmMetadata.java new file mode 100644 index 000000000000..81c70c91b0bc --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmMetadata.java @@ -0,0 +1,994 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Holds information needed by Mudbray to use partner EKMs for workloads.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.EkmMetadata} + */ +public final class EkmMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.EkmMetadata) + EkmMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use EkmMetadata.newBuilder() to construct. + private EkmMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EkmMetadata() { + ekmSolution_ = 0; + ekmEndpointUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EkmMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.class, + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder.class); + } + + /** + * + * + *
+   * Represents Google Cloud supported external key management partners
+   * [Google Cloud EKM partners
+   * docs](https://cloud.google.com/kms/docs/ekm#supported_partners).
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution} + */ + public enum EkmSolution implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified EKM solution
+     * 
+ * + * EKM_SOLUTION_UNSPECIFIED = 0; + */ + EKM_SOLUTION_UNSPECIFIED(0), + /** + * + * + *
+     * EKM Partner Fortanix
+     * 
+ * + * FORTANIX = 1; + */ + FORTANIX(1), + /** + * + * + *
+     * EKM Partner FutureX
+     * 
+ * + * FUTUREX = 2; + */ + FUTUREX(2), + /** + * + * + *
+     * EKM Partner Thales
+     * 
+ * + * THALES = 3; + */ + THALES(3), + /** + * + * + *
+     * EKM Partner Virtu
+     * 
+ * + * VIRTRU = 4; + */ + VIRTRU(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified EKM solution
+     * 
+ * + * EKM_SOLUTION_UNSPECIFIED = 0; + */ + public static final int EKM_SOLUTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * EKM Partner Fortanix
+     * 
+ * + * FORTANIX = 1; + */ + public static final int FORTANIX_VALUE = 1; + /** + * + * + *
+     * EKM Partner FutureX
+     * 
+ * + * FUTUREX = 2; + */ + public static final int FUTUREX_VALUE = 2; + /** + * + * + *
+     * EKM Partner Thales
+     * 
+ * + * THALES = 3; + */ + public static final int THALES_VALUE = 3; + /** + * + * + *
+     * EKM Partner Virtu
+     * 
+ * + * VIRTRU = 4; + */ + public static final int VIRTRU_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EkmSolution 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 EkmSolution forNumber(int value) { + switch (value) { + case 0: + return EKM_SOLUTION_UNSPECIFIED; + case 1: + return FORTANIX; + case 2: + return FUTUREX; + case 3: + return THALES; + case 4: + return VIRTRU; + 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 EkmSolution findValueByNumber(int number) { + return EkmSolution.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.cloud.cloudcontrolspartner.v1.EkmMetadata.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EkmSolution[] VALUES = values(); + + public static EkmSolution 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 EkmSolution(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution) + } + + public static final int EKM_SOLUTION_FIELD_NUMBER = 1; + private int ekmSolution_ = 0; + /** + * + * + *
+   * The Cloud EKM partner.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @return The enum numeric value on the wire for ekmSolution. + */ + @java.lang.Override + public int getEkmSolutionValue() { + return ekmSolution_; + } + /** + * + * + *
+   * The Cloud EKM partner.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @return The ekmSolution. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution getEkmSolution() { + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution result = + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution.forNumber(ekmSolution_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution.UNRECOGNIZED + : result; + } + + public static final int EKM_ENDPOINT_URI_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ekmEndpointUri_ = ""; + /** + * + * + *
+   * Endpoint for sending requests to the EKM for key provisioning during
+   * Assured Workload creation.
+   * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The ekmEndpointUri. + */ + @java.lang.Override + public java.lang.String getEkmEndpointUri() { + java.lang.Object ref = ekmEndpointUri_; + 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(); + ekmEndpointUri_ = s; + return s; + } + } + /** + * + * + *
+   * Endpoint for sending requests to the EKM for key provisioning during
+   * Assured Workload creation.
+   * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The bytes for ekmEndpointUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEkmEndpointUriBytes() { + java.lang.Object ref = ekmEndpointUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ekmEndpointUri_ = 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 (ekmSolution_ + != com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution.EKM_SOLUTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, ekmSolution_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ekmEndpointUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ekmEndpointUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ekmSolution_ + != com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution.EKM_SOLUTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, ekmSolution_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ekmEndpointUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ekmEndpointUri_); + } + 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.cloud.cloudcontrolspartner.v1.EkmMetadata)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata other = + (com.google.cloud.cloudcontrolspartner.v1.EkmMetadata) obj; + + if (ekmSolution_ != other.ekmSolution_) return false; + if (!getEkmEndpointUri().equals(other.getEkmEndpointUri())) 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) + EKM_SOLUTION_FIELD_NUMBER; + hash = (53 * hash) + ekmSolution_; + hash = (37 * hash) + EKM_ENDPOINT_URI_FIELD_NUMBER; + hash = (53 * hash) + getEkmEndpointUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata 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.cloud.cloudcontrolspartner.v1.EkmMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata 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.cloud.cloudcontrolspartner.v1.EkmMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata 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.cloud.cloudcontrolspartner.v1.EkmMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata 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.cloud.cloudcontrolspartner.v1.EkmMetadata 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; + } + /** + * + * + *
+   * Holds information needed by Mudbray to use partner EKMs for workloads.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.EkmMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.EkmMetadata) + com.google.cloud.cloudcontrolspartner.v1.EkmMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.class, + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ekmSolution_ = 0; + ekmEndpointUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata build() { + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata result = + new com.google.cloud.cloudcontrolspartner.v1.EkmMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.EkmMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ekmSolution_ = ekmSolution_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ekmEndpointUri_ = ekmEndpointUri_; + } + } + + @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.cloud.cloudcontrolspartner.v1.EkmMetadata) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.EkmMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.EkmMetadata other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.getDefaultInstance()) + return this; + if (other.ekmSolution_ != 0) { + setEkmSolutionValue(other.getEkmSolutionValue()); + } + if (!other.getEkmEndpointUri().isEmpty()) { + ekmEndpointUri_ = other.ekmEndpointUri_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + ekmSolution_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + ekmEndpointUri_ = 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 int ekmSolution_ = 0; + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @return The enum numeric value on the wire for ekmSolution. + */ + @java.lang.Override + public int getEkmSolutionValue() { + return ekmSolution_; + } + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @param value The enum numeric value on the wire for ekmSolution to set. + * @return This builder for chaining. + */ + public Builder setEkmSolutionValue(int value) { + ekmSolution_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @return The ekmSolution. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution getEkmSolution() { + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution result = + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution.forNumber(ekmSolution_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @param value The ekmSolution to set. + * @return This builder for chaining. + */ + public Builder setEkmSolution( + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + ekmSolution_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @return This builder for chaining. + */ + public Builder clearEkmSolution() { + bitField0_ = (bitField0_ & ~0x00000001); + ekmSolution_ = 0; + onChanged(); + return this; + } + + private java.lang.Object ekmEndpointUri_ = ""; + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The ekmEndpointUri. + */ + public java.lang.String getEkmEndpointUri() { + java.lang.Object ref = ekmEndpointUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ekmEndpointUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The bytes for ekmEndpointUri. + */ + public com.google.protobuf.ByteString getEkmEndpointUriBytes() { + java.lang.Object ref = ekmEndpointUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ekmEndpointUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @param value The ekmEndpointUri to set. + * @return This builder for chaining. + */ + public Builder setEkmEndpointUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ekmEndpointUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearEkmEndpointUri() { + ekmEndpointUri_ = getDefaultInstance().getEkmEndpointUri(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @param value The bytes for ekmEndpointUri to set. + * @return This builder for chaining. + */ + public Builder setEkmEndpointUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ekmEndpointUri_ = 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.cloud.cloudcontrolspartner.v1.EkmMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.EkmMetadata) + private static final com.google.cloud.cloudcontrolspartner.v1.EkmMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.EkmMetadata(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.EkmMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EkmMetadata 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.cloud.cloudcontrolspartner.v1.EkmMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmMetadataOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmMetadataOrBuilder.java new file mode 100644 index 000000000000..368b504451fd --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/EkmMetadataOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface EkmMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.EkmMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Cloud EKM partner.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @return The enum numeric value on the wire for ekmSolution. + */ + int getEkmSolutionValue(); + /** + * + * + *
+   * The Cloud EKM partner.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution ekm_solution = 1; + * + * @return The ekmSolution. + */ + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.EkmSolution getEkmSolution(); + + /** + * + * + *
+   * Endpoint for sending requests to the EKM for key provisioning during
+   * Assured Workload creation.
+   * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The ekmEndpointUri. + */ + java.lang.String getEkmEndpointUri(); + /** + * + * + *
+   * Endpoint for sending requests to the EKM for key provisioning during
+   * Assured Workload creation.
+   * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The bytes for ekmEndpointUri. + */ + com.google.protobuf.ByteString getEkmEndpointUriBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetCustomerRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetCustomerRequest.java new file mode 100644 index 000000000000..2d4fddd18361 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetCustomerRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Message for getting a customer
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetCustomerRequest} + */ +public final class GetCustomerRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.GetCustomerRequest) + GetCustomerRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCustomerRequest.newBuilder() to construct. + private GetCustomerRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCustomerRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCustomerRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * + * 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. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest other = + (com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest) 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest 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 customer
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetCustomerRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.GetCustomerRequest) + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest.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.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetCustomerRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest build() { + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest result = + new com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest.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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.GetCustomerRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCustomerRequest 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.cloud.cloudcontrolspartner.v1.GetCustomerRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetCustomerRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetCustomerRequestOrBuilder.java new file mode 100644 index 000000000000..6342b911be23 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetCustomerRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface GetCustomerRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.GetCustomerRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetEkmConnectionsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetEkmConnectionsRequest.java new file mode 100644 index 000000000000..3f64a3facb46 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetEkmConnectionsRequest.java @@ -0,0 +1,656 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Request for getting the EKM connections associated with a workload
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest} + */ +public final class GetEkmConnectionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) + GetEkmConnectionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEkmConnectionsRequest.newBuilder() to construct. + private GetEkmConnectionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEkmConnectionsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEkmConnectionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+   * 
+ * + * + * 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. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest other = + (com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest + 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for getting the EKM connections associated with a workload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest.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.cloud.cloudcontrolspartner.v1.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetEkmConnectionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest build() { + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest result = + new com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest.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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetEkmConnectionsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetEkmConnectionsRequestOrBuilder.java new file mode 100644 index 000000000000..65ae87b452f4 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetEkmConnectionsRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface GetEkmConnectionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections`
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerPermissionsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerPermissionsRequest.java new file mode 100644 index 000000000000..c2472c50acd6 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerPermissionsRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Request for getting the partner permissions granted for a workload
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest} + */ +public final class GetPartnerPermissionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) + GetPartnerPermissionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPartnerPermissionsRequest.newBuilder() to construct. + private GetPartnerPermissionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPartnerPermissionsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPartnerPermissionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource to get in the format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+   * 
+ * + * + * 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 to get in the format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest other = + (com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for getting the partner permissions granted for a workload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest.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.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest build() { + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest result = + new com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + .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 to get in the format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * + * 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 to get in the format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * + * 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 to get in the format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * + * 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 to get in the format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * + * 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 to get in the format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerPermissionsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerPermissionsRequestOrBuilder.java new file mode 100644 index 000000000000..e00a1ee034cb --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerPermissionsRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface GetPartnerPermissionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource to get in the format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource to get in the format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerRequest.java new file mode 100644 index 000000000000..9315ccce1d2e --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Message for getting a Partner
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetPartnerRequest} + */ +public final class GetPartnerRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.GetPartnerRequest) + GetPartnerRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPartnerRequest.newBuilder() to construct. + private GetPartnerRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPartnerRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPartnerRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/partner`
+   * 
+ * + * + * 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. Format:
+   * `organizations/{organization}/locations/{location}/partner`
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest other = + (com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest) 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest 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 Partner
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetPartnerRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.GetPartnerRequest) + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest.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.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest build() { + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest result = + new com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest.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. Format:
+     * `organizations/{organization}/locations/{location}/partner`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/partner`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/partner`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/partner`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/partner`
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.GetPartnerRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPartnerRequest 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.cloud.cloudcontrolspartner.v1.GetPartnerRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerRequestOrBuilder.java new file mode 100644 index 000000000000..6f45247670ca --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetPartnerRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface GetPartnerRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.GetPartnerRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/partner`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/partner`
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetViolationRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetViolationRequest.java new file mode 100644 index 000000000000..c66a14ff34e0 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetViolationRequest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Message for getting a Violation
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetViolationRequest} + */ +public final class GetViolationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.GetViolationRequest) + GetViolationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetViolationRequest.newBuilder() to construct. + private GetViolationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetViolationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetViolationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+   * 
+ * + * + * 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. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetViolationRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest other = + (com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest) 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.cloud.cloudcontrolspartner.v1.GetViolationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest 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.cloud.cloudcontrolspartner.v1.GetViolationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest 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.cloud.cloudcontrolspartner.v1.GetViolationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest 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.cloud.cloudcontrolspartner.v1.GetViolationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest 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.cloud.cloudcontrolspartner.v1.GetViolationRequest 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 Violation
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetViolationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.GetViolationRequest) + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest.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.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest build() { + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest result = + new com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest 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.cloud.cloudcontrolspartner.v1.GetViolationRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest.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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetViolationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.GetViolationRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetViolationRequest 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.cloud.cloudcontrolspartner.v1.GetViolationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetViolationRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetViolationRequestOrBuilder.java new file mode 100644 index 000000000000..a5bccdeccc84 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetViolationRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface GetViolationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.GetViolationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetWorkloadRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetWorkloadRequest.java new file mode 100644 index 000000000000..85046cd8f9c1 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetWorkloadRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Message for getting a customer workload.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest} + */ +public final class GetWorkloadRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) + GetWorkloadRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetWorkloadRequest.newBuilder() to construct. + private GetWorkloadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetWorkloadRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetWorkloadRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * 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. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest other = + (com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest 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 customer workload.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest.class, + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest.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.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest build() { + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest result = + new com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest.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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1.GetWorkloadRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetWorkloadRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetWorkloadRequestOrBuilder.java new file mode 100644 index 000000000000..94e2c1d228a5 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/GetWorkloadRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface GetWorkloadRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsRequest.java new file mode 100644 index 000000000000..a4656facf1de --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsRequest.java @@ -0,0 +1,1339 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Request for getting the access requests associated with a workload.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest} + */ +public final class ListAccessApprovalRequestsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) + ListAccessApprovalRequestsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAccessApprovalRequestsRequest.newBuilder() to construct. + private ListAccessApprovalRequestsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAccessApprovalRequestsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAccessApprovalRequestsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * 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 resource
+   * Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of access requests to return. The service may
+   * return fewer than this value. If unspecified, at most 500 access requests
+   * will be returned.
+   * 
+ * + * 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 page token, received from a previous
+   * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+   * page.
+   * 
+ * + * 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 page token, received from a previous
+   * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+   * page.
+   * 
+ * + * 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. Filtering results.
+   * 
+ * + * 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. Filtering results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest other = + (com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for getting the access requests associated with a workload.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest.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.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest build() { + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest result = + new com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + .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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of access requests to return. The service may
+     * return fewer than this value. If unspecified, at most 500 access requests
+     * will be returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of access requests to return. The service may
+     * return fewer than this value. If unspecified, at most 500 access requests
+     * will be returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of access requests to return. The service may
+     * return fewer than this value. If unspecified, at most 500 access requests
+     * will be returned.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAccessApprovalRequestsRequest 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsRequestOrBuilder.java new file mode 100644 index 000000000000..598382d706b5 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsRequestOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ListAccessApprovalRequestsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of access requests to return. The service may
+   * return fewer than this value. If unspecified, at most 500 access requests
+   * will be returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+   * page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+   * page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsResponse.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsResponse.java new file mode 100644 index 000000000000..11d9b3b51d49 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsResponse.java @@ -0,0 +1,1504 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Response message for list access requests.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse} + */ +public final class ListAccessApprovalRequestsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse) + ListAccessApprovalRequestsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAccessApprovalRequestsResponse.newBuilder() to construct. + private ListAccessApprovalRequestsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAccessApprovalRequestsResponse() { + accessApprovalRequests_ = 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 ListAccessApprovalRequestsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse.class, + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse.Builder + .class); + } + + public static final int ACCESS_APPROVAL_REQUESTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + accessApprovalRequests_; + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public java.util.List + getAccessApprovalRequestsList() { + return accessApprovalRequests_; + } + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder> + getAccessApprovalRequestsOrBuilderList() { + return accessApprovalRequests_; + } + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public int getAccessApprovalRequestsCount() { + return accessApprovalRequests_.size(); + } + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest getAccessApprovalRequests( + int index) { + return accessApprovalRequests_.get(index); + } + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder + getAccessApprovalRequestsOrBuilder(int index) { + return accessApprovalRequests_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that 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 that 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 < accessApprovalRequests_.size(); i++) { + output.writeMessage(1, accessApprovalRequests_.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 < accessApprovalRequests_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, accessApprovalRequests_.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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse other = + (com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse) obj; + + if (!getAccessApprovalRequestsList().equals(other.getAccessApprovalRequestsList())) + 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 (getAccessApprovalRequestsCount() > 0) { + hash = (37 * hash) + ACCESS_APPROVAL_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getAccessApprovalRequestsList().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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for list access requests.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse) + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse.class, + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse.Builder + .class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (accessApprovalRequestsBuilder_ == null) { + accessApprovalRequests_ = java.util.Collections.emptyList(); + } else { + accessApprovalRequests_ = null; + accessApprovalRequestsBuilder_.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.cloud.cloudcontrolspartner.v1.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListAccessApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse build() { + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse result = + new com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse result) { + if (accessApprovalRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + accessApprovalRequests_ = java.util.Collections.unmodifiableList(accessApprovalRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.accessApprovalRequests_ = accessApprovalRequests_; + } else { + result.accessApprovalRequests_ = accessApprovalRequestsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + .getDefaultInstance()) return this; + if (accessApprovalRequestsBuilder_ == null) { + if (!other.accessApprovalRequests_.isEmpty()) { + if (accessApprovalRequests_.isEmpty()) { + accessApprovalRequests_ = other.accessApprovalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.addAll(other.accessApprovalRequests_); + } + onChanged(); + } + } else { + if (!other.accessApprovalRequests_.isEmpty()) { + if (accessApprovalRequestsBuilder_.isEmpty()) { + accessApprovalRequestsBuilder_.dispose(); + accessApprovalRequestsBuilder_ = null; + accessApprovalRequests_ = other.accessApprovalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + accessApprovalRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAccessApprovalRequestsFieldBuilder() + : null; + } else { + accessApprovalRequestsBuilder_.addAllMessages(other.accessApprovalRequests_); + } + } + } + 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.cloud.cloudcontrolspartner.v1.AccessApprovalRequest m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.parser(), + extensionRegistry); + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(m); + } else { + accessApprovalRequestsBuilder_.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 + accessApprovalRequests_ = java.util.Collections.emptyList(); + + private void ensureAccessApprovalRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + accessApprovalRequests_ = + new java.util.ArrayList( + accessApprovalRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder> + accessApprovalRequestsBuilder_; + + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public java.util.List + getAccessApprovalRequestsList() { + if (accessApprovalRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(accessApprovalRequests_); + } else { + return accessApprovalRequestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public int getAccessApprovalRequestsCount() { + if (accessApprovalRequestsBuilder_ == null) { + return accessApprovalRequests_.size(); + } else { + return accessApprovalRequestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest getAccessApprovalRequests( + int index) { + if (accessApprovalRequestsBuilder_ == null) { + return accessApprovalRequests_.get(index); + } else { + return accessApprovalRequestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder setAccessApprovalRequests( + int index, com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest value) { + if (accessApprovalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.set(index, value); + onChanged(); + } else { + accessApprovalRequestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder setAccessApprovalRequests( + int index, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder builderForValue) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + accessApprovalRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest value) { + if (accessApprovalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(value); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAccessApprovalRequests( + int index, com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest value) { + if (accessApprovalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(index, value); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder builderForValue) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(builderForValue.build()); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAccessApprovalRequests( + int index, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder builderForValue) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAllAccessApprovalRequests( + java.lang.Iterable + values) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, accessApprovalRequests_); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder clearAccessApprovalRequests() { + if (accessApprovalRequestsBuilder_ == null) { + accessApprovalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + accessApprovalRequestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder removeAccessApprovalRequests(int index) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.remove(index); + onChanged(); + } else { + accessApprovalRequestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder + getAccessApprovalRequestsBuilder(int index) { + return getAccessApprovalRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder + getAccessApprovalRequestsOrBuilder(int index) { + if (accessApprovalRequestsBuilder_ == null) { + return accessApprovalRequests_.get(index); + } else { + return accessApprovalRequestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder> + getAccessApprovalRequestsOrBuilderList() { + if (accessApprovalRequestsBuilder_ != null) { + return accessApprovalRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(accessApprovalRequests_); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder + addAccessApprovalRequestsBuilder() { + return getAccessApprovalRequestsFieldBuilder() + .addBuilder( + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.getDefaultInstance()); + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder + addAccessApprovalRequestsBuilder(int index) { + return getAccessApprovalRequestsFieldBuilder() + .addBuilder( + index, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.getDefaultInstance()); + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + public java.util.List + getAccessApprovalRequestsBuilderList() { + return getAccessApprovalRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder> + getAccessApprovalRequestsFieldBuilder() { + if (accessApprovalRequestsBuilder_ == null) { + accessApprovalRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest.Builder, + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder>( + accessApprovalRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + accessApprovalRequests_ = null; + } + return accessApprovalRequestsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that 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 that 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 that 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 that 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 that 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse) + private static final com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAccessApprovalRequestsResponse 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.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsResponseOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsResponseOrBuilder.java new file mode 100644 index 000000000000..d4304b96a5d4 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListAccessApprovalRequestsResponseOrBuilder.java @@ -0,0 +1,169 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ListAccessApprovalRequestsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + java.util.List + getAccessApprovalRequestsList(); + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest getAccessApprovalRequests( + int index); + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + int getAccessApprovalRequestsCount(); + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + java.util.List + getAccessApprovalRequestsOrBuilderList(); + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest access_approval_requests = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequestOrBuilder + getAccessApprovalRequestsOrBuilder(int index); + + /** + * + * + *
+   * A token that 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 that 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersRequest.java new file mode 100644 index 000000000000..8d1b17c501c0 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersRequest.java @@ -0,0 +1,1301 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Request to list customers
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListCustomersRequest} + */ +public final class ListCustomersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.ListCustomersRequest) + ListCustomersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCustomersRequest.newBuilder() to construct. + private ListCustomersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCustomersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCustomersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest.class, + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource
+   * Format: `organizations/{organization}/locations/{location}`
+   * 
+ * + * + * 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 resource
+   * Format: `organizations/{organization}/locations/{location}`
+   * 
+ * + * + * 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; + /** + * + * + *
+   * The maximum number of Customers to return. The service may return fewer
+   * than this value. If unspecified, at most 500 Customers will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListCustomers` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListCustomers` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * 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. Filtering results
+   * 
+ * + * 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. Hint for how to order the results
+   * 
+ * + * 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. Hint for how to order the results
+   * 
+ * + * 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest other = + (com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest) 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request to list customers
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListCustomersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.ListCustomersRequest) + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest.class, + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest.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.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest build() { + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest result = + new com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest.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 resource
+     * Format: `organizations/{organization}/locations/{location}`
+     * 
+ * + * + * 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 resource
+     * Format: `organizations/{organization}/locations/{location}`
+     * 
+ * + * + * 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 resource
+     * Format: `organizations/{organization}/locations/{location}`
+     * 
+ * + * + * 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 resource
+     * Format: `organizations/{organization}/locations/{location}`
+     * 
+ * + * + * 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 resource
+     * Format: `organizations/{organization}/locations/{location}`
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * The maximum number of Customers to return. The service may return fewer
+     * than this value. If unspecified, at most 500 Customers will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of Customers to return. The service may return fewer
+     * than this value. If unspecified, at most 500 Customers will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of Customers to return. The service may return fewer
+     * than this value. If unspecified, at most 500 Customers will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.ListCustomersRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomersRequest 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.cloud.cloudcontrolspartner.v1.ListCustomersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersRequestOrBuilder.java new file mode 100644 index 000000000000..6708d912d8b6 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ListCustomersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.ListCustomersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource
+   * Format: `organizations/{organization}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource
+   * Format: `organizations/{organization}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of Customers to return. The service may return fewer
+   * than this value. If unspecified, at most 500 Customers will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListCustomers` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListCustomers` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersResponse.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersResponse.java new file mode 100644 index 000000000000..12be6ec46c80 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersResponse.java @@ -0,0 +1,1419 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Response message for list customer Customers requests
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListCustomersResponse} + */ +public final class ListCustomersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.ListCustomersResponse) + ListCustomersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCustomersResponse.newBuilder() to construct. + private ListCustomersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCustomersResponse() { + customers_ = 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 ListCustomersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse.class, + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse.Builder.class); + } + + public static final int CUSTOMERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List customers_; + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + @java.lang.Override + public java.util.List getCustomersList() { + return customers_; + } + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + @java.lang.Override + public java.util.List + getCustomersOrBuilderList() { + return customers_; + } + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + @java.lang.Override + public int getCustomersCount() { + return customers_.size(); + } + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Customer getCustomers(int index) { + return customers_.get(index); + } + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CustomerOrBuilder getCustomersOrBuilder( + int index) { + return customers_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that 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 that 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 < customers_.size(); i++) { + output.writeMessage(1, customers_.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 < customers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, customers_.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.cloud.cloudcontrolspartner.v1.ListCustomersResponse)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse other = + (com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse) obj; + + if (!getCustomersList().equals(other.getCustomersList())) 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 (getCustomersCount() > 0) { + hash = (37 * hash) + CUSTOMERS_FIELD_NUMBER; + hash = (53 * hash) + getCustomersList().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.cloud.cloudcontrolspartner.v1.ListCustomersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1.ListCustomersResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1.ListCustomersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1.ListCustomersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1.ListCustomersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for list customer Customers requests
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListCustomersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.ListCustomersResponse) + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse.class, + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (customersBuilder_ == null) { + customers_ = java.util.Collections.emptyList(); + } else { + customers_ = null; + customersBuilder_.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.cloud.cloudcontrolspartner.v1.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListCustomersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse build() { + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse result = + new com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse result) { + if (customersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + customers_ = java.util.Collections.unmodifiableList(customers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.customers_ = customers_; + } else { + result.customers_ = customersBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1.ListCustomersResponse) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse.getDefaultInstance()) + return this; + if (customersBuilder_ == null) { + if (!other.customers_.isEmpty()) { + if (customers_.isEmpty()) { + customers_ = other.customers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCustomersIsMutable(); + customers_.addAll(other.customers_); + } + onChanged(); + } + } else { + if (!other.customers_.isEmpty()) { + if (customersBuilder_.isEmpty()) { + customersBuilder_.dispose(); + customersBuilder_ = null; + customers_ = other.customers_; + bitField0_ = (bitField0_ & ~0x00000001); + customersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCustomersFieldBuilder() + : null; + } else { + customersBuilder_.addAllMessages(other.customers_); + } + } + } + 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.cloud.cloudcontrolspartner.v1.Customer m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.Customer.parser(), + extensionRegistry); + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.add(m); + } else { + customersBuilder_.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 customers_ = + java.util.Collections.emptyList(); + + private void ensureCustomersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + customers_ = + new java.util.ArrayList(customers_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Customer, + com.google.cloud.cloudcontrolspartner.v1.Customer.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOrBuilder> + customersBuilder_; + + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public java.util.List getCustomersList() { + if (customersBuilder_ == null) { + return java.util.Collections.unmodifiableList(customers_); + } else { + return customersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public int getCustomersCount() { + if (customersBuilder_ == null) { + return customers_.size(); + } else { + return customersBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Customer getCustomers(int index) { + if (customersBuilder_ == null) { + return customers_.get(index); + } else { + return customersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder setCustomers( + int index, com.google.cloud.cloudcontrolspartner.v1.Customer value) { + if (customersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomersIsMutable(); + customers_.set(index, value); + onChanged(); + } else { + customersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder setCustomers( + int index, com.google.cloud.cloudcontrolspartner.v1.Customer.Builder builderForValue) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.set(index, builderForValue.build()); + onChanged(); + } else { + customersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder addCustomers(com.google.cloud.cloudcontrolspartner.v1.Customer value) { + if (customersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomersIsMutable(); + customers_.add(value); + onChanged(); + } else { + customersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder addCustomers( + int index, com.google.cloud.cloudcontrolspartner.v1.Customer value) { + if (customersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomersIsMutable(); + customers_.add(index, value); + onChanged(); + } else { + customersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder addCustomers( + com.google.cloud.cloudcontrolspartner.v1.Customer.Builder builderForValue) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.add(builderForValue.build()); + onChanged(); + } else { + customersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder addCustomers( + int index, com.google.cloud.cloudcontrolspartner.v1.Customer.Builder builderForValue) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.add(index, builderForValue.build()); + onChanged(); + } else { + customersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder addAllCustomers( + java.lang.Iterable values) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customers_); + onChanged(); + } else { + customersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder clearCustomers() { + if (customersBuilder_ == null) { + customers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + customersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public Builder removeCustomers(int index) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.remove(index); + onChanged(); + } else { + customersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Customer.Builder getCustomersBuilder( + int index) { + return getCustomersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.CustomerOrBuilder getCustomersOrBuilder( + int index) { + if (customersBuilder_ == null) { + return customers_.get(index); + } else { + return customersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public java.util.List + getCustomersOrBuilderList() { + if (customersBuilder_ != null) { + return customersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customers_); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Customer.Builder addCustomersBuilder() { + return getCustomersFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1.Customer.getDefaultInstance()); + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Customer.Builder addCustomersBuilder( + int index) { + return getCustomersFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1.Customer.getDefaultInstance()); + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + public java.util.List + getCustomersBuilderList() { + return getCustomersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Customer, + com.google.cloud.cloudcontrolspartner.v1.Customer.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOrBuilder> + getCustomersFieldBuilder() { + if (customersBuilder_ == null) { + customersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Customer, + com.google.cloud.cloudcontrolspartner.v1.Customer.Builder, + com.google.cloud.cloudcontrolspartner.v1.CustomerOrBuilder>( + customers_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + customers_ = null; + } + return customersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that 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 that 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 that 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 that 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 that 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.cloud.cloudcontrolspartner.v1.ListCustomersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.ListCustomersResponse) + private static final com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomersResponse 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.cloud.cloudcontrolspartner.v1.ListCustomersResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersResponseOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersResponseOrBuilder.java new file mode 100644 index 000000000000..1ed29b5dfc01 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListCustomersResponseOrBuilder.java @@ -0,0 +1,156 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ListCustomersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.ListCustomersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + java.util.List getCustomersList(); + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + com.google.cloud.cloudcontrolspartner.v1.Customer getCustomers(int index); + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + int getCustomersCount(); + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + java.util.List + getCustomersOrBuilderList(); + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Customer customers = 1; + */ + com.google.cloud.cloudcontrolspartner.v1.CustomerOrBuilder getCustomersOrBuilder(int index); + + /** + * + * + *
+   * A token that 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 that 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsRequest.java new file mode 100644 index 000000000000..c89eb2613bfa --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsRequest.java @@ -0,0 +1,1597 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Message for requesting list of Violations
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListViolationsRequest} + */ +public final class ListViolationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.ListViolationsRequest) + ListViolationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListViolationsRequest.newBuilder() to construct. + private ListViolationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListViolationsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListViolationsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource
+   * Format
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * 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 resource
+   * Format
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of customers row to return. The service may
+   * return fewer than this value. If unspecified, at most 10 customers will be
+   * returned.
+   * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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. Filtering results
+   * 
+ * + * 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. Filtering results
+   * 
+ * + * 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. Hint for how to order the results
+   * 
+ * + * 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. Hint for how to order the results
+   * 
+ * + * 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; + } + } + + public static final int INTERVAL_FIELD_NUMBER = 6; + private com.google.type.Interval interval_; + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interval. + */ + @java.lang.Override + public com.google.type.Interval getInterval() { + return interval_ == null ? com.google.type.Interval.getDefaultInstance() : interval_; + } + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getIntervalOrBuilder() { + return interval_ == null ? com.google.type.Interval.getDefaultInstance() : interval_; + } + + 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_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getInterval()); + } + 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_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getInterval()); + } + 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.cloud.cloudcontrolspartner.v1.ListViolationsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest other = + (com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest) 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 (hasInterval() != other.hasInterval()) return false; + if (hasInterval()) { + if (!getInterval().equals(other.getInterval())) 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(); + if (hasInterval()) { + hash = (37 * hash) + INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getInterval().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest 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.cloud.cloudcontrolspartner.v1.ListViolationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest 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.cloud.cloudcontrolspartner.v1.ListViolationsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest 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.cloud.cloudcontrolspartner.v1.ListViolationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest 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.cloud.cloudcontrolspartner.v1.ListViolationsRequest 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 Violations
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListViolationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.ListViolationsRequest) + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIntervalFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + interval_ = null; + if (intervalBuilder_ != null) { + intervalBuilder_.dispose(); + intervalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest build() { + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest result = + new com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest 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_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.interval_ = intervalBuilder_ == null ? interval_ : intervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest.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(); + } + if (other.hasInterval()) { + mergeInterval(other.getInterval()); + } + 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 + case 50: + { + input.readMessage(getIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + 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 resource
+     * Format
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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 resource
+     * Format
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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 resource
+     * Format
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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 resource
+     * Format
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * 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 resource
+     * Format
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of customers row to return. The service may
+     * return fewer than this value. If unspecified, at most 10 customers will be
+     * returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of customers row to return. The service may
+     * return fewer than this value. If unspecified, at most 10 customers will be
+     * returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of customers row to return. The service may
+     * return fewer than this value. If unspecified, at most 10 customers will be
+     * returned.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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; + } + + private com.google.type.Interval interval_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + intervalBuilder_; + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the interval field is set. + */ + public boolean hasInterval() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interval. + */ + public com.google.type.Interval getInterval() { + if (intervalBuilder_ == null) { + return interval_ == null ? com.google.type.Interval.getDefaultInstance() : interval_; + } else { + return intervalBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setInterval(com.google.type.Interval value) { + if (intervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + interval_ = value; + } else { + intervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setInterval(com.google.type.Interval.Builder builderForValue) { + if (intervalBuilder_ == null) { + interval_ = builderForValue.build(); + } else { + intervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeInterval(com.google.type.Interval value) { + if (intervalBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && interval_ != null + && interval_ != com.google.type.Interval.getDefaultInstance()) { + getIntervalBuilder().mergeFrom(value); + } else { + interval_ = value; + } + } else { + intervalBuilder_.mergeFrom(value); + } + if (interval_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearInterval() { + bitField0_ = (bitField0_ & ~0x00000020); + interval_ = null; + if (intervalBuilder_ != null) { + intervalBuilder_.dispose(); + intervalBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.type.Interval.Builder getIntervalBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.type.IntervalOrBuilder getIntervalOrBuilder() { + if (intervalBuilder_ != null) { + return intervalBuilder_.getMessageOrBuilder(); + } else { + return interval_ == null ? com.google.type.Interval.getDefaultInstance() : interval_; + } + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + getIntervalFieldBuilder() { + if (intervalBuilder_ == null) { + intervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder>( + getInterval(), getParentForChildren(), isClean()); + interval_ = null; + } + return intervalBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1.ListViolationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.ListViolationsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListViolationsRequest 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.cloud.cloudcontrolspartner.v1.ListViolationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsRequestOrBuilder.java new file mode 100644 index 000000000000..7a57f7c7ee5d --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsRequestOrBuilder.java @@ -0,0 +1,189 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ListViolationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.ListViolationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource
+   * Format
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource
+   * Format
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of customers row to return. The service may
+   * return fewer than this value. If unspecified, at most 10 customers will be
+   * returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListViolations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListViolations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the interval field is set. + */ + boolean hasInterval(); + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interval. + */ + com.google.type.Interval getInterval(); + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.type.IntervalOrBuilder getIntervalOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsResponse.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsResponse.java new file mode 100644 index 000000000000..e89b1e2e17b1 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsResponse.java @@ -0,0 +1,1434 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Response message for list customer violation requests
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListViolationsResponse} + */ +public final class ListViolationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.ListViolationsResponse) + ListViolationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListViolationsResponse.newBuilder() to construct. + private ListViolationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListViolationsResponse() { + violations_ = 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 ListViolationsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse.class, + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse.Builder.class); + } + + public static final int VIOLATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List violations_; + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + @java.lang.Override + public java.util.List getViolationsList() { + return violations_; + } + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + @java.lang.Override + public java.util.List + getViolationsOrBuilderList() { + return violations_; + } + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + @java.lang.Override + public int getViolationsCount() { + return violations_.size(); + } + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation getViolations(int index) { + return violations_.get(index); + } + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ViolationOrBuilder getViolationsOrBuilder( + int index) { + return violations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that 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 that 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(); + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * 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); + } + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * 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 < violations_.size(); i++) { + output.writeMessage(1, violations_.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 < violations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, violations_.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.cloud.cloudcontrolspartner.v1.ListViolationsResponse)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse other = + (com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse) obj; + + if (!getViolationsList().equals(other.getViolationsList())) 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 (getViolationsCount() > 0) { + hash = (37 * hash) + VIOLATIONS_FIELD_NUMBER; + hash = (53 * hash) + getViolationsList().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.cloud.cloudcontrolspartner.v1.ListViolationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1.ListViolationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1.ListViolationsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1.ListViolationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1.ListViolationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for list customer violation requests
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListViolationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.ListViolationsResponse) + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse.class, + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + } else { + violations_ = null; + violationsBuilder_.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.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse build() { + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse result = + new com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse result) { + if (violationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + violations_ = java.util.Collections.unmodifiableList(violations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.violations_ = violations_; + } else { + result.violations_ = violationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1.ListViolationsResponse) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse.getDefaultInstance()) + return this; + if (violationsBuilder_ == null) { + if (!other.violations_.isEmpty()) { + if (violations_.isEmpty()) { + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureViolationsIsMutable(); + violations_.addAll(other.violations_); + } + onChanged(); + } + } else { + if (!other.violations_.isEmpty()) { + if (violationsBuilder_.isEmpty()) { + violationsBuilder_.dispose(); + violationsBuilder_ = null; + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + violationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getViolationsFieldBuilder() + : null; + } else { + violationsBuilder_.addAllMessages(other.violations_); + } + } + } + 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.cloud.cloudcontrolspartner.v1.Violation m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.Violation.parser(), + extensionRegistry); + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(m); + } else { + violationsBuilder_.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 violations_ = + java.util.Collections.emptyList(); + + private void ensureViolationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + violations_ = + new java.util.ArrayList( + violations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation, + com.google.cloud.cloudcontrolspartner.v1.Violation.Builder, + com.google.cloud.cloudcontrolspartner.v1.ViolationOrBuilder> + violationsBuilder_; + + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public java.util.List getViolationsList() { + if (violationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(violations_); + } else { + return violationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public int getViolationsCount() { + if (violationsBuilder_ == null) { + return violations_.size(); + } else { + return violationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation getViolations(int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); + } else { + return violationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.cloud.cloudcontrolspartner.v1.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.set(index, value); + onChanged(); + } else { + violationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.cloud.cloudcontrolspartner.v1.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.set(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder addViolations(com.google.cloud.cloudcontrolspartner.v1.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(value); + onChanged(); + } else { + violationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.cloud.cloudcontrolspartner.v1.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(index, value); + onChanged(); + } else { + violationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder addViolations( + com.google.cloud.cloudcontrolspartner.v1.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.cloud.cloudcontrolspartner.v1.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder addAllViolations( + java.lang.Iterable values) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, violations_); + onChanged(); + } else { + violationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder clearViolations() { + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + violationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public Builder removeViolations(int index) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.remove(index); + onChanged(); + } else { + violationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Builder getViolationsBuilder( + int index) { + return getViolationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.ViolationOrBuilder getViolationsOrBuilder( + int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); + } else { + return violationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public java.util.List + getViolationsOrBuilderList() { + if (violationsBuilder_ != null) { + return violationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(violations_); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Builder addViolationsBuilder() { + return getViolationsFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1.Violation.getDefaultInstance()); + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Builder addViolationsBuilder( + int index) { + return getViolationsFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1.Violation.getDefaultInstance()); + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + public java.util.List + getViolationsBuilderList() { + return getViolationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation, + com.google.cloud.cloudcontrolspartner.v1.Violation.Builder, + com.google.cloud.cloudcontrolspartner.v1.ViolationOrBuilder> + getViolationsFieldBuilder() { + if (violationsBuilder_ == null) { + violationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation, + com.google.cloud.cloudcontrolspartner.v1.Violation.Builder, + com.google.cloud.cloudcontrolspartner.v1.ViolationOrBuilder>( + violations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + violations_ = null; + } + return violationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that 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 that 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 that 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 that 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 that 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; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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); + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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); + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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.cloud.cloudcontrolspartner.v1.ListViolationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.ListViolationsResponse) + private static final com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListViolationsResponse 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.cloud.cloudcontrolspartner.v1.ListViolationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsResponseOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsResponseOrBuilder.java new file mode 100644 index 000000000000..626ec607f738 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListViolationsResponseOrBuilder.java @@ -0,0 +1,160 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ListViolationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.ListViolationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + java.util.List getViolationsList(); + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + com.google.cloud.cloudcontrolspartner.v1.Violation getViolations(int index); + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + int getViolationsCount(); + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + java.util.List + getViolationsOrBuilderList(); + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Violation violations = 1; + */ + com.google.cloud.cloudcontrolspartner.v1.ViolationOrBuilder getViolationsOrBuilder(int index); + + /** + * + * + *
+   * A token that 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 that 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(); + + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * 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); + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsRequest.java new file mode 100644 index 000000000000..394a3c83adb8 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsRequest.java @@ -0,0 +1,1308 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Request to list customer workloads.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest} + */ +public final class ListWorkloadsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) + ListWorkloadsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkloadsRequest.newBuilder() to construct. + private ListWorkloadsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkloadsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkloadsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * + * 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 resource
+   * Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * + * 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; + /** + * + * + *
+   * The maximum number of workloads to return. The service may return fewer
+   * than this value. If unspecified, at most 500 workloads will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListWorkloads` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListWorkloads` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * 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. Filtering results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest other = + (com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request to list customer workloads.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest.class, + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest.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.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest build() { + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest result = + new com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest.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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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 resource
+     * Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}`
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * The maximum number of workloads to return. The service may return fewer
+     * than this value. If unspecified, at most 500 workloads will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of workloads to return. The service may return fewer
+     * than this value. If unspecified, at most 500 workloads will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of workloads to return. The service may return fewer
+     * than this value. If unspecified, at most 500 workloads will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsRequestOrBuilder.java new file mode 100644 index 000000000000..16926efca3af --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsRequestOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ListWorkloadsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of workloads to return. The service may return fewer
+   * than this value. If unspecified, at most 500 workloads will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListWorkloads` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListWorkloads` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsResponse.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsResponse.java new file mode 100644 index 000000000000..9bb12211d21b --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsResponse.java @@ -0,0 +1,1419 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Response message for list customer workloads requests.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse} + */ +public final class ListWorkloadsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse) + ListWorkloadsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkloadsResponse.newBuilder() to construct. + private ListWorkloadsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkloadsResponse() { + workloads_ = 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 ListWorkloadsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse.class, + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse.Builder.class); + } + + public static final int WORKLOADS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List workloads_; + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + @java.lang.Override + public java.util.List getWorkloadsList() { + return workloads_; + } + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + @java.lang.Override + public java.util.List + getWorkloadsOrBuilderList() { + return workloads_; + } + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + @java.lang.Override + public int getWorkloadsCount() { + return workloads_.size(); + } + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Workload getWorkloads(int index) { + return workloads_.get(index); + } + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOrBuilder getWorkloadsOrBuilder( + int index) { + return workloads_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that 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 that 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 < workloads_.size(); i++) { + output.writeMessage(1, workloads_.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 < workloads_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, workloads_.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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse other = + (com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse) obj; + + if (!getWorkloadsList().equals(other.getWorkloadsList())) 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 (getWorkloadsCount() > 0) { + hash = (37 * hash) + WORKLOADS_FIELD_NUMBER; + hash = (53 * hash) + getWorkloadsList().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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for list customer workloads requests.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse) + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse.class, + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (workloadsBuilder_ == null) { + workloads_ = java.util.Collections.emptyList(); + } else { + workloads_ = null; + workloadsBuilder_.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.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse build() { + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse result = + new com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse result) { + if (workloadsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workloads_ = java.util.Collections.unmodifiableList(workloads_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workloads_ = workloads_; + } else { + result.workloads_ = workloadsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse.getDefaultInstance()) + return this; + if (workloadsBuilder_ == null) { + if (!other.workloads_.isEmpty()) { + if (workloads_.isEmpty()) { + workloads_ = other.workloads_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkloadsIsMutable(); + workloads_.addAll(other.workloads_); + } + onChanged(); + } + } else { + if (!other.workloads_.isEmpty()) { + if (workloadsBuilder_.isEmpty()) { + workloadsBuilder_.dispose(); + workloadsBuilder_ = null; + workloads_ = other.workloads_; + bitField0_ = (bitField0_ & ~0x00000001); + workloadsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkloadsFieldBuilder() + : null; + } else { + workloadsBuilder_.addAllMessages(other.workloads_); + } + } + } + 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.cloud.cloudcontrolspartner.v1.Workload m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.Workload.parser(), + extensionRegistry); + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(m); + } else { + workloadsBuilder_.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 workloads_ = + java.util.Collections.emptyList(); + + private void ensureWorkloadsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workloads_ = + new java.util.ArrayList(workloads_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Workload, + com.google.cloud.cloudcontrolspartner.v1.Workload.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOrBuilder> + workloadsBuilder_; + + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public java.util.List getWorkloadsList() { + if (workloadsBuilder_ == null) { + return java.util.Collections.unmodifiableList(workloads_); + } else { + return workloadsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public int getWorkloadsCount() { + if (workloadsBuilder_ == null) { + return workloads_.size(); + } else { + return workloadsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Workload getWorkloads(int index) { + if (workloadsBuilder_ == null) { + return workloads_.get(index); + } else { + return workloadsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder setWorkloads( + int index, com.google.cloud.cloudcontrolspartner.v1.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.set(index, value); + onChanged(); + } else { + workloadsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder setWorkloads( + int index, com.google.cloud.cloudcontrolspartner.v1.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.set(index, builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder addWorkloads(com.google.cloud.cloudcontrolspartner.v1.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.add(value); + onChanged(); + } else { + workloadsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder addWorkloads( + int index, com.google.cloud.cloudcontrolspartner.v1.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.add(index, value); + onChanged(); + } else { + workloadsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder addWorkloads( + com.google.cloud.cloudcontrolspartner.v1.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder addWorkloads( + int index, com.google.cloud.cloudcontrolspartner.v1.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(index, builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder addAllWorkloads( + java.lang.Iterable values) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workloads_); + onChanged(); + } else { + workloadsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder clearWorkloads() { + if (workloadsBuilder_ == null) { + workloads_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workloadsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public Builder removeWorkloads(int index) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.remove(index); + onChanged(); + } else { + workloadsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Workload.Builder getWorkloadsBuilder( + int index) { + return getWorkloadsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOrBuilder getWorkloadsOrBuilder( + int index) { + if (workloadsBuilder_ == null) { + return workloads_.get(index); + } else { + return workloadsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public java.util.List + getWorkloadsOrBuilderList() { + if (workloadsBuilder_ != null) { + return workloadsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workloads_); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Workload.Builder addWorkloadsBuilder() { + return getWorkloadsFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1.Workload.getDefaultInstance()); + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1.Workload.Builder addWorkloadsBuilder( + int index) { + return getWorkloadsFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1.Workload.getDefaultInstance()); + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + public java.util.List + getWorkloadsBuilderList() { + return getWorkloadsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Workload, + com.google.cloud.cloudcontrolspartner.v1.Workload.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOrBuilder> + getWorkloadsFieldBuilder() { + if (workloadsBuilder_ == null) { + workloadsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Workload, + com.google.cloud.cloudcontrolspartner.v1.Workload.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOrBuilder>( + workloads_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + workloads_ = null; + } + return workloadsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that 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 that 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 that 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 that 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 that 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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse) + private static final com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsResponseOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsResponseOrBuilder.java new file mode 100644 index 000000000000..e155e096db6b --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ListWorkloadsResponseOrBuilder.java @@ -0,0 +1,156 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ListWorkloadsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + java.util.List getWorkloadsList(); + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + com.google.cloud.cloudcontrolspartner.v1.Workload getWorkloads(int index); + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + int getWorkloadsCount(); + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + java.util.List + getWorkloadsOrBuilderList(); + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Workload workloads = 1; + */ + com.google.cloud.cloudcontrolspartner.v1.WorkloadOrBuilder getWorkloadsOrBuilder(int index); + + /** + * + * + *
+   * A token that 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 that 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/MonitoringProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/MonitoringProto.java new file mode 100644 index 000000000000..c623136b717c --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/MonitoringProto.java @@ -0,0 +1,89 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/monitoring.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class MonitoringProto { + private MonitoringProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/cloudcontrolspartner/v1/m" + + "onitoring.proto\022$google.cloud.cloudcontr" + + "olspartner.v1\032\034google/api/annotations.pr" + + "oto\032\027google/api/client.proto\0325google/clo" + + "ud/cloudcontrolspartner/v1/violations.pr" + + "oto2\276\004\n\036CloudControlsPartnerMonitoring\022\351" + + "\001\n\016ListViolations\022;.google.cloud.cloudco" + + "ntrolspartner.v1.ListViolationsRequest\032<" + + ".google.cloud.cloudcontrolspartner.v1.Li" + + "stViolationsResponse\"\\\332A\006parent\202\323\344\223\002M\022K/" + + "v1/{parent=organizations/*/locations/*/c" + + "ustomers/*/workloads/*}/violations\022\326\001\n\014G" + + "etViolation\0229.google.cloud.cloudcontrols" + + "partner.v1.GetViolationRequest\032/.google." + + "cloud.cloudcontrolspartner.v1.Violation\"" + + "Z\332A\004name\202\323\344\223\002M\022K/v1/{name=organizations/" + + "*/locations/*/customers/*/workloads/*/vi" + + "olations/*}\032W\312A#cloudcontrolspartner.goo" + + "gleapis.com\322A.https://www.googleapis.com" + + "/auth/cloud-platformB\223\002\n(com.google.clou" + + "d.cloudcontrolspartner.v1B\017MonitoringPro" + + "toP\001Z\\cloud.google.com/go/cloudcontrolsp" + + "artner/apiv1/cloudcontrolspartnerpb;clou" + + "dcontrolspartnerpb\252\002$Google.Cloud.CloudC" + + "ontrolsPartner.V1\312\002$Google\\Cloud\\CloudCo" + + "ntrolsPartner\\V1\352\002\'Google::Cloud::CloudC" + + "ontrolsPartner::V1b\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.cloud.cloudcontrolspartner.v1.ViolationsProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1.ViolationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OperationMetadata.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OperationMetadata.java new file mode 100644 index 000000000000..275dfdda2613 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OperationMetadata.java @@ -0,0 +1,1849 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/core.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.OperationMetadata.class, + com.google.cloud.cloudcontrolspartner.v1.OperationMetadata.Builder.class); + } + + private int bitField0_; + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have been cancelled successfully
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + 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.cloud.cloudcontrolspartner.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.OperationMetadata other = + (com.google.cloud.cloudcontrolspartner.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata 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.cloud.cloudcontrolspartner.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata 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.cloud.cloudcontrolspartner.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata 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.cloud.cloudcontrolspartner.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata 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.cloud.cloudcontrolspartner.v1.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.OperationMetadata) + com.google.cloud.cloudcontrolspartner.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.OperationMetadata.class, + com.google.cloud.cloudcontrolspartner.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.OperationMetadata build() { + com.google.cloud.cloudcontrolspartner.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.OperationMetadata buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.OperationMetadata result = + new com.google.cloud.cloudcontrolspartner.v1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.OperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.OperationMetadata other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + 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(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + 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.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000040; + 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.cloud.cloudcontrolspartner.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.OperationMetadata) + private static final com.google.cloud.cloudcontrolspartner.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.OperationMetadata(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata 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.cloud.cloudcontrolspartner.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OperationMetadataOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..c1d52aa50fdc --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,219 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/core.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have been cancelled successfully
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OrganizationLocationName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OrganizationLocationName.java new file mode 100644 index 000000000000..8d0c44c64837 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/OrganizationLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class OrganizationLocationName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + + @Deprecated + protected OrganizationLocationName() { + organization = null; + location = null; + } + + private OrganizationLocationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationLocationName of(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build(); + } + + public static String format(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build().toString(); + } + + public static OrganizationLocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION.validatedMatch( + formattedString, "OrganizationLocationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location")); + } + + 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 (OrganizationLocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION.instantiate("organization", organization, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationLocationName that = ((OrganizationLocationName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}. */ + public static class Builder { + private String organization; + private String location; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(OrganizationLocationName organizationLocationName) { + this.organization = organizationLocationName.organization; + this.location = organizationLocationName.location; + } + + public OrganizationLocationName build() { + return new OrganizationLocationName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Partner.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Partner.java new file mode 100644 index 000000000000..d93535b4573c --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Partner.java @@ -0,0 +1,2709 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Message describing Partner resource
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Partner} + */ +public final class Partner extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Partner) + PartnerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Partner.newBuilder() to construct. + private Partner(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Partner() { + name_ = ""; + skus_ = java.util.Collections.emptyList(); + ekmSolutions_ = java.util.Collections.emptyList(); + operatedCloudRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + partnerProjectId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Partner(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Partner_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Partner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Partner.class, + com.google.cloud.cloudcontrolspartner.v1.Partner.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The resource name of the partner.
+   * Format: `organizations/{organization}/locations/{location}/partner`
+   * Example: "organizations/123456/locations/us-central1/partner"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. The resource name of the partner.
+   * Format: `organizations/{organization}/locations/{location}/partner`
+   * Example: "organizations/123456/locations/us-central1/partner"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SKUS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List skus_; + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + @java.lang.Override + public java.util.List getSkusList() { + return skus_; + } + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + @java.lang.Override + public java.util.List + getSkusOrBuilderList() { + return skus_; + } + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + @java.lang.Override + public int getSkusCount() { + return skus_.size(); + } + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Sku getSkus(int index) { + return skus_.get(index); + } + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.SkuOrBuilder getSkusOrBuilder(int index) { + return skus_.get(index); + } + + public static final int EKM_SOLUTIONS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List ekmSolutions_; + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public java.util.List + getEkmSolutionsList() { + return ekmSolutions_; + } + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public java.util.List + getEkmSolutionsOrBuilderList() { + return ekmSolutions_; + } + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public int getEkmSolutionsCount() { + return ekmSolutions_.size(); + } + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata getEkmSolutions(int index) { + return ekmSolutions_.get(index); + } + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadataOrBuilder getEkmSolutionsOrBuilder( + int index) { + return ekmSolutions_.get(index); + } + + public static final int OPERATED_CLOUD_REGIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList operatedCloudRegions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return A list containing the operatedCloudRegions. + */ + public com.google.protobuf.ProtocolStringList getOperatedCloudRegionsList() { + return operatedCloudRegions_; + } + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return The count of operatedCloudRegions. + */ + public int getOperatedCloudRegionsCount() { + return operatedCloudRegions_.size(); + } + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the element to return. + * @return The operatedCloudRegions at the given index. + */ + public java.lang.String getOperatedCloudRegions(int index) { + return operatedCloudRegions_.get(index); + } + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the value to return. + * @return The bytes of the operatedCloudRegions at the given index. + */ + public com.google.protobuf.ByteString getOperatedCloudRegionsBytes(int index) { + return operatedCloudRegions_.getByteString(index); + } + + public static final int PARTNER_PROJECT_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object partnerProjectId_ = ""; + /** + * + * + *
+   * Google Cloud project ID in the partner's Google Cloud organization for
+   * receiving enhanced Logs for Partners.
+   * 
+ * + * string partner_project_id = 7; + * + * @return The partnerProjectId. + */ + @java.lang.Override + public java.lang.String getPartnerProjectId() { + java.lang.Object ref = partnerProjectId_; + 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(); + partnerProjectId_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud project ID in the partner's Google Cloud organization for
+   * receiving enhanced Logs for Partners.
+   * 
+ * + * string partner_project_id = 7; + * + * @return The bytes for partnerProjectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPartnerProjectIdBytes() { + java.lang.Object ref = partnerProjectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + partnerProjectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.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. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.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 = 10; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.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. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + 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_); + } + for (int i = 0; i < skus_.size(); i++) { + output.writeMessage(3, skus_.get(i)); + } + for (int i = 0; i < ekmSolutions_.size(); i++) { + output.writeMessage(4, ekmSolutions_.get(i)); + } + for (int i = 0; i < operatedCloudRegions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 5, operatedCloudRegions_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partnerProjectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, partnerProjectId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(9, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getUpdateTime()); + } + 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 (int i = 0; i < skus_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, skus_.get(i)); + } + for (int i = 0; i < ekmSolutions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, ekmSolutions_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < operatedCloudRegions_.size(); i++) { + dataSize += computeStringSizeNoTag(operatedCloudRegions_.getRaw(i)); + } + size += dataSize; + size += 1 * getOperatedCloudRegionsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partnerProjectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, partnerProjectId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getUpdateTime()); + } + 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.cloud.cloudcontrolspartner.v1.Partner)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Partner other = + (com.google.cloud.cloudcontrolspartner.v1.Partner) obj; + + if (!getName().equals(other.getName())) return false; + if (!getSkusList().equals(other.getSkusList())) return false; + if (!getEkmSolutionsList().equals(other.getEkmSolutionsList())) return false; + if (!getOperatedCloudRegionsList().equals(other.getOperatedCloudRegionsList())) return false; + if (!getPartnerProjectId().equals(other.getPartnerProjectId())) 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 (!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 (getSkusCount() > 0) { + hash = (37 * hash) + SKUS_FIELD_NUMBER; + hash = (53 * hash) + getSkusList().hashCode(); + } + if (getEkmSolutionsCount() > 0) { + hash = (37 * hash) + EKM_SOLUTIONS_FIELD_NUMBER; + hash = (53 * hash) + getEkmSolutionsList().hashCode(); + } + if (getOperatedCloudRegionsCount() > 0) { + hash = (37 * hash) + OPERATED_CLOUD_REGIONS_FIELD_NUMBER; + hash = (53 * hash) + getOperatedCloudRegionsList().hashCode(); + } + hash = (37 * hash) + PARTNER_PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getPartnerProjectId().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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner 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.cloud.cloudcontrolspartner.v1.Partner parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner 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.cloud.cloudcontrolspartner.v1.Partner parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner 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.cloud.cloudcontrolspartner.v1.Partner parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner 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.cloud.cloudcontrolspartner.v1.Partner 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 describing Partner resource
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Partner} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Partner) + com.google.cloud.cloudcontrolspartner.v1.PartnerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Partner_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Partner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Partner.class, + com.google.cloud.cloudcontrolspartner.v1.Partner.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.Partner.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSkusFieldBuilder(); + getEkmSolutionsFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (skusBuilder_ == null) { + skus_ = java.util.Collections.emptyList(); + } else { + skus_ = null; + skusBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (ekmSolutionsBuilder_ == null) { + ekmSolutions_ = java.util.Collections.emptyList(); + } else { + ekmSolutions_ = null; + ekmSolutionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + operatedCloudRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + partnerProjectId_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Partner_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Partner getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Partner.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Partner build() { + com.google.cloud.cloudcontrolspartner.v1.Partner result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Partner buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Partner result = + new com.google.cloud.cloudcontrolspartner.v1.Partner(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.Partner result) { + if (skusBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + skus_ = java.util.Collections.unmodifiableList(skus_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.skus_ = skus_; + } else { + result.skus_ = skusBuilder_.build(); + } + if (ekmSolutionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + ekmSolutions_ = java.util.Collections.unmodifiableList(ekmSolutions_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.ekmSolutions_ = ekmSolutions_; + } else { + result.ekmSolutions_ = ekmSolutionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.Partner result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + operatedCloudRegions_.makeImmutable(); + result.operatedCloudRegions_ = operatedCloudRegions_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.partnerProjectId_ = partnerProjectId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.Partner) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.Partner) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.Partner other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.Partner.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (skusBuilder_ == null) { + if (!other.skus_.isEmpty()) { + if (skus_.isEmpty()) { + skus_ = other.skus_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSkusIsMutable(); + skus_.addAll(other.skus_); + } + onChanged(); + } + } else { + if (!other.skus_.isEmpty()) { + if (skusBuilder_.isEmpty()) { + skusBuilder_.dispose(); + skusBuilder_ = null; + skus_ = other.skus_; + bitField0_ = (bitField0_ & ~0x00000002); + skusBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSkusFieldBuilder() + : null; + } else { + skusBuilder_.addAllMessages(other.skus_); + } + } + } + if (ekmSolutionsBuilder_ == null) { + if (!other.ekmSolutions_.isEmpty()) { + if (ekmSolutions_.isEmpty()) { + ekmSolutions_ = other.ekmSolutions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.addAll(other.ekmSolutions_); + } + onChanged(); + } + } else { + if (!other.ekmSolutions_.isEmpty()) { + if (ekmSolutionsBuilder_.isEmpty()) { + ekmSolutionsBuilder_.dispose(); + ekmSolutionsBuilder_ = null; + ekmSolutions_ = other.ekmSolutions_; + bitField0_ = (bitField0_ & ~0x00000004); + ekmSolutionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEkmSolutionsFieldBuilder() + : null; + } else { + ekmSolutionsBuilder_.addAllMessages(other.ekmSolutions_); + } + } + } + if (!other.operatedCloudRegions_.isEmpty()) { + if (operatedCloudRegions_.isEmpty()) { + operatedCloudRegions_ = other.operatedCloudRegions_; + bitField0_ |= 0x00000008; + } else { + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.addAll(other.operatedCloudRegions_); + } + onChanged(); + } + if (!other.getPartnerProjectId().isEmpty()) { + partnerProjectId_ = other.partnerProjectId_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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 26: + { + com.google.cloud.cloudcontrolspartner.v1.Sku m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.Sku.parser(), extensionRegistry); + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.add(m); + } else { + skusBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.parser(), + extensionRegistry); + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(m); + } else { + ekmSolutionsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.add(s); + break; + } // case 42 + case 58: + { + partnerProjectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 58 + case 74: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 74 + case 82: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: `organizations/{organization}/locations/{location}/partner`
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: `organizations/{organization}/locations/{location}/partner`
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: `organizations/{organization}/locations/{location}/partner`
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: `organizations/{organization}/locations/{location}/partner`
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: `organizations/{organization}/locations/{location}/partner`
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List skus_ = + java.util.Collections.emptyList(); + + private void ensureSkusIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + skus_ = new java.util.ArrayList(skus_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Sku, + com.google.cloud.cloudcontrolspartner.v1.Sku.Builder, + com.google.cloud.cloudcontrolspartner.v1.SkuOrBuilder> + skusBuilder_; + + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public java.util.List getSkusList() { + if (skusBuilder_ == null) { + return java.util.Collections.unmodifiableList(skus_); + } else { + return skusBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public int getSkusCount() { + if (skusBuilder_ == null) { + return skus_.size(); + } else { + return skusBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1.Sku getSkus(int index) { + if (skusBuilder_ == null) { + return skus_.get(index); + } else { + return skusBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder setSkus(int index, com.google.cloud.cloudcontrolspartner.v1.Sku value) { + if (skusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkusIsMutable(); + skus_.set(index, value); + onChanged(); + } else { + skusBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder setSkus( + int index, com.google.cloud.cloudcontrolspartner.v1.Sku.Builder builderForValue) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.set(index, builderForValue.build()); + onChanged(); + } else { + skusBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder addSkus(com.google.cloud.cloudcontrolspartner.v1.Sku value) { + if (skusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkusIsMutable(); + skus_.add(value); + onChanged(); + } else { + skusBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder addSkus(int index, com.google.cloud.cloudcontrolspartner.v1.Sku value) { + if (skusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkusIsMutable(); + skus_.add(index, value); + onChanged(); + } else { + skusBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder addSkus(com.google.cloud.cloudcontrolspartner.v1.Sku.Builder builderForValue) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.add(builderForValue.build()); + onChanged(); + } else { + skusBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder addSkus( + int index, com.google.cloud.cloudcontrolspartner.v1.Sku.Builder builderForValue) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.add(index, builderForValue.build()); + onChanged(); + } else { + skusBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder addAllSkus( + java.lang.Iterable values) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, skus_); + onChanged(); + } else { + skusBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder clearSkus() { + if (skusBuilder_ == null) { + skus_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + skusBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public Builder removeSkus(int index) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.remove(index); + onChanged(); + } else { + skusBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1.Sku.Builder getSkusBuilder(int index) { + return getSkusFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1.SkuOrBuilder getSkusOrBuilder(int index) { + if (skusBuilder_ == null) { + return skus_.get(index); + } else { + return skusBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public java.util.List + getSkusOrBuilderList() { + if (skusBuilder_ != null) { + return skusBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(skus_); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1.Sku.Builder addSkusBuilder() { + return getSkusFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1.Sku.getDefaultInstance()); + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1.Sku.Builder addSkusBuilder(int index) { + return getSkusFieldBuilder() + .addBuilder(index, com.google.cloud.cloudcontrolspartner.v1.Sku.getDefaultInstance()); + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + public java.util.List + getSkusBuilderList() { + return getSkusFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Sku, + com.google.cloud.cloudcontrolspartner.v1.Sku.Builder, + com.google.cloud.cloudcontrolspartner.v1.SkuOrBuilder> + getSkusFieldBuilder() { + if (skusBuilder_ == null) { + skusBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Sku, + com.google.cloud.cloudcontrolspartner.v1.Sku.Builder, + com.google.cloud.cloudcontrolspartner.v1.SkuOrBuilder>( + skus_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + skus_ = null; + } + return skusBuilder_; + } + + private java.util.List ekmSolutions_ = + java.util.Collections.emptyList(); + + private void ensureEkmSolutionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + ekmSolutions_ = + new java.util.ArrayList( + ekmSolutions_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata, + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmMetadataOrBuilder> + ekmSolutionsBuilder_; + + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public java.util.List + getEkmSolutionsList() { + if (ekmSolutionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(ekmSolutions_); + } else { + return ekmSolutionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public int getEkmSolutionsCount() { + if (ekmSolutionsBuilder_ == null) { + return ekmSolutions_.size(); + } else { + return ekmSolutionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata getEkmSolutions(int index) { + if (ekmSolutionsBuilder_ == null) { + return ekmSolutions_.get(index); + } else { + return ekmSolutionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder setEkmSolutions( + int index, com.google.cloud.cloudcontrolspartner.v1.EkmMetadata value) { + if (ekmSolutionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmSolutionsIsMutable(); + ekmSolutions_.set(index, value); + onChanged(); + } else { + ekmSolutionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder setEkmSolutions( + int index, com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder builderForValue) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.set(index, builderForValue.build()); + onChanged(); + } else { + ekmSolutionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder addEkmSolutions(com.google.cloud.cloudcontrolspartner.v1.EkmMetadata value) { + if (ekmSolutionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(value); + onChanged(); + } else { + ekmSolutionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder addEkmSolutions( + int index, com.google.cloud.cloudcontrolspartner.v1.EkmMetadata value) { + if (ekmSolutionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(index, value); + onChanged(); + } else { + ekmSolutionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder addEkmSolutions( + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder builderForValue) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(builderForValue.build()); + onChanged(); + } else { + ekmSolutionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder addEkmSolutions( + int index, com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder builderForValue) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(index, builderForValue.build()); + onChanged(); + } else { + ekmSolutionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder addAllEkmSolutions( + java.lang.Iterable values) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ekmSolutions_); + onChanged(); + } else { + ekmSolutionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder clearEkmSolutions() { + if (ekmSolutionsBuilder_ == null) { + ekmSolutions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + ekmSolutionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public Builder removeEkmSolutions(int index) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.remove(index); + onChanged(); + } else { + ekmSolutionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder getEkmSolutionsBuilder( + int index) { + return getEkmSolutionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadataOrBuilder getEkmSolutionsOrBuilder( + int index) { + if (ekmSolutionsBuilder_ == null) { + return ekmSolutions_.get(index); + } else { + return ekmSolutionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public java.util.List + getEkmSolutionsOrBuilderList() { + if (ekmSolutionsBuilder_ != null) { + return ekmSolutionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ekmSolutions_); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder addEkmSolutionsBuilder() { + return getEkmSolutionsFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.getDefaultInstance()); + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder addEkmSolutionsBuilder( + int index) { + return getEkmSolutionsFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.getDefaultInstance()); + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + public java.util.List + getEkmSolutionsBuilderList() { + return getEkmSolutionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata, + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmMetadataOrBuilder> + getEkmSolutionsFieldBuilder() { + if (ekmSolutionsBuilder_ == null) { + ekmSolutionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata, + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata.Builder, + com.google.cloud.cloudcontrolspartner.v1.EkmMetadataOrBuilder>( + ekmSolutions_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + ekmSolutions_ = null; + } + return ekmSolutionsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList operatedCloudRegions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureOperatedCloudRegionsIsMutable() { + if (!operatedCloudRegions_.isModifiable()) { + operatedCloudRegions_ = new com.google.protobuf.LazyStringArrayList(operatedCloudRegions_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return A list containing the operatedCloudRegions. + */ + public com.google.protobuf.ProtocolStringList getOperatedCloudRegionsList() { + operatedCloudRegions_.makeImmutable(); + return operatedCloudRegions_; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return The count of operatedCloudRegions. + */ + public int getOperatedCloudRegionsCount() { + return operatedCloudRegions_.size(); + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the element to return. + * @return The operatedCloudRegions at the given index. + */ + public java.lang.String getOperatedCloudRegions(int index) { + return operatedCloudRegions_.get(index); + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the value to return. + * @return The bytes of the operatedCloudRegions at the given index. + */ + public com.google.protobuf.ByteString getOperatedCloudRegionsBytes(int index) { + return operatedCloudRegions_.getByteString(index); + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index to set the value at. + * @param value The operatedCloudRegions to set. + * @return This builder for chaining. + */ + public Builder setOperatedCloudRegions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param value The operatedCloudRegions to add. + * @return This builder for chaining. + */ + public Builder addOperatedCloudRegions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param values The operatedCloudRegions to add. + * @return This builder for chaining. + */ + public Builder addAllOperatedCloudRegions(java.lang.Iterable values) { + ensureOperatedCloudRegionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, operatedCloudRegions_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return This builder for chaining. + */ + public Builder clearOperatedCloudRegions() { + operatedCloudRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param value The bytes of the operatedCloudRegions to add. + * @return This builder for chaining. + */ + public Builder addOperatedCloudRegionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object partnerProjectId_ = ""; + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @return The partnerProjectId. + */ + public java.lang.String getPartnerProjectId() { + java.lang.Object ref = partnerProjectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + partnerProjectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @return The bytes for partnerProjectId. + */ + public com.google.protobuf.ByteString getPartnerProjectIdBytes() { + java.lang.Object ref = partnerProjectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + partnerProjectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @param value The partnerProjectId to set. + * @return This builder for chaining. + */ + public Builder setPartnerProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + partnerProjectId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearPartnerProjectId() { + partnerProjectId_ = getDefaultInstance().getPartnerProjectId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @param value The bytes for partnerProjectId to set. + * @return This builder for chaining. + */ + public Builder setPartnerProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + partnerProjectId_ = value; + bitField0_ |= 0x00000010; + 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. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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_; + } + + @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.cloud.cloudcontrolspartner.v1.Partner) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Partner) + private static final com.google.cloud.cloudcontrolspartner.v1.Partner DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.Partner(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Partner getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Partner 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.cloud.cloudcontrolspartner.v1.Partner getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerName.java new file mode 100644 index 000000000000..6cc57e60f062 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerName.java @@ -0,0 +1,193 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PartnerName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/partner"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + + @Deprecated + protected PartnerName() { + organization = null; + location = null; + } + + private PartnerName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PartnerName of(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build(); + } + + public static String format(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build().toString(); + } + + public static PartnerName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION.validatedMatch( + formattedString, "PartnerName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location")); + } + + 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 (PartnerName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION.instantiate("organization", organization, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PartnerName that = ((PartnerName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}/partner. */ + public static class Builder { + private String organization; + private String location; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(PartnerName partnerName) { + this.organization = partnerName.organization; + this.location = partnerName.location; + } + + public PartnerName build() { + return new PartnerName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerOrBuilder.java new file mode 100644 index 000000000000..73a7c50b3a8d --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerOrBuilder.java @@ -0,0 +1,321 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface PartnerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Partner) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The resource name of the partner.
+   * Format: `organizations/{organization}/locations/{location}/partner`
+   * Example: "organizations/123456/locations/us-central1/partner"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The resource name of the partner.
+   * Format: `organizations/{organization}/locations/{location}/partner`
+   * Example: "organizations/123456/locations/us-central1/partner"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + java.util.List getSkusList(); + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + com.google.cloud.cloudcontrolspartner.v1.Sku getSkus(int index); + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + int getSkusCount(); + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + java.util.List + getSkusOrBuilderList(); + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.Sku skus = 3; + */ + com.google.cloud.cloudcontrolspartner.v1.SkuOrBuilder getSkusOrBuilder(int index); + + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + java.util.List getEkmSolutionsList(); + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + com.google.cloud.cloudcontrolspartner.v1.EkmMetadata getEkmSolutions(int index); + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + int getEkmSolutionsCount(); + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + java.util.List + getEkmSolutionsOrBuilderList(); + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1.EkmMetadata ekm_solutions = 4; + */ + com.google.cloud.cloudcontrolspartner.v1.EkmMetadataOrBuilder getEkmSolutionsOrBuilder(int index); + + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return A list containing the operatedCloudRegions. + */ + java.util.List getOperatedCloudRegionsList(); + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return The count of operatedCloudRegions. + */ + int getOperatedCloudRegionsCount(); + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the element to return. + * @return The operatedCloudRegions at the given index. + */ + java.lang.String getOperatedCloudRegions(int index); + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the value to return. + * @return The bytes of the operatedCloudRegions at the given index. + */ + com.google.protobuf.ByteString getOperatedCloudRegionsBytes(int index); + + /** + * + * + *
+   * Google Cloud project ID in the partner's Google Cloud organization for
+   * receiving enhanced Logs for Partners.
+   * 
+ * + * string partner_project_id = 7; + * + * @return The partnerProjectId. + */ + java.lang.String getPartnerProjectId(); + /** + * + * + *
+   * Google Cloud project ID in the partner's Google Cloud organization for
+   * receiving enhanced Logs for Partners.
+   * 
+ * + * string partner_project_id = 7; + * + * @return The bytes for partnerProjectId. + */ + com.google.protobuf.ByteString getPartnerProjectIdBytes(); + + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissions.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissions.java new file mode 100644 index 000000000000..df4553e07c6a --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissions.java @@ -0,0 +1,1265 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * The permissions granted to the partner for a workload
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.PartnerPermissions} + */ +public final class PartnerPermissions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.PartnerPermissions) + PartnerPermissionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use PartnerPermissions.newBuilder() to construct. + private PartnerPermissions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PartnerPermissions() { + name_ = ""; + partnerPermissions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PartnerPermissions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.class, + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Builder.class); + } + + /** Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission} */ + public enum Permission implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified partner permission
+     * 
+ * + * PERMISSION_UNSPECIFIED = 0; + */ + PERMISSION_UNSPECIFIED(0), + /** + * + * + *
+     * Permission for Access Transparency and emergency logs
+     * 
+ * + * ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS = 1; + */ + ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS(1), + /** + * + * + *
+     * Permission for Assured Workloads monitoring violations
+     * 
+ * + * ASSURED_WORKLOADS_MONITORING = 2; + */ + ASSURED_WORKLOADS_MONITORING(2), + /** + * + * + *
+     * Permission for Access Approval requests
+     * 
+ * + * ACCESS_APPROVAL_REQUESTS = 3; + */ + ACCESS_APPROVAL_REQUESTS(3), + /** + * + * + *
+     * Permission for External Key Manager connection status
+     * 
+ * + * ASSURED_WORKLOADS_EKM_CONNECTION_STATUS = 4; + */ + ASSURED_WORKLOADS_EKM_CONNECTION_STATUS(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified partner permission
+     * 
+ * + * PERMISSION_UNSPECIFIED = 0; + */ + public static final int PERMISSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Permission for Access Transparency and emergency logs
+     * 
+ * + * ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS = 1; + */ + public static final int ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS_VALUE = 1; + /** + * + * + *
+     * Permission for Assured Workloads monitoring violations
+     * 
+ * + * ASSURED_WORKLOADS_MONITORING = 2; + */ + public static final int ASSURED_WORKLOADS_MONITORING_VALUE = 2; + /** + * + * + *
+     * Permission for Access Approval requests
+     * 
+ * + * ACCESS_APPROVAL_REQUESTS = 3; + */ + public static final int ACCESS_APPROVAL_REQUESTS_VALUE = 3; + /** + * + * + *
+     * Permission for External Key Manager connection status
+     * 
+ * + * ASSURED_WORKLOADS_EKM_CONNECTION_STATUS = 4; + */ + public static final int ASSURED_WORKLOADS_EKM_CONNECTION_STATUS_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Permission 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 Permission forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_UNSPECIFIED; + case 1: + return ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS; + case 2: + return ASSURED_WORKLOADS_MONITORING; + case 3: + return ACCESS_APPROVAL_REQUESTS; + case 4: + return ASSURED_WORKLOADS_EKM_CONNECTION_STATUS; + 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 Permission findValueByNumber(int number) { + return Permission.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.cloud.cloudcontrolspartner.v1.PartnerPermissions.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Permission[] VALUES = values(); + + public static Permission 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 Permission(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTNER_PERMISSIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List partnerPermissions_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission> + partnerPermissions_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission>() { + public com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission convert( + java.lang.Integer from) { + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission result = + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission.forNumber( + from); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission + .UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the partnerPermissions. + */ + @java.lang.Override + public java.util.List + getPartnerPermissionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission>( + partnerPermissions_, partnerPermissions_converter_); + } + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return The count of partnerPermissions. + */ + @java.lang.Override + public int getPartnerPermissionsCount() { + return partnerPermissions_.size(); + } + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the element to return. + * @return The partnerPermissions at the given index. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission + getPartnerPermissions(int index) { + return partnerPermissions_converter_.convert(partnerPermissions_.get(index)); + } + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the enum numeric values on the wire for partnerPermissions. + */ + @java.lang.Override + public java.util.List getPartnerPermissionsValueList() { + return partnerPermissions_; + } + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of partnerPermissions at the given index. + */ + @java.lang.Override + public int getPartnerPermissionsValue(int index) { + return partnerPermissions_.get(index); + } + + private int partnerPermissionsMemoizedSerializedSize; + + 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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (getPartnerPermissionsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(partnerPermissionsMemoizedSerializedSize); + } + for (int i = 0; i < partnerPermissions_.size(); i++) { + output.writeEnumNoTag(partnerPermissions_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < partnerPermissions_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(partnerPermissions_.get(i)); + } + size += dataSize; + if (!getPartnerPermissionsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + partnerPermissionsMemoizedSerializedSize = 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.cloud.cloudcontrolspartner.v1.PartnerPermissions)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions other = + (com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions) obj; + + if (!getName().equals(other.getName())) return false; + if (!partnerPermissions_.equals(other.partnerPermissions_)) 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 (getPartnerPermissionsCount() > 0) { + hash = (37 * hash) + PARTNER_PERMISSIONS_FIELD_NUMBER; + hash = (53 * hash) + partnerPermissions_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions 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.cloud.cloudcontrolspartner.v1.PartnerPermissions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions 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.cloud.cloudcontrolspartner.v1.PartnerPermissions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions 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.cloud.cloudcontrolspartner.v1.PartnerPermissions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions 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.cloud.cloudcontrolspartner.v1.PartnerPermissions 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 permissions granted to the partner for a workload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.PartnerPermissions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.PartnerPermissions) + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.class, + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + partnerPermissions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions build() { + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions result = + new com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions result) { + if (((bitField0_ & 0x00000002) != 0)) { + partnerPermissions_ = java.util.Collections.unmodifiableList(partnerPermissions_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.partnerPermissions_ = partnerPermissions_; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions 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.cloud.cloudcontrolspartner.v1.PartnerPermissions) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.partnerPermissions_.isEmpty()) { + if (partnerPermissions_.isEmpty()) { + partnerPermissions_ = other.partnerPermissions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.addAll(other.partnerPermissions_); + } + 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 16: + { + int tmpRaw = input.readEnum(); + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List partnerPermissions_ = + java.util.Collections.emptyList(); + + private void ensurePartnerPermissionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + partnerPermissions_ = new java.util.ArrayList(partnerPermissions_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the partnerPermissions. + */ + public java.util.List + getPartnerPermissionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission>( + partnerPermissions_, partnerPermissions_converter_); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return The count of partnerPermissions. + */ + public int getPartnerPermissionsCount() { + return partnerPermissions_.size(); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the element to return. + * @return The partnerPermissions at the given index. + */ + public com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission + getPartnerPermissions(int index) { + return partnerPermissions_converter_.convert(partnerPermissions_.get(index)); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index to set the value at. + * @param value The partnerPermissions to set. + * @return This builder for chaining. + */ + public Builder setPartnerPermissions( + int index, com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param value The partnerPermissions to add. + * @return This builder for chaining. + */ + public Builder addPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param values The partnerPermissions to add. + * @return This builder for chaining. + */ + public Builder addAllPartnerPermissions( + java.lang.Iterable< + ? extends com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission> + values) { + ensurePartnerPermissionsIsMutable(); + for (com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission value : values) { + partnerPermissions_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearPartnerPermissions() { + partnerPermissions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the enum numeric values on the wire for partnerPermissions. + */ + public java.util.List getPartnerPermissionsValueList() { + return java.util.Collections.unmodifiableList(partnerPermissions_); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of partnerPermissions at the given index. + */ + public int getPartnerPermissionsValue(int index) { + return partnerPermissions_.get(index); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for partnerPermissions to set. + * @return This builder for chaining. + */ + public Builder setPartnerPermissionsValue(int index, int value) { + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param value The enum numeric value on the wire for partnerPermissions to add. + * @return This builder for chaining. + */ + public Builder addPartnerPermissionsValue(int value) { + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param values The enum numeric values on the wire for partnerPermissions to add. + * @return This builder for chaining. + */ + public Builder addAllPartnerPermissionsValue(java.lang.Iterable values) { + ensurePartnerPermissionsIsMutable(); + for (int value : values) { + partnerPermissions_.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.cloud.cloudcontrolspartner.v1.PartnerPermissions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.PartnerPermissions) + private static final com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartnerPermissions 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.cloud.cloudcontrolspartner.v1.PartnerPermissions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsName.java new file mode 100644 index 000000000000..886cefa81ac4 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PartnerPermissionsName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + + @Deprecated + protected PartnerPermissionsName() { + organization = null; + location = null; + customer = null; + workload = null; + } + + private PartnerPermissionsName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PartnerPermissionsName of( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build(); + } + + public static String format( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build() + .toString(); + } + + public static PartnerPermissionsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.validatedMatch( + formattedString, "PartnerPermissionsName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload")); + } + + 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 (PartnerPermissionsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PartnerPermissionsName that = ((PartnerPermissionsName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + private Builder(PartnerPermissionsName partnerPermissionsName) { + this.organization = partnerPermissionsName.organization; + this.location = partnerPermissionsName.location; + this.customer = partnerPermissionsName.customer; + this.workload = partnerPermissionsName.workload; + } + + public PartnerPermissionsName build() { + return new PartnerPermissionsName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsOrBuilder.java new file mode 100644 index 000000000000..e4177f7356a7 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface PartnerPermissionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.PartnerPermissions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the partnerPermissions. + */ + java.util.List + getPartnerPermissionsList(); + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return The count of partnerPermissions. + */ + int getPartnerPermissionsCount(); + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the element to return. + * @return The partnerPermissions at the given index. + */ + com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission getPartnerPermissions( + int index); + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the enum numeric values on the wire for partnerPermissions. + */ + java.util.List getPartnerPermissionsValueList(); + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of partnerPermissions at the given index. + */ + int getPartnerPermissionsValue(int index); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsProto.java new file mode 100644 index 000000000000..6b1a011dc111 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnerPermissionsProto.java @@ -0,0 +1,112 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class PartnerPermissionsProto { + private PartnerPermissionsProto() {} + + 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_cloud_cloudcontrolspartner_v1_PartnerPermissions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_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/cloud/cloudcontrolspartner/v1/p" + + "artner_permissions.proto\022$google.cloud.c" + + "loudcontrolspartner.v1\032\037google/api/field" + + "_behavior.proto\032\031google/api/resource.pro" + + "to\"\203\004\n\022PartnerPermissions\022\021\n\004name\030\001 \001(\tB" + + "\003\340A\010\022`\n\023partner_permissions\030\002 \003(\0162C.goog" + + "le.cloud.cloudcontrolspartner.v1.Partner" + + "Permissions.Permission\"\310\001\n\nPermission\022\032\n" + + "\026PERMISSION_UNSPECIFIED\020\000\0221\n-ACCESS_TRAN" + + "SPARENCY_AND_EMERGENCY_ACCESS_LOGS\020\001\022 \n\034" + + "ASSURED_WORKLOADS_MONITORING\020\002\022\034\n\030ACCESS" + + "_APPROVAL_REQUESTS\020\003\022+\n\'ASSURED_WORKLOAD" + + "S_EKM_CONNECTION_STATUS\020\004:\254\001\352A\250\001\n6cloudc" + + "ontrolspartner.googleapis.com/PartnerPer" + + "missions\022norganizations/{organization}/l" + + "ocations/{location}/customers/{customer}" + + "/workloads/{workload}/partnerPermissions" + + "\"l\n\034GetPartnerPermissionsRequest\022L\n\004name" + + "\030\001 \001(\tB>\340A\002\372A8\n6cloudcontrolspartner.goo" + + "gleapis.com/PartnerPermissionsB\233\002\n(com.g" + + "oogle.cloud.cloudcontrolspartner.v1B\027Par" + + "tnerPermissionsProtoP\001Z\\cloud.google.com" + + "/go/cloudcontrolspartner/apiv1/cloudcont" + + "rolspartnerpb;cloudcontrolspartnerpb\252\002$G" + + "oogle.Cloud.CloudControlsPartner.V1\312\002$Go" + + "ogle\\Cloud\\CloudControlsPartner\\V1\352\002\'Goo" + + "gle::Cloud::CloudControlsPartner::V1b\006pr" + + "oto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_PartnerPermissions_descriptor, + new java.lang.String[] { + "Name", "PartnerPermissions", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerPermissionsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnersProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnersProto.java new file mode 100644 index 000000000000..a6efaed874e9 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/PartnersProto.java @@ -0,0 +1,148 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class PartnersProto { + private PartnersProto() {} + + 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_cloud_cloudcontrolspartner_v1_Partner_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Partner_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_Sku_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Sku_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/cloudcontrolspartner/v1/p" + + "artners.proto\022$google.cloud.cloudcontrol" + + "spartner.v1\032\037google/api/field_behavior.p" + + "roto\032\031google/api/resource.proto\032\037google/" + + "protobuf/timestamp.proto\"\275\003\n\007Partner\022\021\n\004" + + "name\030\001 \001(\tB\003\340A\010\0227\n\004skus\030\003 \003(\0132).google.c" + + "loud.cloudcontrolspartner.v1.Sku\022H\n\rekm_" + + "solutions\030\004 \003(\01321.google.cloud.cloudcont" + + "rolspartner.v1.EkmMetadata\022\036\n\026operated_c" + + "loud_regions\030\005 \003(\t\022\032\n\022partner_project_id" + + "\030\007 \001(\t\0224\n\013create_time\030\t \001(\0132\032.google.pro" + + "tobuf.TimestampB\003\340A\003\0224\n\013update_time\030\n \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\003:t\352Aq\n" + + "+cloudcontrolspartner.googleapis.com/Par" + + "tner\0229organizations/{organization}/locat" + + "ions/{location}/partner2\007partner\"V\n\021GetP" + + "artnerRequest\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+clo" + + "udcontrolspartner.googleapis.com/Partner" + + "\"\'\n\003Sku\022\n\n\002id\030\001 \001(\t\022\024\n\014display_name\030\002 \001(" + + "\t\"\334\001\n\013EkmMetadata\022S\n\014ekm_solution\030\001 \001(\0162" + + "=.google.cloud.cloudcontrolspartner.v1.E" + + "kmMetadata.EkmSolution\022\030\n\020ekm_endpoint_u" + + "ri\030\002 \001(\t\"^\n\013EkmSolution\022\034\n\030EKM_SOLUTION_" + + "UNSPECIFIED\020\000\022\014\n\010FORTANIX\020\001\022\013\n\007FUTUREX\020\002" + + "\022\n\n\006THALES\020\003\022\n\n\006VIRTRU\020\004B\221\002\n(com.google." + + "cloud.cloudcontrolspartner.v1B\rPartnersP" + + "rotoP\001Z\\cloud.google.com/go/cloudcontrol" + + "spartner/apiv1/cloudcontrolspartnerpb;cl" + + "oudcontrolspartnerpb\252\002$Google.Cloud.Clou" + + "dControlsPartner.V1\312\002$Google\\Cloud\\Cloud" + + "ControlsPartner\\V1\352\002\'Google::Cloud::Clou" + + "dControlsPartner::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(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Partner_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_Partner_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Partner_descriptor, + new java.lang.String[] { + "Name", + "Skus", + "EkmSolutions", + "OperatedCloudRegions", + "PartnerProjectId", + "CreateTime", + "UpdateTime", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_GetPartnerRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Sku_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1_Sku_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Sku_descriptor, + new java.lang.String[] { + "Id", "DisplayName", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_EkmMetadata_descriptor, + new java.lang.String[] { + "EkmSolution", "EkmEndpointUri", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Sku.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Sku.java new file mode 100644 index 000000000000..6ca0b534d4fc --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Sku.java @@ -0,0 +1,834 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Represents the SKU a partner owns inside Google Cloud to sell to customers.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Sku} + */ +public final class Sku extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Sku) + SkuOrBuilder { + private static final long serialVersionUID = 0L; + // Use Sku.newBuilder() to construct. + private Sku(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Sku() { + id_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Sku(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Sku_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Sku_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Sku.class, + com.google.cloud.cloudcontrolspartner.v1.Sku.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+   * Argentum product SKU, that is associated with the partner offerings to
+   * customers used by Syntro for billing purposes. SKUs can represent resold
+   * Google products or support services.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Argentum product SKU, that is associated with the partner offerings to
+   * customers used by Syntro for billing purposes. SKUs can represent resold
+   * Google products or support services.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Display name of the product identified by the SKU. A partner may want to
+   * show partner branded names for their offerings such as local sovereign
+   * cloud solutions.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Display name of the product identified by the SKU. A partner may want to
+   * show partner branded names for their offerings such as local sovereign
+   * cloud solutions.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = 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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + 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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + 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.cloud.cloudcontrolspartner.v1.Sku)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Sku other = + (com.google.cloud.cloudcontrolspartner.v1.Sku) obj; + + if (!getId().equals(other.getId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku 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.cloud.cloudcontrolspartner.v1.Sku parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku 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.cloud.cloudcontrolspartner.v1.Sku parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku 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.cloud.cloudcontrolspartner.v1.Sku parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku 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.cloud.cloudcontrolspartner.v1.Sku 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; + } + /** + * + * + *
+   * Represents the SKU a partner owns inside Google Cloud to sell to customers.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Sku} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Sku) + com.google.cloud.cloudcontrolspartner.v1.SkuOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Sku_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Sku_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Sku.class, + com.google.cloud.cloudcontrolspartner.v1.Sku.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.Sku.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + displayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Sku_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Sku getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Sku.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Sku build() { + com.google.cloud.cloudcontrolspartner.v1.Sku result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Sku buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Sku result = + new com.google.cloud.cloudcontrolspartner.v1.Sku(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.Sku result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + } + + @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.cloud.cloudcontrolspartner.v1.Sku) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.Sku) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.Sku other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.Sku.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + 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: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = 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.lang.Object id_ = ""; + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = 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.cloud.cloudcontrolspartner.v1.Sku) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Sku) + private static final com.google.cloud.cloudcontrolspartner.v1.Sku DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.Sku(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Sku getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sku 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.cloud.cloudcontrolspartner.v1.Sku getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/SkuOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/SkuOrBuilder.java new file mode 100644 index 000000000000..f2360c8381fa --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/SkuOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface SkuOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Sku) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Argentum product SKU, that is associated with the partner offerings to
+   * customers used by Syntro for billing purposes. SKUs can represent resold
+   * Google products or support services.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Argentum product SKU, that is associated with the partner offerings to
+   * customers used by Syntro for billing purposes. SKUs can represent resold
+   * Google products or support services.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Display name of the product identified by the SKU. A partner may want to
+   * show partner branded names for their offerings such as local sovereign
+   * cloud solutions.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Display name of the product identified by the SKU. A partner may want to
+   * show partner branded names for their offerings such as local sovereign
+   * cloud solutions.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Violation.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Violation.java new file mode 100644 index 000000000000..c1957ffe6d92 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Violation.java @@ -0,0 +1,8647 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Details of resource Violation
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Violation} + */ +public final class Violation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Violation) + ViolationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Violation.newBuilder() to construct. + private Violation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Violation() { + name_ = ""; + description_ = ""; + category_ = ""; + state_ = 0; + nonCompliantOrgPolicy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Violation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Builder.class); + } + + /** + * + * + *
+   * Violation State Values
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.Violation.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Violation is resolved.
+     * 
+ * + * RESOLVED = 1; + */ + RESOLVED(1), + /** + * + * + *
+     * Violation is Unresolved
+     * 
+ * + * UNRESOLVED = 2; + */ + UNRESOLVED(2), + /** + * + * + *
+     * Violation is Exception
+     * 
+ * + * EXCEPTION = 3; + */ + EXCEPTION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Violation is resolved.
+     * 
+ * + * RESOLVED = 1; + */ + public static final int RESOLVED_VALUE = 1; + /** + * + * + *
+     * Violation is Unresolved
+     * 
+ * + * UNRESOLVED = 2; + */ + public static final int UNRESOLVED_VALUE = 2; + /** + * + * + *
+     * Violation is Exception
+     * 
+ * + * EXCEPTION = 3; + */ + public static final int EXCEPTION_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 State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return RESOLVED; + case 2: + return UNRESOLVED; + case 3: + return EXCEPTION; + 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 State findValueByNumber(int number) { + return State.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.cloud.cloudcontrolspartner.v1.Violation.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.Violation.State) + } + + public interface RemediationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Violation.Remediation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + boolean hasInstructions(); + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions getInstructions(); + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.InstructionsOrBuilder + getInstructionsOrBuilder(); + + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + java.util.List getCompliantValuesList(); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + int getCompliantValuesCount(); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + java.lang.String getCompliantValues(int index); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + com.google.protobuf.ByteString getCompliantValuesBytes(int index); + + /** + * + * + *
+     * Output only. Remediation type based on the type of org policy values
+     * violated
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + int getRemediationTypeValue(); + /** + * + * + *
+     * Output only. Remediation type based on the type of org policy values
+     * violated
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType + getRemediationType(); + } + /** + * + * + *
+   * Represents remediation guidance to resolve compliance violation for
+   * AssuredWorkload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Violation.Remediation} + */ + public static final class Remediation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Violation.Remediation) + RemediationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Remediation.newBuilder() to construct. + private Remediation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Remediation() { + compliantValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + remediationType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Remediation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Builder.class); + } + + /** + * + * + *
+     * Classifying remediation into various types based on the kind of
+     * violation. For example, violations caused due to changes in boolean org
+     * policy requires different remediation instructions compared to violation
+     * caused due to changes in allowed values of list org policy.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType} + */ + public enum RemediationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified remediation type
+       * 
+ * + * REMEDIATION_TYPE_UNSPECIFIED = 0; + */ + REMEDIATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Remediation type for boolean org policy
+       * 
+ * + * REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + */ + REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION(1), + /** + * + * + *
+       * Remediation type for list org policy which have allowed values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + */ + REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION(2), + /** + * + * + *
+       * Remediation type for list org policy which have denied values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + */ + REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION(3), + /** + * + * + *
+       * Remediation type for gcp.restrictCmekCryptoKeyProjects
+       * 
+ * + * REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + */ + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION(4), + /** + * + * + *
+       * Remediation type for resource violation.
+       * 
+ * + * REMEDIATION_RESOURCE_VIOLATION = 5; + */ + REMEDIATION_RESOURCE_VIOLATION(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified remediation type
+       * 
+ * + * REMEDIATION_TYPE_UNSPECIFIED = 0; + */ + public static final int REMEDIATION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Remediation type for boolean org policy
+       * 
+ * + * REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + */ + public static final int REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION_VALUE = 1; + /** + * + * + *
+       * Remediation type for list org policy which have allowed values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + */ + public static final int REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION_VALUE = 2; + /** + * + * + *
+       * Remediation type for list org policy which have denied values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + */ + public static final int REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION_VALUE = 3; + /** + * + * + *
+       * Remediation type for gcp.restrictCmekCryptoKeyProjects
+       * 
+ * + * REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + */ + public static final int + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION_VALUE = 4; + /** + * + * + *
+       * Remediation type for resource violation.
+       * 
+ * + * REMEDIATION_RESOURCE_VIOLATION = 5; + */ + public static final int REMEDIATION_RESOURCE_VIOLATION_VALUE = 5; + + 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 RemediationType 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 RemediationType forNumber(int value) { + switch (value) { + case 0: + return REMEDIATION_TYPE_UNSPECIFIED; + case 1: + return REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION; + case 2: + return REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION; + case 3: + return REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION; + case 4: + return REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION; + case 5: + return REMEDIATION_RESOURCE_VIOLATION; + 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 RemediationType findValueByNumber(int number) { + return RemediationType.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.cloud.cloudcontrolspartner.v1.Violation.Remediation.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RemediationType[] VALUES = values(); + + public static RemediationType 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 RemediationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType) + } + + public interface InstructionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + boolean hasGcloudInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + getGcloudInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.GcloudOrBuilder + getGcloudInstructionsOrBuilder(); + + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + boolean hasConsoleInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + getConsoleInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.ConsoleOrBuilder + getConsoleInstructionsOrBuilder(); + } + /** + * + * + *
+     * Instructions to remediate violation
+     * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions} + */ + public static final class Instructions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions) + InstructionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instructions.newBuilder() to construct. + private Instructions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instructions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instructions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Builder + .class); + } + + public interface GcloudOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + java.util.List getGcloudCommandsList(); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + int getGcloudCommandsCount(); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + java.lang.String getGcloudCommands(int index); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + com.google.protobuf.ByteString getGcloudCommandsBytes(int index); + + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + java.util.List getStepsList(); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + int getStepsCount(); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + java.lang.String getSteps(int index); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + com.google.protobuf.ByteString getStepsBytes(int index); + + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + java.util.List getAdditionalLinksList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + int getAdditionalLinksCount(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + java.lang.String getAdditionalLinks(int index); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + com.google.protobuf.ByteString getAdditionalLinksBytes(int index); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud} + */ + public static final class Gcloud extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud) + GcloudOrBuilder { + private static final long serialVersionUID = 0L; + // Use Gcloud.newBuilder() to construct. + private Gcloud(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Gcloud() { + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.emptyList(); + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Gcloud(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .Builder.class); + } + + public static final int GCLOUD_COMMANDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList gcloudCommands_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + public com.google.protobuf.ProtocolStringList getGcloudCommandsList() { + return gcloudCommands_; + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + public int getGcloudCommandsCount() { + return gcloudCommands_.size(); + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + public java.lang.String getGcloudCommands(int index) { + return gcloudCommands_.get(index); + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + public com.google.protobuf.ByteString getGcloudCommandsBytes(int index) { + return gcloudCommands_.getByteString(index); + } + + public static final int STEPS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList steps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + return steps_; + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + + public static final int ADDITIONAL_LINKS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + return additionalLinks_; + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.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 < gcloudCommands_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, gcloudCommands_.getRaw(i)); + } + for (int i = 0; i < steps_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, steps_.getRaw(i)); + } + for (int i = 0; i < additionalLinks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, additionalLinks_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < gcloudCommands_.size(); i++) { + dataSize += computeStringSizeNoTag(gcloudCommands_.getRaw(i)); + } + size += dataSize; + size += 1 * getGcloudCommandsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < steps_.size(); i++) { + dataSize += computeStringSizeNoTag(steps_.getRaw(i)); + } + size += dataSize; + size += 1 * getStepsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < additionalLinks_.size(); i++) { + dataSize += computeStringSizeNoTag(additionalLinks_.getRaw(i)); + } + size += dataSize; + size += 1 * getAdditionalLinksList().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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud other = + (com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud) + obj; + + if (!getGcloudCommandsList().equals(other.getGcloudCommandsList())) return false; + if (!getStepsList().equals(other.getStepsList())) return false; + if (!getAdditionalLinksList().equals(other.getAdditionalLinksList())) 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 (getGcloudCommandsCount() > 0) { + hash = (37 * hash) + GCLOUD_COMMANDS_FIELD_NUMBER; + hash = (53 * hash) + getGcloudCommandsList().hashCode(); + } + if (getStepsCount() > 0) { + hash = (37 * hash) + STEPS_FIELD_NUMBER; + hash = (53 * hash) + getStepsList().hashCode(); + } + if (getAdditionalLinksCount() > 0) { + hash = (37 * hash) + ADDITIONAL_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalLinksList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + 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; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud) + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .GcloudOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.emptyList(); + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + build() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + result = + new com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + gcloudCommands_.makeImmutable(); + result.gcloudCommands_ = gcloudCommands_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + steps_.makeImmutable(); + result.steps_ = steps_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + additionalLinks_.makeImmutable(); + result.additionalLinks_ = additionalLinks_; + } + } + + @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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud.getDefaultInstance()) return this; + if (!other.gcloudCommands_.isEmpty()) { + if (gcloudCommands_.isEmpty()) { + gcloudCommands_ = other.gcloudCommands_; + bitField0_ |= 0x00000001; + } else { + ensureGcloudCommandsIsMutable(); + gcloudCommands_.addAll(other.gcloudCommands_); + } + onChanged(); + } + if (!other.steps_.isEmpty()) { + if (steps_.isEmpty()) { + steps_ = other.steps_; + bitField0_ |= 0x00000002; + } else { + ensureStepsIsMutable(); + steps_.addAll(other.steps_); + } + onChanged(); + } + if (!other.additionalLinks_.isEmpty()) { + if (additionalLinks_.isEmpty()) { + additionalLinks_ = other.additionalLinks_; + bitField0_ |= 0x00000004; + } else { + ensureAdditionalLinksIsMutable(); + additionalLinks_.addAll(other.additionalLinks_); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStepsIsMutable(); + steps_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAdditionalLinksIsMutable(); + additionalLinks_.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.LazyStringArrayList gcloudCommands_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureGcloudCommandsIsMutable() { + if (!gcloudCommands_.isModifiable()) { + gcloudCommands_ = new com.google.protobuf.LazyStringArrayList(gcloudCommands_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + public com.google.protobuf.ProtocolStringList getGcloudCommandsList() { + gcloudCommands_.makeImmutable(); + return gcloudCommands_; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + public int getGcloudCommandsCount() { + return gcloudCommands_.size(); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + public java.lang.String getGcloudCommands(int index) { + return gcloudCommands_.get(index); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + public com.google.protobuf.ByteString getGcloudCommandsBytes(int index) { + return gcloudCommands_.getByteString(index); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index to set the value at. + * @param value The gcloudCommands to set. + * @return This builder for chaining. + */ + public Builder setGcloudCommands(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGcloudCommandsIsMutable(); + gcloudCommands_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param value The gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addGcloudCommands(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param values The gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addAllGcloudCommands(java.lang.Iterable values) { + ensureGcloudCommandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, gcloudCommands_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcloudCommands() { + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param value The bytes of the gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addGcloudCommandsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList steps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureStepsIsMutable() { + if (!steps_.isModifiable()) { + steps_ = new com.google.protobuf.LazyStringArrayList(steps_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + steps_.makeImmutable(); + return steps_; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index to set the value at. + * @param value The steps to set. + * @return This builder for chaining. + */ + public Builder setSteps(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param value The steps to add. + * @return This builder for chaining. + */ + public Builder addSteps(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param values The steps to add. + * @return This builder for chaining. + */ + public Builder addAllSteps(java.lang.Iterable values) { + ensureStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, steps_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return This builder for chaining. + */ + public Builder clearSteps() { + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param value The bytes of the steps to add. + * @return This builder for chaining. + */ + public Builder addStepsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStepsIsMutable(); + steps_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAdditionalLinksIsMutable() { + if (!additionalLinks_.isModifiable()) { + additionalLinks_ = new com.google.protobuf.LazyStringArrayList(additionalLinks_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + additionalLinks_.makeImmutable(); + return additionalLinks_; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.getByteString(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index to set the value at. + * @param value The additionalLinks to set. + * @return This builder for chaining. + */ + public Builder setAdditionalLinks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param values The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalLinks(java.lang.Iterable values) { + ensureAdditionalLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalLinks_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return This builder for chaining. + */ + public Builder clearAdditionalLinks() { + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The bytes of the additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAdditionalLinksIsMutable(); + additionalLinks_.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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud) + private static final com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation + .Instructions.Gcloud + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Gcloud 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConsoleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + java.util.List getConsoleUrisList(); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + int getConsoleUrisCount(); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + java.lang.String getConsoleUris(int index); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + com.google.protobuf.ByteString getConsoleUrisBytes(int index); + + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + java.util.List getStepsList(); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + int getStepsCount(); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + java.lang.String getSteps(int index); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + com.google.protobuf.ByteString getStepsBytes(int index); + + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + java.util.List getAdditionalLinksList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + int getAdditionalLinksCount(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + java.lang.String getAdditionalLinks(int index); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + com.google.protobuf.ByteString getAdditionalLinksBytes(int index); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console} + */ + public static final class Console extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console) + ConsoleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Console.newBuilder() to construct. + private Console(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Console() { + consoleUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Console(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.Builder.class); + } + + public static final int CONSOLE_URIS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList consoleUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + public com.google.protobuf.ProtocolStringList getConsoleUrisList() { + return consoleUris_; + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + public int getConsoleUrisCount() { + return consoleUris_.size(); + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + public java.lang.String getConsoleUris(int index) { + return consoleUris_.get(index); + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + public com.google.protobuf.ByteString getConsoleUrisBytes(int index) { + return consoleUris_.getByteString(index); + } + + public static final int STEPS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList steps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + return steps_; + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + + public static final int ADDITIONAL_LINKS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + return additionalLinks_; + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.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 < consoleUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, consoleUris_.getRaw(i)); + } + for (int i = 0; i < steps_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, steps_.getRaw(i)); + } + for (int i = 0; i < additionalLinks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, additionalLinks_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < consoleUris_.size(); i++) { + dataSize += computeStringSizeNoTag(consoleUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getConsoleUrisList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < steps_.size(); i++) { + dataSize += computeStringSizeNoTag(steps_.getRaw(i)); + } + size += dataSize; + size += 1 * getStepsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < additionalLinks_.size(); i++) { + dataSize += computeStringSizeNoTag(additionalLinks_.getRaw(i)); + } + size += dataSize; + size += 1 * getAdditionalLinksList().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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + other = + (com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console) + obj; + + if (!getConsoleUrisList().equals(other.getConsoleUrisList())) return false; + if (!getStepsList().equals(other.getStepsList())) return false; + if (!getAdditionalLinksList().equals(other.getAdditionalLinksList())) 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 (getConsoleUrisCount() > 0) { + hash = (37 * hash) + CONSOLE_URIS_FIELD_NUMBER; + hash = (53 * hash) + getConsoleUrisList().hashCode(); + } + if (getStepsCount() > 0) { + hash = (37 * hash) + STEPS_FIELD_NUMBER; + hash = (53 * hash) + getStepsList().hashCode(); + } + if (getAdditionalLinksCount() > 0) { + hash = (37 * hash) + ADDITIONAL_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalLinksList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + 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; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console) + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + consoleUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + build() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + result = + new com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + consoleUris_.makeImmutable(); + result.consoleUris_ = consoleUris_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + steps_.makeImmutable(); + result.steps_ = steps_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + additionalLinks_.makeImmutable(); + result.additionalLinks_ = additionalLinks_; + } + } + + @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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.getDefaultInstance()) return this; + if (!other.consoleUris_.isEmpty()) { + if (consoleUris_.isEmpty()) { + consoleUris_ = other.consoleUris_; + bitField0_ |= 0x00000001; + } else { + ensureConsoleUrisIsMutable(); + consoleUris_.addAll(other.consoleUris_); + } + onChanged(); + } + if (!other.steps_.isEmpty()) { + if (steps_.isEmpty()) { + steps_ = other.steps_; + bitField0_ |= 0x00000002; + } else { + ensureStepsIsMutable(); + steps_.addAll(other.steps_); + } + onChanged(); + } + if (!other.additionalLinks_.isEmpty()) { + if (additionalLinks_.isEmpty()) { + additionalLinks_ = other.additionalLinks_; + bitField0_ |= 0x00000004; + } else { + ensureAdditionalLinksIsMutable(); + additionalLinks_.addAll(other.additionalLinks_); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureConsoleUrisIsMutable(); + consoleUris_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStepsIsMutable(); + steps_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAdditionalLinksIsMutable(); + additionalLinks_.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.LazyStringArrayList consoleUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureConsoleUrisIsMutable() { + if (!consoleUris_.isModifiable()) { + consoleUris_ = new com.google.protobuf.LazyStringArrayList(consoleUris_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + public com.google.protobuf.ProtocolStringList getConsoleUrisList() { + consoleUris_.makeImmutable(); + return consoleUris_; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + public int getConsoleUrisCount() { + return consoleUris_.size(); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + public java.lang.String getConsoleUris(int index) { + return consoleUris_.get(index); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + public com.google.protobuf.ByteString getConsoleUrisBytes(int index) { + return consoleUris_.getByteString(index); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index to set the value at. + * @param value The consoleUris to set. + * @return This builder for chaining. + */ + public Builder setConsoleUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConsoleUrisIsMutable(); + consoleUris_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param value The consoleUris to add. + * @return This builder for chaining. + */ + public Builder addConsoleUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConsoleUrisIsMutable(); + consoleUris_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param values The consoleUris to add. + * @return This builder for chaining. + */ + public Builder addAllConsoleUris(java.lang.Iterable values) { + ensureConsoleUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, consoleUris_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return This builder for chaining. + */ + public Builder clearConsoleUris() { + consoleUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param value The bytes of the consoleUris to add. + * @return This builder for chaining. + */ + public Builder addConsoleUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureConsoleUrisIsMutable(); + consoleUris_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList steps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureStepsIsMutable() { + if (!steps_.isModifiable()) { + steps_ = new com.google.protobuf.LazyStringArrayList(steps_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + steps_.makeImmutable(); + return steps_; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index to set the value at. + * @param value The steps to set. + * @return This builder for chaining. + */ + public Builder setSteps(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param value The steps to add. + * @return This builder for chaining. + */ + public Builder addSteps(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param values The steps to add. + * @return This builder for chaining. + */ + public Builder addAllSteps(java.lang.Iterable values) { + ensureStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, steps_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return This builder for chaining. + */ + public Builder clearSteps() { + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param value The bytes of the steps to add. + * @return This builder for chaining. + */ + public Builder addStepsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStepsIsMutable(); + steps_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAdditionalLinksIsMutable() { + if (!additionalLinks_.isModifiable()) { + additionalLinks_ = new com.google.protobuf.LazyStringArrayList(additionalLinks_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + additionalLinks_.makeImmutable(); + return additionalLinks_; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.getByteString(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index to set the value at. + * @param value The additionalLinks to set. + * @return This builder for chaining. + */ + public Builder setAdditionalLinks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param values The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalLinks(java.lang.Iterable values) { + ensureAdditionalLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalLinks_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return This builder for chaining. + */ + public Builder clearAdditionalLinks() { + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The bytes of the additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAdditionalLinksIsMutable(); + additionalLinks_.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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console) + private static final com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation + .Instructions.Console + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Console 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int GCLOUD_INSTRUCTIONS_FIELD_NUMBER = 1; + private com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + gcloudInstructions_; + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + @java.lang.Override + public boolean hasGcloudInstructions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + getGcloudInstructions() { + return gcloudInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .GcloudOrBuilder + getGcloudInstructionsOrBuilder() { + return gcloudInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } + + public static final int CONSOLE_INSTRUCTIONS_FIELD_NUMBER = 2; + private com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + consoleInstructions_; + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + @java.lang.Override + public boolean hasConsoleInstructions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + getConsoleInstructions() { + return consoleInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + .getDefaultInstance() + : consoleInstructions_; + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder + getConsoleInstructionsOrBuilder() { + return consoleInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + .getDefaultInstance() + : consoleInstructions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getGcloudInstructions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getConsoleInstructions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcloudInstructions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConsoleInstructions()); + } + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions other = + (com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions) obj; + + if (hasGcloudInstructions() != other.hasGcloudInstructions()) return false; + if (hasGcloudInstructions()) { + if (!getGcloudInstructions().equals(other.getGcloudInstructions())) return false; + } + if (hasConsoleInstructions() != other.hasConsoleInstructions()) return false; + if (hasConsoleInstructions()) { + if (!getConsoleInstructions().equals(other.getConsoleInstructions())) 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 (hasGcloudInstructions()) { + hash = (37 * hash) + GCLOUD_INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getGcloudInstructions().hashCode(); + } + if (hasConsoleInstructions()) { + hash = (37 * hash) + CONSOLE_INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConsoleInstructions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions 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; + } + /** + * + * + *
+       * Instructions to remediate violation
+       * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions) + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.InstructionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGcloudInstructionsFieldBuilder(); + getConsoleInstructionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcloudInstructions_ = null; + if (gcloudInstructionsBuilder_ != null) { + gcloudInstructionsBuilder_.dispose(); + gcloudInstructionsBuilder_ = null; + } + consoleInstructions_ = null; + if (consoleInstructionsBuilder_ != null) { + consoleInstructionsBuilder_.dispose(); + consoleInstructionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions build() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions result = + new com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gcloudInstructions_ = + gcloudInstructionsBuilder_ == null + ? gcloudInstructions_ + : gcloudInstructionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.consoleInstructions_ = + consoleInstructionsBuilder_ == null + ? consoleInstructions_ + : consoleInstructionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .getDefaultInstance()) return this; + if (other.hasGcloudInstructions()) { + mergeGcloudInstructions(other.getGcloudInstructions()); + } + if (other.hasConsoleInstructions()) { + mergeConsoleInstructions(other.getConsoleInstructions()); + } + 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( + getGcloudInstructionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getConsoleInstructionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + gcloudInstructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .GcloudOrBuilder> + gcloudInstructionsBuilder_; + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + public boolean hasGcloudInstructions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + getGcloudInstructions() { + if (gcloudInstructionsBuilder_ == null) { + return gcloudInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } else { + return gcloudInstructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder setGcloudInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + value) { + if (gcloudInstructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcloudInstructions_ = value; + } else { + gcloudInstructionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder setGcloudInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .Builder + builderForValue) { + if (gcloudInstructionsBuilder_ == null) { + gcloudInstructions_ = builderForValue.build(); + } else { + gcloudInstructionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder mergeGcloudInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + value) { + if (gcloudInstructionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && gcloudInstructions_ != null + && gcloudInstructions_ + != com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud.getDefaultInstance()) { + getGcloudInstructionsBuilder().mergeFrom(value); + } else { + gcloudInstructions_ = value; + } + } else { + gcloudInstructionsBuilder_.mergeFrom(value); + } + if (gcloudInstructions_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder clearGcloudInstructions() { + bitField0_ = (bitField0_ & ~0x00000001); + gcloudInstructions_ = null; + if (gcloudInstructionsBuilder_ != null) { + gcloudInstructionsBuilder_.dispose(); + gcloudInstructionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .Builder + getGcloudInstructionsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGcloudInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .GcloudOrBuilder + getGcloudInstructionsOrBuilder() { + if (gcloudInstructionsBuilder_ != null) { + return gcloudInstructionsBuilder_.getMessageOrBuilder(); + } else { + return gcloudInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Gcloud + .Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .GcloudOrBuilder> + getGcloudInstructionsFieldBuilder() { + if (gcloudInstructionsBuilder_ == null) { + gcloudInstructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Gcloud.Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .GcloudOrBuilder>( + getGcloudInstructions(), getParentForChildren(), isClean()); + gcloudInstructions_ = null; + } + return gcloudInstructionsBuilder_; + } + + private com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + consoleInstructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + .Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder> + consoleInstructionsBuilder_; + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + public boolean hasConsoleInstructions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + getConsoleInstructions() { + if (consoleInstructionsBuilder_ == null) { + return consoleInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.getDefaultInstance() + : consoleInstructions_; + } else { + return consoleInstructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder setConsoleInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + value) { + if (consoleInstructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consoleInstructions_ = value; + } else { + consoleInstructionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder setConsoleInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + .Builder + builderForValue) { + if (consoleInstructionsBuilder_ == null) { + consoleInstructions_ = builderForValue.build(); + } else { + consoleInstructionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder mergeConsoleInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + value) { + if (consoleInstructionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && consoleInstructions_ != null + && consoleInstructions_ + != com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.getDefaultInstance()) { + getConsoleInstructionsBuilder().mergeFrom(value); + } else { + consoleInstructions_ = value; + } + } else { + consoleInstructionsBuilder_.mergeFrom(value); + } + if (consoleInstructions_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder clearConsoleInstructions() { + bitField0_ = (bitField0_ & ~0x00000002); + consoleInstructions_ = null; + if (consoleInstructionsBuilder_ != null) { + consoleInstructionsBuilder_.dispose(); + consoleInstructionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + .Builder + getConsoleInstructionsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConsoleInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder + getConsoleInstructionsOrBuilder() { + if (consoleInstructionsBuilder_ != null) { + return consoleInstructionsBuilder_.getMessageOrBuilder(); + } else { + return consoleInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.getDefaultInstance() + : consoleInstructions_; + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Console + .Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder> + getConsoleInstructionsFieldBuilder() { + if (consoleInstructionsBuilder_ == null) { + consoleInstructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Console.Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .ConsoleOrBuilder>( + getConsoleInstructions(), getParentForChildren(), isClean()); + consoleInstructions_ = null; + } + return consoleInstructionsBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions) + private static final com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation + .Instructions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instructions 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int INSTRUCTIONS_FIELD_NUMBER = 1; + private com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + instructions_; + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + @java.lang.Override + public boolean hasInstructions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + getInstructions() { + return instructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.InstructionsOrBuilder + getInstructionsOrBuilder() { + return instructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } + + public static final int COMPLIANT_VALUES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList compliantValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + public com.google.protobuf.ProtocolStringList getCompliantValuesList() { + return compliantValues_; + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + public int getCompliantValuesCount() { + return compliantValues_.size(); + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + public java.lang.String getCompliantValues(int index) { + return compliantValues_.get(index); + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + public com.google.protobuf.ByteString getCompliantValuesBytes(int index) { + return compliantValues_.getByteString(index); + } + + public static final int REMEDIATION_TYPE_FIELD_NUMBER = 3; + private int remediationType_ = 0; + /** + * + * + *
+     * Output only. Remediation type based on the type of org policy values
+     * violated
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + @java.lang.Override + public int getRemediationTypeValue() { + return remediationType_; + } + /** + * + * + *
+     * Output only. Remediation type based on the type of org policy values
+     * violated
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType + getRemediationType() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType result = + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType.forNumber( + remediationType_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType + .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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getInstructions()); + } + for (int i = 0; i < compliantValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, compliantValues_.getRaw(i)); + } + if (remediationType_ + != com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType + .REMEDIATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, remediationType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInstructions()); + } + { + int dataSize = 0; + for (int i = 0; i < compliantValues_.size(); i++) { + dataSize += computeStringSizeNoTag(compliantValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getCompliantValuesList().size(); + } + if (remediationType_ + != com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType + .REMEDIATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, remediationType_); + } + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation other = + (com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation) obj; + + if (hasInstructions() != other.hasInstructions()) return false; + if (hasInstructions()) { + if (!getInstructions().equals(other.getInstructions())) return false; + } + if (!getCompliantValuesList().equals(other.getCompliantValuesList())) return false; + if (remediationType_ != other.remediationType_) 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 (hasInstructions()) { + hash = (37 * hash) + INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getInstructions().hashCode(); + } + if (getCompliantValuesCount() > 0) { + hash = (37 * hash) + COMPLIANT_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getCompliantValuesList().hashCode(); + } + hash = (37 * hash) + REMEDIATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + remediationType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation 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.cloud.cloudcontrolspartner.v1.Violation.Remediation parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation 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.cloud.cloudcontrolspartner.v1.Violation.Remediation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation 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.cloud.cloudcontrolspartner.v1.Violation.Remediation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation 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.cloud.cloudcontrolspartner.v1.Violation.Remediation 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; + } + /** + * + * + *
+     * Represents remediation guidance to resolve compliance violation for
+     * AssuredWorkload
+     * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Violation.Remediation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Violation.Remediation) + com.google.cloud.cloudcontrolspartner.v1.Violation.RemediationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstructionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instructions_ = null; + if (instructionsBuilder_ != null) { + instructionsBuilder_.dispose(); + instructionsBuilder_ = null; + } + compliantValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + remediationType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation build() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation result = + new com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instructions_ = + instructionsBuilder_ == null ? instructions_ : instructionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + compliantValues_.makeImmutable(); + result.compliantValues_ = compliantValues_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.remediationType_ = remediationType_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.getDefaultInstance()) + return this; + if (other.hasInstructions()) { + mergeInstructions(other.getInstructions()); + } + if (!other.compliantValues_.isEmpty()) { + if (compliantValues_.isEmpty()) { + compliantValues_ = other.compliantValues_; + bitField0_ |= 0x00000002; + } else { + ensureCompliantValuesIsMutable(); + compliantValues_.addAll(other.compliantValues_); + } + onChanged(); + } + if (other.remediationType_ != 0) { + setRemediationTypeValue(other.getRemediationTypeValue()); + } + 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(getInstructionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCompliantValuesIsMutable(); + compliantValues_.add(s); + break; + } // case 18 + case 24: + { + remediationType_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + instructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.InstructionsOrBuilder> + instructionsBuilder_; + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + public boolean hasInstructions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + getInstructions() { + if (instructionsBuilder_ == null) { + return instructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } else { + return instructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions value) { + if (instructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instructions_ = value; + } else { + instructionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Builder + builderForValue) { + if (instructionsBuilder_ == null) { + instructions_ = builderForValue.build(); + } else { + instructionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstructions( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions value) { + if (instructionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && instructions_ != null + && instructions_ + != com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .getDefaultInstance()) { + getInstructionsBuilder().mergeFrom(value); + } else { + instructions_ = value; + } + } else { + instructionsBuilder_.mergeFrom(value); + } + if (instructions_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstructions() { + bitField0_ = (bitField0_ & ~0x00000001); + instructions_ = null; + if (instructionsBuilder_ != null) { + instructionsBuilder_.dispose(); + instructionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Builder + getInstructionsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.InstructionsOrBuilder + getInstructionsOrBuilder() { + if (instructionsBuilder_ != null) { + return instructionsBuilder_.getMessageOrBuilder(); + } else { + return instructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions.Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.InstructionsOrBuilder> + getInstructionsFieldBuilder() { + if (instructionsBuilder_ == null) { + instructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Instructions + .Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation + .InstructionsOrBuilder>(getInstructions(), getParentForChildren(), isClean()); + instructions_ = null; + } + return instructionsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList compliantValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCompliantValuesIsMutable() { + if (!compliantValues_.isModifiable()) { + compliantValues_ = new com.google.protobuf.LazyStringArrayList(compliantValues_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + public com.google.protobuf.ProtocolStringList getCompliantValuesList() { + compliantValues_.makeImmutable(); + return compliantValues_; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + public int getCompliantValuesCount() { + return compliantValues_.size(); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + public java.lang.String getCompliantValues(int index) { + return compliantValues_.get(index); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + public com.google.protobuf.ByteString getCompliantValuesBytes(int index) { + return compliantValues_.getByteString(index); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index to set the value at. + * @param value The compliantValues to set. + * @return This builder for chaining. + */ + public Builder setCompliantValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompliantValuesIsMutable(); + compliantValues_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param value The compliantValues to add. + * @return This builder for chaining. + */ + public Builder addCompliantValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompliantValuesIsMutable(); + compliantValues_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param values The compliantValues to add. + * @return This builder for chaining. + */ + public Builder addAllCompliantValues(java.lang.Iterable values) { + ensureCompliantValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, compliantValues_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return This builder for chaining. + */ + public Builder clearCompliantValues() { + compliantValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param value The bytes of the compliantValues to add. + * @return This builder for chaining. + */ + public Builder addCompliantValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCompliantValuesIsMutable(); + compliantValues_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int remediationType_ = 0; + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + @java.lang.Override + public int getRemediationTypeValue() { + return remediationType_; + } + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for remediationType to set. + * @return This builder for chaining. + */ + public Builder setRemediationTypeValue(int value) { + remediationType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType + getRemediationType() { + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType result = + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType + .forNumber(remediationType_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The remediationType to set. + * @return This builder for chaining. + */ + public Builder setRemediationType( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + remediationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRemediationType() { + bitField0_ = (bitField0_ & ~0x00000004); + remediationType_ = 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.cloud.cloudcontrolspartner.v1.Violation.Remediation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Violation.Remediation) + private static final com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Remediation 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.cloud.cloudcontrolspartner.v1.Violation.Remediation + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BEGIN_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp beginTime_; + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + @java.lang.Override + public boolean hasBeginTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getBeginTime() { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder() { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 RESOLVE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp resolveTime_; + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + @java.lang.Override + public boolean hasResolveTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResolveTime() { + return resolveTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : resolveTime_; + } + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder() { + return resolveTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : resolveTime_; + } + + public static final int CATEGORY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object category_ = ""; + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + @java.lang.Override + public java.lang.String getCategory() { + java.lang.Object ref = category_; + 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(); + category_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_ = 0; + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.State getState() { + com.google.cloud.cloudcontrolspartner.v1.Violation.State result = + com.google.cloud.cloudcontrolspartner.v1.Violation.State.forNumber(state_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.State.UNRECOGNIZED + : result; + } + + public static final int NON_COMPLIANT_ORG_POLICY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object nonCompliantOrgPolicy_ = ""; + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with
+   * non-compliant change and resulted this violation. Format:
+   *  `projects/{project_number}/policies/{constraint_name}`
+   *  `folders/{folder_id}/policies/{constraint_name}`
+   *  `organizations/{organization_id}/policies/{constraint_name}`
+   * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + @java.lang.Override + public java.lang.String getNonCompliantOrgPolicy() { + java.lang.Object ref = nonCompliantOrgPolicy_; + 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(); + nonCompliantOrgPolicy_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with
+   * non-compliant change and resulted this violation. Format:
+   *  `projects/{project_number}/policies/{constraint_name}`
+   *  `folders/{folder_id}/policies/{constraint_name}`
+   *  `organizations/{organization_id}/policies/{constraint_name}`
+   * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonCompliantOrgPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOLDER_ID_FIELD_NUMBER = 9; + private long folderId_ = 0L; + /** + * + * + *
+   * The folder_id of the violation
+   * 
+ * + * int64 folder_id = 9; + * + * @return The folderId. + */ + @java.lang.Override + public long getFolderId() { + return folderId_; + } + + public static final int REMEDIATION_FIELD_NUMBER = 13; + private com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation_; + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + @java.lang.Override + public boolean hasRemediation() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation getRemediation() { + return remediation_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.getDefaultInstance() + : remediation_; + } + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.RemediationOrBuilder + getRemediationOrBuilder() { + return remediation_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.getDefaultInstance() + : remediation_; + } + + 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(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBeginTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getResolveTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(category_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, category_); + } + if (state_ + != com.google.cloud.cloudcontrolspartner.v1.Violation.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(7, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonCompliantOrgPolicy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, nonCompliantOrgPolicy_); + } + if (folderId_ != 0L) { + output.writeInt64(9, folderId_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(13, getRemediation()); + } + 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(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBeginTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getResolveTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(category_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, category_); + } + if (state_ + != com.google.cloud.cloudcontrolspartner.v1.Violation.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonCompliantOrgPolicy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, nonCompliantOrgPolicy_); + } + if (folderId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, folderId_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getRemediation()); + } + 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.cloud.cloudcontrolspartner.v1.Violation)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Violation other = + (com.google.cloud.cloudcontrolspartner.v1.Violation) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasBeginTime() != other.hasBeginTime()) return false; + if (hasBeginTime()) { + if (!getBeginTime().equals(other.getBeginTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasResolveTime() != other.hasResolveTime()) return false; + if (hasResolveTime()) { + if (!getResolveTime().equals(other.getResolveTime())) return false; + } + if (!getCategory().equals(other.getCategory())) return false; + if (state_ != other.state_) return false; + if (!getNonCompliantOrgPolicy().equals(other.getNonCompliantOrgPolicy())) return false; + if (getFolderId() != other.getFolderId()) return false; + if (hasRemediation() != other.hasRemediation()) return false; + if (hasRemediation()) { + if (!getRemediation().equals(other.getRemediation())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasBeginTime()) { + hash = (37 * hash) + BEGIN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getBeginTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasResolveTime()) { + hash = (37 * hash) + RESOLVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResolveTime().hashCode(); + } + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getCategory().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + NON_COMPLIANT_ORG_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getNonCompliantOrgPolicy().hashCode(); + hash = (37 * hash) + FOLDER_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFolderId()); + if (hasRemediation()) { + hash = (37 * hash) + REMEDIATION_FIELD_NUMBER; + hash = (53 * hash) + getRemediation().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation 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.cloud.cloudcontrolspartner.v1.Violation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation 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.cloud.cloudcontrolspartner.v1.Violation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation 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.cloud.cloudcontrolspartner.v1.Violation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation 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.cloud.cloudcontrolspartner.v1.Violation 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; + } + /** + * + * + *
+   * Details of resource Violation
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Violation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Violation) + com.google.cloud.cloudcontrolspartner.v1.ViolationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Violation.class, + com.google.cloud.cloudcontrolspartner.v1.Violation.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.Violation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBeginTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getResolveTimeFieldBuilder(); + getRemediationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + beginTime_ = null; + if (beginTimeBuilder_ != null) { + beginTimeBuilder_.dispose(); + beginTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + resolveTime_ = null; + if (resolveTimeBuilder_ != null) { + resolveTimeBuilder_.dispose(); + resolveTimeBuilder_ = null; + } + category_ = ""; + state_ = 0; + nonCompliantOrgPolicy_ = ""; + folderId_ = 0L; + remediation_ = null; + if (remediationBuilder_ != null) { + remediationBuilder_.dispose(); + remediationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Violation_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Violation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation build() { + com.google.cloud.cloudcontrolspartner.v1.Violation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Violation result = + new com.google.cloud.cloudcontrolspartner.v1.Violation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.Violation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.beginTime_ = beginTimeBuilder_ == null ? beginTime_ : beginTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.resolveTime_ = + resolveTimeBuilder_ == null ? resolveTime_ : resolveTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.category_ = category_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.nonCompliantOrgPolicy_ = nonCompliantOrgPolicy_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.folderId_ = folderId_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.remediation_ = + remediationBuilder_ == null ? remediation_ : remediationBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.Violation) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.Violation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.Violation other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.Violation.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBeginTime()) { + mergeBeginTime(other.getBeginTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasResolveTime()) { + mergeResolveTime(other.getResolveTime()); + } + if (!other.getCategory().isEmpty()) { + category_ = other.category_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getNonCompliantOrgPolicy().isEmpty()) { + nonCompliantOrgPolicy_ = other.nonCompliantOrgPolicy_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getFolderId() != 0L) { + setFolderId(other.getFolderId()); + } + if (other.hasRemediation()) { + mergeRemediation(other.getRemediation()); + } + 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: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getBeginTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getResolveTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + category_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: + { + nonCompliantOrgPolicy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + folderId_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 106: + { + input.readMessage(getRemediationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp beginTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + beginTimeBuilder_; + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + public boolean hasBeginTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + public com.google.protobuf.Timestamp getBeginTime() { + if (beginTimeBuilder_ == null) { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } else { + return beginTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBeginTime(com.google.protobuf.Timestamp value) { + if (beginTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + beginTime_ = value; + } else { + beginTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBeginTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (beginTimeBuilder_ == null) { + beginTime_ = builderForValue.build(); + } else { + beginTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBeginTime(com.google.protobuf.Timestamp value) { + if (beginTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && beginTime_ != null + && beginTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getBeginTimeBuilder().mergeFrom(value); + } else { + beginTime_ = value; + } + } else { + beginTimeBuilder_.mergeFrom(value); + } + if (beginTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBeginTime() { + bitField0_ = (bitField0_ & ~0x00000004); + beginTime_ = null; + if (beginTimeBuilder_ != null) { + beginTimeBuilder_.dispose(); + beginTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getBeginTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBeginTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder() { + if (beginTimeBuilder_ != null) { + return beginTimeBuilder_.getMessageOrBuilder(); + } else { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getBeginTimeFieldBuilder() { + if (beginTimeBuilder_ == null) { + beginTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getBeginTime(), getParentForChildren(), isClean()); + beginTime_ = null; + } + return beginTimeBuilder_; + } + + 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. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 com.google.protobuf.Timestamp resolveTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + resolveTimeBuilder_; + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + public boolean hasResolveTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + public com.google.protobuf.Timestamp getResolveTime() { + if (resolveTimeBuilder_ == null) { + return resolveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : resolveTime_; + } else { + return resolveTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResolveTime(com.google.protobuf.Timestamp value) { + if (resolveTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolveTime_ = value; + } else { + resolveTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResolveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (resolveTimeBuilder_ == null) { + resolveTime_ = builderForValue.build(); + } else { + resolveTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeResolveTime(com.google.protobuf.Timestamp value) { + if (resolveTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && resolveTime_ != null + && resolveTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getResolveTimeBuilder().mergeFrom(value); + } else { + resolveTime_ = value; + } + } else { + resolveTimeBuilder_.mergeFrom(value); + } + if (resolveTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearResolveTime() { + bitField0_ = (bitField0_ & ~0x00000010); + resolveTime_ = null; + if (resolveTimeBuilder_ != null) { + resolveTimeBuilder_.dispose(); + resolveTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getResolveTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getResolveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder() { + if (resolveTimeBuilder_ != null) { + return resolveTimeBuilder_.getMessageOrBuilder(); + } else { + return resolveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : resolveTime_; + } + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_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> + getResolveTimeFieldBuilder() { + if (resolveTimeBuilder_ == null) { + resolveTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResolveTime(), getParentForChildren(), isClean()); + resolveTime_ = null; + } + return resolveTimeBuilder_; + } + + private java.lang.Object category_ = ""; + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + category_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + category_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + category_ = getDefaultInstance().getCategory(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + category_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Violation.State getState() { + com.google.cloud.cloudcontrolspartner.v1.Violation.State result = + com.google.cloud.cloudcontrolspartner.v1.Violation.State.forNumber(state_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.cloudcontrolspartner.v1.Violation.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000040); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object nonCompliantOrgPolicy_ = ""; + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  `projects/{project_number}/policies/{constraint_name}`
+     *  `folders/{folder_id}/policies/{constraint_name}`
+     *  `organizations/{organization_id}/policies/{constraint_name}`
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + public java.lang.String getNonCompliantOrgPolicy() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nonCompliantOrgPolicy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  `projects/{project_number}/policies/{constraint_name}`
+     *  `folders/{folder_id}/policies/{constraint_name}`
+     *  `organizations/{organization_id}/policies/{constraint_name}`
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + public com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonCompliantOrgPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  `projects/{project_number}/policies/{constraint_name}`
+     *  `folders/{folder_id}/policies/{constraint_name}`
+     *  `organizations/{organization_id}/policies/{constraint_name}`
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The nonCompliantOrgPolicy to set. + * @return This builder for chaining. + */ + public Builder setNonCompliantOrgPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nonCompliantOrgPolicy_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  `projects/{project_number}/policies/{constraint_name}`
+     *  `folders/{folder_id}/policies/{constraint_name}`
+     *  `organizations/{organization_id}/policies/{constraint_name}`
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearNonCompliantOrgPolicy() { + nonCompliantOrgPolicy_ = getDefaultInstance().getNonCompliantOrgPolicy(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  `projects/{project_number}/policies/{constraint_name}`
+     *  `folders/{folder_id}/policies/{constraint_name}`
+     *  `organizations/{organization_id}/policies/{constraint_name}`
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for nonCompliantOrgPolicy to set. + * @return This builder for chaining. + */ + public Builder setNonCompliantOrgPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nonCompliantOrgPolicy_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private long folderId_; + /** + * + * + *
+     * The folder_id of the violation
+     * 
+ * + * int64 folder_id = 9; + * + * @return The folderId. + */ + @java.lang.Override + public long getFolderId() { + return folderId_; + } + /** + * + * + *
+     * The folder_id of the violation
+     * 
+ * + * int64 folder_id = 9; + * + * @param value The folderId to set. + * @return This builder for chaining. + */ + public Builder setFolderId(long value) { + + folderId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The folder_id of the violation
+     * 
+ * + * int64 folder_id = 9; + * + * @return This builder for chaining. + */ + public Builder clearFolderId() { + bitField0_ = (bitField0_ & ~0x00000100); + folderId_ = 0L; + onChanged(); + return this; + } + + private com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.RemediationOrBuilder> + remediationBuilder_; + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + public boolean hasRemediation() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation getRemediation() { + if (remediationBuilder_ == null) { + return remediation_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.getDefaultInstance() + : remediation_; + } else { + return remediationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRemediation( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation value) { + if (remediationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + remediation_ = value; + } else { + remediationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRemediation( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Builder builderForValue) { + if (remediationBuilder_ == null) { + remediation_ = builderForValue.build(); + } else { + remediationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeRemediation( + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation value) { + if (remediationBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && remediation_ != null + && remediation_ + != com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation + .getDefaultInstance()) { + getRemediationBuilder().mergeFrom(value); + } else { + remediation_ = value; + } + } else { + remediationBuilder_.mergeFrom(value); + } + if (remediation_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearRemediation() { + bitField0_ = (bitField0_ & ~0x00000200); + remediation_ = null; + if (remediationBuilder_ != null) { + remediationBuilder_.dispose(); + remediationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Builder + getRemediationBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getRemediationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.Violation.RemediationOrBuilder + getRemediationOrBuilder() { + if (remediationBuilder_ != null) { + return remediationBuilder_.getMessageOrBuilder(); + } else { + return remediation_ == null + ? com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.getDefaultInstance() + : remediation_; + } + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.RemediationOrBuilder> + getRemediationFieldBuilder() { + if (remediationBuilder_ == null) { + remediationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation, + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation.Builder, + com.google.cloud.cloudcontrolspartner.v1.Violation.RemediationOrBuilder>( + getRemediation(), getParentForChildren(), isClean()); + remediation_ = null; + } + return remediationBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1.Violation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Violation) + private static final com.google.cloud.cloudcontrolspartner.v1.Violation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.Violation(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Violation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Violation 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.cloud.cloudcontrolspartner.v1.Violation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationName.java new file mode 100644 index 000000000000..86e305f7f0d9 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationName.java @@ -0,0 +1,298 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ViolationName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_VIOLATION = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + private final String violation; + + @Deprecated + protected ViolationName() { + organization = null; + location = null; + customer = null; + workload = null; + violation = null; + } + + private ViolationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + violation = Preconditions.checkNotNull(builder.getViolation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public String getViolation() { + return violation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ViolationName of( + String organization, String location, String customer, String workload, String violation) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .setViolation(violation) + .build(); + } + + public static String format( + String organization, String location, String customer, String workload, String violation) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .setViolation(violation) + .build() + .toString(); + } + + public static ViolationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_VIOLATION.validatedMatch( + formattedString, "ViolationName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload"), + matchMap.get("violation")); + } + + 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 (ViolationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_VIOLATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + if (violation != null) { + fieldMapBuilder.put("violation", violation); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_VIOLATION.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload, + "violation", + violation); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ViolationName that = ((ViolationName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload) + && Objects.equals(this.violation, that.violation); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + h *= 1000003; + h ^= Objects.hashCode(violation); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + private String violation; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public String getViolation() { + return violation; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + public Builder setViolation(String violation) { + this.violation = violation; + return this; + } + + private Builder(ViolationName violationName) { + this.organization = violationName.organization; + this.location = violationName.location; + this.customer = violationName.customer; + this.workload = violationName.workload; + this.violation = violationName.violation; + } + + public ViolationName build() { + return new ViolationName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationOrBuilder.java new file mode 100644 index 000000000000..f9902c87734d --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationOrBuilder.java @@ -0,0 +1,344 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface ViolationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Violation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + boolean hasBeginTime(); + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + com.google.protobuf.Timestamp getBeginTime(); + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + boolean hasResolveTime(); + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + com.google.protobuf.Timestamp getResolveTime(); + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + java.lang.String getCategory(); + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + com.google.protobuf.ByteString getCategoryBytes(); + + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.State getState(); + + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with
+   * non-compliant change and resulted this violation. Format:
+   *  `projects/{project_number}/policies/{constraint_name}`
+   *  `folders/{folder_id}/policies/{constraint_name}`
+   *  `organizations/{organization_id}/policies/{constraint_name}`
+   * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + java.lang.String getNonCompliantOrgPolicy(); + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with
+   * non-compliant change and resulted this violation. Format:
+   *  `projects/{project_number}/policies/{constraint_name}`
+   *  `folders/{folder_id}/policies/{constraint_name}`
+   *  `organizations/{organization_id}/policies/{constraint_name}`
+   * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes(); + + /** + * + * + *
+   * The folder_id of the violation
+   * 
+ * + * int64 folder_id = 9; + * + * @return The folderId. + */ + long getFolderId(); + + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + boolean hasRemediation(); + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.Remediation getRemediation(); + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.cloudcontrolspartner.v1.Violation.RemediationOrBuilder getRemediationOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationsProto.java new file mode 100644 index 000000000000..f970aaebd77d --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/ViolationsProto.java @@ -0,0 +1,244 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public final class ViolationsProto { + private ViolationsProto() {} + + 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_cloud_cloudcontrolspartner_v1_Violation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/cloudcontrolspartner/v1/v" + + "iolations.proto\022$google.cloud.cloudcontr" + + "olspartner.v1\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032\037googl" + + "e/protobuf/timestamp.proto\032\032google/type/" + + "interval.proto\"\241\r\n\tViolation\022\021\n\004name\030\001 \001" + + "(\tB\003\340A\010\022\030\n\013description\030\002 \001(\tB\003\340A\003\0223\n\nbeg" + + "in_time\030\003 \001(\0132\032.google.protobuf.Timestam" + + "pB\003\340A\003\0224\n\013update_time\030\004 \001(\0132\032.google.pro" + + "tobuf.TimestampB\003\340A\003\0225\n\014resolve_time\030\005 \001" + + "(\0132\032.google.protobuf.TimestampB\003\340A\003\022\025\n\010c" + + "ategory\030\006 \001(\tB\003\340A\003\022I\n\005state\030\007 \001(\01625.goog" + + "le.cloud.cloudcontrolspartner.v1.Violati" + + "on.StateB\003\340A\003\022(\n\030non_compliant_org_polic" + + "y\030\010 \001(\tB\006\340A\003\340A\005\022\021\n\tfolder_id\030\t \001(\003\022U\n\013re" + + "mediation\030\r \001(\0132;.google.cloud.cloudcont" + + "rolspartner.v1.Violation.RemediationB\003\340A" + + "\003\032\300\007\n\013Remediation\022c\n\014instructions\030\001 \001(\0132" + + "H.google.cloud.cloudcontrolspartner.v1.V" + + "iolation.Remediation.InstructionsB\003\340A\002\022\030" + + "\n\020compliant_values\030\002 \003(\t\022j\n\020remediation_" + + "type\030\003 \001(\0162K.google.cloud.cloudcontrolsp" + + "artner.v1.Violation.Remediation.Remediat" + + "ionTypeB\003\340A\003\032\202\003\n\014Instructions\022l\n\023gcloud_" + + "instructions\030\001 \001(\0132O.google.cloud.cloudc" + + "ontrolspartner.v1.Violation.Remediation." + + "Instructions.Gcloud\022n\n\024console_instructi" + + "ons\030\002 \001(\0132P.google.cloud.cloudcontrolspa" + + "rtner.v1.Violation.Remediation.Instructi" + + "ons.Console\032J\n\006Gcloud\022\027\n\017gcloud_commands" + + "\030\001 \003(\t\022\r\n\005steps\030\002 \003(\t\022\030\n\020additional_link" + + "s\030\003 \003(\t\032H\n\007Console\022\024\n\014console_uris\030\001 \003(\t" + + "\022\r\n\005steps\030\002 \003(\t\022\030\n\020additional_links\030\003 \003(" + + "\t\"\300\002\n\017RemediationType\022 \n\034REMEDIATION_TYP" + + "E_UNSPECIFIED\020\000\022,\n(REMEDIATION_BOOLEAN_O" + + "RG_POLICY_VIOLATION\020\001\0228\n4REMEDIATION_LIS" + + "T_ALLOWED_VALUES_ORG_POLICY_VIOLATION\020\002\022" + + "7\n3REMEDIATION_LIST_DENIED_VALUES_ORG_PO" + + "LICY_VIOLATION\020\003\022F\nBREMEDIATION_RESTRICT" + + "_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIO" + + "LATION\020\004\022\"\n\036REMEDIATION_RESOURCE_VIOLATI" + + "ON\020\005\"K\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010" + + "RESOLVED\020\001\022\016\n\nUNRESOLVED\020\002\022\r\n\tEXCEPTION\020" + + "\003:\276\001\352A\272\001\n-cloudcontrolspartner.googleapi" + + "s.com/Violation\022rorganizations/{organiza" + + "tion}/locations/{location}/customers/{cu" + + "stomer}/workloads/{workload}/violations/" + + "{violation}*\nviolations2\tviolation\"\351\001\n\025L" + + "istViolationsRequest\022E\n\006parent\030\001 \001(\tB5\340A" + + "\002\372A/\022-cloudcontrolspartner.googleapis.co" + + "m/Violation\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\np" + + "age_token\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A" + + "\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\022,\n\010interval\030\006 \001" + + "(\0132\025.google.type.IntervalB\003\340A\001\"\213\001\n\026ListV" + + "iolationsResponse\022C\n\nviolations\030\001 \003(\0132/." + + "google.cloud.cloudcontrolspartner.v1.Vio" + + "lation\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unrea" + + "chable\030\003 \003(\t\"Z\n\023GetViolationRequest\022C\n\004n" + + "ame\030\001 \001(\tB5\340A\002\372A/\n-cloudcontrolspartner." + + "googleapis.com/ViolationB\223\002\n(com.google." + + "cloud.cloudcontrolspartner.v1B\017Violation" + + "sProtoP\001Z\\cloud.google.com/go/cloudcontr" + + "olspartner/apiv1/cloudcontrolspartnerpb;" + + "cloudcontrolspartnerpb\252\002$Google.Cloud.Cl" + + "oudControlsPartner.V1\312\002$Google\\Cloud\\Clo" + + "udControlsPartner\\V1\352\002\'Google::Cloud::Cl" + + "oudControlsPartner::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.type.IntervalProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_descriptor, + new java.lang.String[] { + "Name", + "Description", + "BeginTime", + "UpdateTime", + "ResolveTime", + "Category", + "State", + "NonCompliantOrgPolicy", + "FolderId", + "Remediation", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_descriptor, + new java.lang.String[] { + "Instructions", "CompliantValues", "RemediationType", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_descriptor, + new java.lang.String[] { + "GcloudInstructions", "ConsoleInstructions", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Gcloud_descriptor, + new java.lang.String[] { + "GcloudCommands", "Steps", "AdditionalLinks", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_Violation_Remediation_Instructions_Console_descriptor, + new java.lang.String[] { + "ConsoleUris", "Steps", "AdditionalLinks", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", "Interval", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_ListViolationsResponse_descriptor, + new java.lang.String[] { + "Violations", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1_GetViolationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.IntervalProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Workload.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Workload.java new file mode 100644 index 000000000000..03b37fd58cb2 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/Workload.java @@ -0,0 +1,2377 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Contains metadata around the [Workload
+ * resource](https://cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/Workload)
+ * in the Assured Workloads API.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Workload} + */ +public final class Workload extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.Workload) + WorkloadOrBuilder { + private static final long serialVersionUID = 0L; + // Use Workload.newBuilder() to construct. + private Workload(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Workload() { + name_ = ""; + folder_ = ""; + keyManagementProjectId_ = ""; + location_ = ""; + partner_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Workload(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Workload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Workload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Workload.class, + com.google.cloud.cloudcontrolspartner.v1.Workload.Builder.class); + } + + /** + * + * + *
+   * Supported Assured Workloads Partners.
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.Workload.Partner} + */ + public enum Partner implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown Partner.
+     * 
+ * + * PARTNER_UNSPECIFIED = 0; + */ + PARTNER_UNSPECIFIED(0), + /** + * + * + *
+     * Enum representing S3NS (Thales) partner.
+     * 
+ * + * PARTNER_LOCAL_CONTROLS_BY_S3NS = 1; + */ + PARTNER_LOCAL_CONTROLS_BY_S3NS(1), + /** + * + * + *
+     * Enum representing T_SYSTEM (TSI) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS = 2; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS(2), + /** + * + * + *
+     * Enum representing SIA_MINSAIT (Indra) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT = 3; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT(3), + /** + * + * + *
+     * Enum representing PSN (TIM) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_PSN = 4; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_PSN(4), + /** + * + * + *
+     * Enum representing CNTXT (Kingdom of Saudi Arabia) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT = 6; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT(6), + /** + * + * + *
+     * Enum representing CNXT (Kingdom of Saudi Arabia) partner offering without
+     * EKM provisioning.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM = 7; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown Partner.
+     * 
+ * + * PARTNER_UNSPECIFIED = 0; + */ + public static final int PARTNER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Enum representing S3NS (Thales) partner.
+     * 
+ * + * PARTNER_LOCAL_CONTROLS_BY_S3NS = 1; + */ + public static final int PARTNER_LOCAL_CONTROLS_BY_S3NS_VALUE = 1; + /** + * + * + *
+     * Enum representing T_SYSTEM (TSI) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS = 2; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS_VALUE = 2; + /** + * + * + *
+     * Enum representing SIA_MINSAIT (Indra) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT = 3; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT_VALUE = 3; + /** + * + * + *
+     * Enum representing PSN (TIM) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_PSN = 4; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_PSN_VALUE = 4; + /** + * + * + *
+     * Enum representing CNTXT (Kingdom of Saudi Arabia) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT = 6; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_VALUE = 6; + /** + * + * + *
+     * Enum representing CNXT (Kingdom of Saudi Arabia) partner offering without
+     * EKM provisioning.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM = 7; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM_VALUE = 7; + + 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 Partner 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 Partner forNumber(int value) { + switch (value) { + case 0: + return PARTNER_UNSPECIFIED; + case 1: + return PARTNER_LOCAL_CONTROLS_BY_S3NS; + case 2: + return PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS; + case 3: + return PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT; + case 4: + return PARTNER_SOVEREIGN_CONTROLS_BY_PSN; + case 6: + return PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT; + case 7: + return PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM; + 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 Partner findValueByNumber(int number) { + return Partner.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.cloud.cloudcontrolspartner.v1.Workload.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Partner[] VALUES = values(); + + public static Partner 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 Partner(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.Workload.Partner) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOLDER_ID_FIELD_NUMBER = 2; + private long folderId_ = 0L; + /** + * + * + *
+   * Output only. Folder id this workload is associated with
+   * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folderId. + */ + @java.lang.Override + public long getFolderId() { + return folderId_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 FOLDER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object folder_ = ""; + /** + * + * + *
+   * Output only. The name of container folder of the assured workload
+   * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folder. + */ + @java.lang.Override + public java.lang.String getFolder() { + java.lang.Object ref = folder_; + 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(); + folder_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of container folder of the assured workload
+   * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for folder. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFolderBytes() { + java.lang.Object ref = folder_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKLOAD_ONBOARDING_STATE_FIELD_NUMBER = 5; + private com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workloadOnboardingState_; + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return Whether the workloadOnboardingState field is set. + */ + @java.lang.Override + public boolean hasWorkloadOnboardingState() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return The workloadOnboardingState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState + getWorkloadOnboardingState() { + return workloadOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.getDefaultInstance() + : workloadOnboardingState_; + } + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStateOrBuilder + getWorkloadOnboardingStateOrBuilder() { + return workloadOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.getDefaultInstance() + : workloadOnboardingState_; + } + + public static final int IS_ONBOARDED_FIELD_NUMBER = 6; + private boolean isOnboarded_ = false; + /** + * + * + *
+   * Indicates whether a workload is fully onboarded.
+   * 
+ * + * bool is_onboarded = 6; + * + * @return The isOnboarded. + */ + @java.lang.Override + public boolean getIsOnboarded() { + return isOnboarded_; + } + + public static final int KEY_MANAGEMENT_PROJECT_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object keyManagementProjectId_ = ""; + /** + * + * + *
+   * The project id of the key management project for the workload
+   * 
+ * + * string key_management_project_id = 7; + * + * @return The keyManagementProjectId. + */ + @java.lang.Override + public java.lang.String getKeyManagementProjectId() { + java.lang.Object ref = keyManagementProjectId_; + 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(); + keyManagementProjectId_ = s; + return s; + } + } + /** + * + * + *
+   * The project id of the key management project for the workload
+   * 
+ * + * string key_management_project_id = 7; + * + * @return The bytes for keyManagementProjectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyManagementProjectIdBytes() { + java.lang.Object ref = keyManagementProjectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyManagementProjectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+   * The Google Cloud location of the workload
+   * 
+ * + * string location = 8; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * The Google Cloud location of the workload
+   * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTNER_FIELD_NUMBER = 9; + private int partner_ = 0; + /** + * + * + *
+   * Partner associated with this workload.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @return The enum numeric value on the wire for partner. + */ + @java.lang.Override + public int getPartnerValue() { + return partner_; + } + /** + * + * + *
+   * Partner associated with this workload.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @return The partner. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Workload.Partner getPartner() { + com.google.cloud.cloudcontrolspartner.v1.Workload.Partner result = + com.google.cloud.cloudcontrolspartner.v1.Workload.Partner.forNumber(partner_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.Workload.Partner.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (folderId_ != 0L) { + output.writeInt64(2, folderId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folder_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, folder_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getWorkloadOnboardingState()); + } + if (isOnboarded_ != false) { + output.writeBool(6, isOnboarded_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyManagementProjectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, keyManagementProjectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, location_); + } + if (partner_ + != com.google.cloud.cloudcontrolspartner.v1.Workload.Partner.PARTNER_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, partner_); + } + 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 (folderId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, folderId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folder_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, folder_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getWorkloadOnboardingState()); + } + if (isOnboarded_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, isOnboarded_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyManagementProjectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, keyManagementProjectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, location_); + } + if (partner_ + != com.google.cloud.cloudcontrolspartner.v1.Workload.Partner.PARTNER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, partner_); + } + 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.cloud.cloudcontrolspartner.v1.Workload)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.Workload other = + (com.google.cloud.cloudcontrolspartner.v1.Workload) obj; + + if (!getName().equals(other.getName())) return false; + if (getFolderId() != other.getFolderId()) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getFolder().equals(other.getFolder())) return false; + if (hasWorkloadOnboardingState() != other.hasWorkloadOnboardingState()) return false; + if (hasWorkloadOnboardingState()) { + if (!getWorkloadOnboardingState().equals(other.getWorkloadOnboardingState())) return false; + } + if (getIsOnboarded() != other.getIsOnboarded()) return false; + if (!getKeyManagementProjectId().equals(other.getKeyManagementProjectId())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (partner_ != other.partner_) 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) + FOLDER_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFolderId()); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + FOLDER_FIELD_NUMBER; + hash = (53 * hash) + getFolder().hashCode(); + if (hasWorkloadOnboardingState()) { + hash = (37 * hash) + WORKLOAD_ONBOARDING_STATE_FIELD_NUMBER; + hash = (53 * hash) + getWorkloadOnboardingState().hashCode(); + } + hash = (37 * hash) + IS_ONBOARDED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsOnboarded()); + hash = (37 * hash) + KEY_MANAGEMENT_PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getKeyManagementProjectId().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + PARTNER_FIELD_NUMBER; + hash = (53 * hash) + partner_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload 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.cloud.cloudcontrolspartner.v1.Workload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload 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.cloud.cloudcontrolspartner.v1.Workload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload 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.cloud.cloudcontrolspartner.v1.Workload parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload 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.cloud.cloudcontrolspartner.v1.Workload 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; + } + /** + * + * + *
+   * Contains metadata around the [Workload
+   * resource](https://cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/Workload)
+   * in the Assured Workloads API.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.Workload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.Workload) + com.google.cloud.cloudcontrolspartner.v1.WorkloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Workload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Workload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.Workload.class, + com.google.cloud.cloudcontrolspartner.v1.Workload.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.Workload.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getWorkloadOnboardingStateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + folderId_ = 0L; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + folder_ = ""; + workloadOnboardingState_ = null; + if (workloadOnboardingStateBuilder_ != null) { + workloadOnboardingStateBuilder_.dispose(); + workloadOnboardingStateBuilder_ = null; + } + isOnboarded_ = false; + keyManagementProjectId_ = ""; + location_ = ""; + partner_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_Workload_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Workload getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.Workload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Workload build() { + com.google.cloud.cloudcontrolspartner.v1.Workload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Workload buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.Workload result = + new com.google.cloud.cloudcontrolspartner.v1.Workload(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1.Workload result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.folderId_ = folderId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.folder_ = folder_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.workloadOnboardingState_ = + workloadOnboardingStateBuilder_ == null + ? workloadOnboardingState_ + : workloadOnboardingStateBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.isOnboarded_ = isOnboarded_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.keyManagementProjectId_ = keyManagementProjectId_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.partner_ = partner_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.Workload) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.Workload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1.Workload other) { + if (other == com.google.cloud.cloudcontrolspartner.v1.Workload.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFolderId() != 0L) { + setFolderId(other.getFolderId()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getFolder().isEmpty()) { + folder_ = other.folder_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasWorkloadOnboardingState()) { + mergeWorkloadOnboardingState(other.getWorkloadOnboardingState()); + } + if (other.getIsOnboarded() != false) { + setIsOnboarded(other.getIsOnboarded()); + } + if (!other.getKeyManagementProjectId().isEmpty()) { + keyManagementProjectId_ = other.keyManagementProjectId_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.partner_ != 0) { + setPartnerValue(other.getPartnerValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + folderId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + folder_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + getWorkloadOnboardingStateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + isOnboarded_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + keyManagementProjectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + partner_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long folderId_; + /** + * + * + *
+     * Output only. Folder id this workload is associated with
+     * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folderId. + */ + @java.lang.Override + public long getFolderId() { + return folderId_; + } + /** + * + * + *
+     * Output only. Folder id this workload is associated with
+     * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The folderId to set. + * @return This builder for chaining. + */ + public Builder setFolderId(long value) { + + folderId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Folder id this workload is associated with
+     * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFolderId() { + bitField0_ = (bitField0_ & ~0x00000002); + folderId_ = 0L; + 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. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 java.lang.Object folder_ = ""; + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folder. + */ + public java.lang.String getFolder() { + java.lang.Object ref = folder_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + folder_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for folder. + */ + public com.google.protobuf.ByteString getFolderBytes() { + java.lang.Object ref = folder_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The folder to set. + * @return This builder for chaining. + */ + public Builder setFolder(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + folder_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFolder() { + folder_ = getDefaultInstance().getFolder(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for folder to set. + * @return This builder for chaining. + */ + public Builder setFolderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + folder_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState + workloadOnboardingState_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStateOrBuilder> + workloadOnboardingStateBuilder_; + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return Whether the workloadOnboardingState field is set. + */ + public boolean hasWorkloadOnboardingState() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return The workloadOnboardingState. + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState + getWorkloadOnboardingState() { + if (workloadOnboardingStateBuilder_ == null) { + return workloadOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.getDefaultInstance() + : workloadOnboardingState_; + } else { + return workloadOnboardingStateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public Builder setWorkloadOnboardingState( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState value) { + if (workloadOnboardingStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workloadOnboardingState_ = value; + } else { + workloadOnboardingStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public Builder setWorkloadOnboardingState( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.Builder builderForValue) { + if (workloadOnboardingStateBuilder_ == null) { + workloadOnboardingState_ = builderForValue.build(); + } else { + workloadOnboardingStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public Builder mergeWorkloadOnboardingState( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState value) { + if (workloadOnboardingStateBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && workloadOnboardingState_ != null + && workloadOnboardingState_ + != com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState + .getDefaultInstance()) { + getWorkloadOnboardingStateBuilder().mergeFrom(value); + } else { + workloadOnboardingState_ = value; + } + } else { + workloadOnboardingStateBuilder_.mergeFrom(value); + } + if (workloadOnboardingState_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public Builder clearWorkloadOnboardingState() { + bitField0_ = (bitField0_ & ~0x00000010); + workloadOnboardingState_ = null; + if (workloadOnboardingStateBuilder_ != null) { + workloadOnboardingStateBuilder_.dispose(); + workloadOnboardingStateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.Builder + getWorkloadOnboardingStateBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getWorkloadOnboardingStateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStateOrBuilder + getWorkloadOnboardingStateOrBuilder() { + if (workloadOnboardingStateBuilder_ != null) { + return workloadOnboardingStateBuilder_.getMessageOrBuilder(); + } else { + return workloadOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.getDefaultInstance() + : workloadOnboardingState_; + } + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStateOrBuilder> + getWorkloadOnboardingStateFieldBuilder() { + if (workloadOnboardingStateBuilder_ == null) { + workloadOnboardingStateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStateOrBuilder>( + getWorkloadOnboardingState(), getParentForChildren(), isClean()); + workloadOnboardingState_ = null; + } + return workloadOnboardingStateBuilder_; + } + + private boolean isOnboarded_; + /** + * + * + *
+     * Indicates whether a workload is fully onboarded.
+     * 
+ * + * bool is_onboarded = 6; + * + * @return The isOnboarded. + */ + @java.lang.Override + public boolean getIsOnboarded() { + return isOnboarded_; + } + /** + * + * + *
+     * Indicates whether a workload is fully onboarded.
+     * 
+ * + * bool is_onboarded = 6; + * + * @param value The isOnboarded to set. + * @return This builder for chaining. + */ + public Builder setIsOnboarded(boolean value) { + + isOnboarded_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether a workload is fully onboarded.
+     * 
+ * + * bool is_onboarded = 6; + * + * @return This builder for chaining. + */ + public Builder clearIsOnboarded() { + bitField0_ = (bitField0_ & ~0x00000020); + isOnboarded_ = false; + onChanged(); + return this; + } + + private java.lang.Object keyManagementProjectId_ = ""; + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @return The keyManagementProjectId. + */ + public java.lang.String getKeyManagementProjectId() { + java.lang.Object ref = keyManagementProjectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyManagementProjectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @return The bytes for keyManagementProjectId. + */ + public com.google.protobuf.ByteString getKeyManagementProjectIdBytes() { + java.lang.Object ref = keyManagementProjectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyManagementProjectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @param value The keyManagementProjectId to set. + * @return This builder for chaining. + */ + public Builder setKeyManagementProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + keyManagementProjectId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearKeyManagementProjectId() { + keyManagementProjectId_ = getDefaultInstance().getKeyManagementProjectId(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @param value The bytes for keyManagementProjectId to set. + * @return This builder for chaining. + */ + public Builder setKeyManagementProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + keyManagementProjectId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private int partner_ = 0; + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @return The enum numeric value on the wire for partner. + */ + @java.lang.Override + public int getPartnerValue() { + return partner_; + } + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @param value The enum numeric value on the wire for partner to set. + * @return This builder for chaining. + */ + public Builder setPartnerValue(int value) { + partner_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @return The partner. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.Workload.Partner getPartner() { + com.google.cloud.cloudcontrolspartner.v1.Workload.Partner result = + com.google.cloud.cloudcontrolspartner.v1.Workload.Partner.forNumber(partner_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.Workload.Partner.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @param value The partner to set. + * @return This builder for chaining. + */ + public Builder setPartner(com.google.cloud.cloudcontrolspartner.v1.Workload.Partner value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + partner_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @return This builder for chaining. + */ + public Builder clearPartner() { + bitField0_ = (bitField0_ & ~0x00000100); + partner_ = 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.cloud.cloudcontrolspartner.v1.Workload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.Workload) + private static final com.google.cloud.cloudcontrolspartner.v1.Workload DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.Workload(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.Workload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Workload 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.cloud.cloudcontrolspartner.v1.Workload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadName.java new file mode 100644 index 000000000000..3e75f0f086e3 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class WorkloadName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + + @Deprecated + protected WorkloadName() { + organization = null; + location = null; + customer = null; + workload = null; + } + + private WorkloadName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static WorkloadName of( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build(); + } + + public static String format( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build() + .toString(); + } + + public static WorkloadName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.validatedMatch( + formattedString, "WorkloadName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload")); + } + + 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 (WorkloadName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + WorkloadName that = ((WorkloadName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + private Builder(WorkloadName workloadName) { + this.organization = workloadName.organization; + this.location = workloadName.location; + this.customer = workloadName.customer; + this.workload = workloadName.workload; + } + + public WorkloadName build() { + return new WorkloadName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingState.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingState.java new file mode 100644 index 000000000000..f1cd35e1141f --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingState.java @@ -0,0 +1,1019 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Container for workload onboarding steps.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState} + */ +public final class WorkloadOnboardingState extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState) + WorkloadOnboardingStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use WorkloadOnboardingState.newBuilder() to construct. + private WorkloadOnboardingState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WorkloadOnboardingState() { + onboardingSteps_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WorkloadOnboardingState(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.class, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.Builder.class); + } + + public static final int ONBOARDING_STEPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + onboardingSteps_; + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public java.util.List + getOnboardingStepsList() { + return onboardingSteps_; + } + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList() { + return onboardingSteps_; + } + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public int getOnboardingStepsCount() { + return onboardingSteps_.size(); + } + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep getOnboardingSteps( + int index) { + return onboardingSteps_.get(index); + } + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index) { + return onboardingSteps_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < onboardingSteps_.size(); i++) { + output.writeMessage(1, onboardingSteps_.get(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 < onboardingSteps_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, onboardingSteps_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState other = + (com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState) obj; + + if (!getOnboardingStepsList().equals(other.getOnboardingStepsList())) 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 (getOnboardingStepsCount() > 0) { + hash = (37 * hash) + ONBOARDING_STEPS_FIELD_NUMBER; + hash = (53 * hash) + getOnboardingStepsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState 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; + } + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState) + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.class, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (onboardingStepsBuilder_ == null) { + onboardingSteps_ = java.util.Collections.emptyList(); + } else { + onboardingSteps_ = null; + onboardingStepsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingState_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState build() { + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState result = + new com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState result) { + if (onboardingStepsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + onboardingSteps_ = java.util.Collections.unmodifiableList(onboardingSteps_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.onboardingSteps_ = onboardingSteps_; + } else { + result.onboardingSteps_ = onboardingStepsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState.getDefaultInstance()) + return this; + if (onboardingStepsBuilder_ == null) { + if (!other.onboardingSteps_.isEmpty()) { + if (onboardingSteps_.isEmpty()) { + onboardingSteps_ = other.onboardingSteps_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.addAll(other.onboardingSteps_); + } + onChanged(); + } + } else { + if (!other.onboardingSteps_.isEmpty()) { + if (onboardingStepsBuilder_.isEmpty()) { + onboardingStepsBuilder_.dispose(); + onboardingStepsBuilder_ = null; + onboardingSteps_ = other.onboardingSteps_; + bitField0_ = (bitField0_ & ~0x00000001); + onboardingStepsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOnboardingStepsFieldBuilder() + : null; + } else { + onboardingStepsBuilder_.addAllMessages(other.onboardingSteps_); + } + } + } + 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.parser(), + extensionRegistry); + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(m); + } else { + onboardingStepsBuilder_.addMessage(m); + } + 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.util.List + onboardingSteps_ = java.util.Collections.emptyList(); + + private void ensureOnboardingStepsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + onboardingSteps_ = + new java.util.ArrayList< + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep>(onboardingSteps_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder> + onboardingStepsBuilder_; + + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List + getOnboardingStepsList() { + if (onboardingStepsBuilder_ == null) { + return java.util.Collections.unmodifiableList(onboardingSteps_); + } else { + return onboardingStepsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public int getOnboardingStepsCount() { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.size(); + } else { + return onboardingStepsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep getOnboardingSteps( + int index) { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.get(index); + } else { + return onboardingStepsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder setOnboardingSteps( + int index, com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.set(index, value); + onChanged(); + } else { + onboardingStepsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder setOnboardingSteps( + int index, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.set(index, builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(value); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + int index, com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(index, value); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + int index, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(index, builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addAllOnboardingSteps( + java.lang.Iterable< + ? extends com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep> + values) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, onboardingSteps_); + onChanged(); + } else { + onboardingStepsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder clearOnboardingSteps() { + if (onboardingStepsBuilder_ == null) { + onboardingSteps_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + onboardingStepsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder removeOnboardingSteps(int index) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.remove(index); + onChanged(); + } else { + onboardingStepsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder + getOnboardingStepsBuilder(int index) { + return getOnboardingStepsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index) { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.get(index); + } else { + return onboardingStepsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList() { + if (onboardingStepsBuilder_ != null) { + return onboardingStepsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(onboardingSteps_); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder + addOnboardingStepsBuilder() { + return getOnboardingStepsFieldBuilder() + .addBuilder( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.getDefaultInstance()); + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder + addOnboardingStepsBuilder(int index) { + return getOnboardingStepsFieldBuilder() + .addBuilder( + index, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.getDefaultInstance()); + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List + getOnboardingStepsBuilderList() { + return getOnboardingStepsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder> + getOnboardingStepsFieldBuilder() { + if (onboardingStepsBuilder_ == null) { + onboardingStepsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder>( + onboardingSteps_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + onboardingSteps_ = null; + } + return onboardingStepsBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState) + private static final com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStateOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStateOrBuilder.java new file mode 100644 index 000000000000..9e6c27f6818d --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStateOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface WorkloadOnboardingStateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + java.util.List + getOnboardingStepsList(); + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep getOnboardingSteps(int index); + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + int getOnboardingStepsCount(); + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + java.util.List + getOnboardingStepsOrBuilderList(); + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStep.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStep.java new file mode 100644 index 000000000000..dbe8dfc8bdfd --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStep.java @@ -0,0 +1,1478 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +/** + * + * + *
+ * Container for workload onboarding information.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep} + */ +public final class WorkloadOnboardingStep extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep) + WorkloadOnboardingStepOrBuilder { + private static final long serialVersionUID = 0L; + // Use WorkloadOnboardingStep.newBuilder() to construct. + private WorkloadOnboardingStep(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WorkloadOnboardingStep() { + step_ = 0; + completionState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WorkloadOnboardingStep(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.class, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder.class); + } + + /** + * + * + *
+   * Enum for possible onboarding steps.
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step} + */ + public enum Step implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified step.
+     * 
+ * + * STEP_UNSPECIFIED = 0; + */ + STEP_UNSPECIFIED(0), + /** + * + * + *
+     * EKM Provisioned step.
+     * 
+ * + * EKM_PROVISIONED = 1; + */ + EKM_PROVISIONED(1), + /** + * + * + *
+     * Signed Access Approval step.
+     * 
+ * + * SIGNED_ACCESS_APPROVAL_CONFIGURED = 2; + */ + SIGNED_ACCESS_APPROVAL_CONFIGURED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified step.
+     * 
+ * + * STEP_UNSPECIFIED = 0; + */ + public static final int STEP_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * EKM Provisioned step.
+     * 
+ * + * EKM_PROVISIONED = 1; + */ + public static final int EKM_PROVISIONED_VALUE = 1; + /** + * + * + *
+     * Signed Access Approval step.
+     * 
+ * + * SIGNED_ACCESS_APPROVAL_CONFIGURED = 2; + */ + public static final int SIGNED_ACCESS_APPROVAL_CONFIGURED_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 Step 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 Step forNumber(int value) { + switch (value) { + case 0: + return STEP_UNSPECIFIED; + case 1: + return EKM_PROVISIONED; + case 2: + return SIGNED_ACCESS_APPROVAL_CONFIGURED; + 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 Step findValueByNumber(int number) { + return Step.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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Step[] VALUES = values(); + + public static Step 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 Step(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step) + } + + private int bitField0_; + public static final int STEP_FIELD_NUMBER = 1; + private int step_ = 0; + /** + * + * + *
+   * The onboarding step.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+   * The onboarding step.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step getStep() { + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step result = + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step.forNumber(step_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step.UNRECOGNIZED + : result; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int COMPLETION_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp completionTime_; + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + @java.lang.Override + public boolean hasCompletionTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCompletionTime() { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder() { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + + public static final int COMPLETION_STATE_FIELD_NUMBER = 4; + private int completionState_ = 0; + /** + * + * + *
+   * Output only. The completion state of the onboarding step.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + @java.lang.Override + public int getCompletionStateValue() { + return completionState_; + } + /** + * + * + *
+   * Output only. The completion state of the onboarding step.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CompletionState getCompletionState() { + com.google.cloud.cloudcontrolspartner.v1.CompletionState result = + com.google.cloud.cloudcontrolspartner.v1.CompletionState.forNumber(completionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.CompletionState.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 (step_ + != com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step.STEP_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, step_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getCompletionTime()); + } + if (completionState_ + != com.google.cloud.cloudcontrolspartner.v1.CompletionState.COMPLETION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, completionState_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (step_ + != com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step.STEP_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, step_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCompletionTime()); + } + if (completionState_ + != com.google.cloud.cloudcontrolspartner.v1.CompletionState.COMPLETION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, completionState_); + } + 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep other = + (com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep) obj; + + if (step_ != other.step_) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasCompletionTime() != other.hasCompletionTime()) return false; + if (hasCompletionTime()) { + if (!getCompletionTime().equals(other.getCompletionTime())) return false; + } + if (completionState_ != other.completionState_) 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) + STEP_FIELD_NUMBER; + hash = (53 * hash) + step_; + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasCompletionTime()) { + hash = (37 * hash) + COMPLETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCompletionTime().hashCode(); + } + hash = (37 * hash) + COMPLETION_STATE_FIELD_NUMBER; + hash = (53 * hash) + completionState_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep 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; + } + /** + * + * + *
+   * Container for workload onboarding information.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep) + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStepOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.class, + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getCompletionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + step_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + completionTime_ = null; + if (completionTimeBuilder_ != null) { + completionTimeBuilder_.dispose(); + completionTimeBuilder_ = null; + } + completionState_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1_WorkloadOnboardingStep_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep build() { + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep buildPartial() { + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep result = + new com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.step_ = step_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.completionTime_ = + completionTimeBuilder_ == null ? completionTime_ : completionTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.completionState_ = completionState_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.getDefaultInstance()) + return this; + if (other.step_ != 0) { + setStepValue(other.getStepValue()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasCompletionTime()) { + mergeCompletionTime(other.getCompletionTime()); + } + if (other.completionState_ != 0) { + setCompletionStateValue(other.getCompletionStateValue()); + } + 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: + { + step_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCompletionTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + completionState_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 int step_ = 0; + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @param value The enum numeric value on the wire for step to set. + * @return This builder for chaining. + */ + public Builder setStepValue(int value) { + step_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step getStep() { + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step result = + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step.forNumber(step_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @param value The step to set. + * @return This builder for chaining. + */ + public Builder setStep( + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + step_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @return This builder for chaining. + */ + public Builder clearStep() { + bitField0_ = (bitField0_ & ~0x00000001); + step_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp completionTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + completionTimeBuilder_; + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + public boolean hasCompletionTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + public com.google.protobuf.Timestamp getCompletionTime() { + if (completionTimeBuilder_ == null) { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } else { + return completionTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder setCompletionTime(com.google.protobuf.Timestamp value) { + if (completionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionTime_ = value; + } else { + completionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder setCompletionTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (completionTimeBuilder_ == null) { + completionTime_ = builderForValue.build(); + } else { + completionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder mergeCompletionTime(com.google.protobuf.Timestamp value) { + if (completionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && completionTime_ != null + && completionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCompletionTimeBuilder().mergeFrom(value); + } else { + completionTime_ = value; + } + } else { + completionTimeBuilder_.mergeFrom(value); + } + if (completionTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder clearCompletionTime() { + bitField0_ = (bitField0_ & ~0x00000004); + completionTime_ = null; + if (completionTimeBuilder_ != null) { + completionTimeBuilder_.dispose(); + completionTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCompletionTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCompletionTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder() { + if (completionTimeBuilder_ != null) { + return completionTimeBuilder_.getMessageOrBuilder(); + } else { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCompletionTimeFieldBuilder() { + if (completionTimeBuilder_ == null) { + completionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCompletionTime(), getParentForChildren(), isClean()); + completionTime_ = null; + } + return completionTimeBuilder_; + } + + private int completionState_ = 0; + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + @java.lang.Override + public int getCompletionStateValue() { + return completionState_; + } + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for completionState to set. + * @return This builder for chaining. + */ + public Builder setCompletionStateValue(int value) { + completionState_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1.CompletionState getCompletionState() { + com.google.cloud.cloudcontrolspartner.v1.CompletionState result = + com.google.cloud.cloudcontrolspartner.v1.CompletionState.forNumber(completionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1.CompletionState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The completionState to set. + * @return This builder for chaining. + */ + public Builder setCompletionState( + com.google.cloud.cloudcontrolspartner.v1.CompletionState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + completionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCompletionState() { + bitField0_ = (bitField0_ & ~0x00000008); + completionState_ = 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep) + private static final com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep(); + } + + public static com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStepOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStepOrBuilder.java new file mode 100644 index 000000000000..6a56d99c8563 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOnboardingStepOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface WorkloadOnboardingStepOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The onboarding step.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + int getStepValue(); + /** + * + * + *
+   * The onboarding step.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step step = 1; + * + * @return The step. + */ + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStep.Step getStep(); + + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + boolean hasCompletionTime(); + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + com.google.protobuf.Timestamp getCompletionTime(); + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The completion state of the onboarding step.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + int getCompletionStateValue(); + /** + * + * + *
+   * Output only. The completion state of the onboarding step.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + com.google.cloud.cloudcontrolspartner.v1.CompletionState getCompletionState(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOrBuilder.java new file mode 100644 index 000000000000..71897f6d3b42 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/java/com/google/cloud/cloudcontrolspartner/v1/WorkloadOrBuilder.java @@ -0,0 +1,259 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1; + +public interface WorkloadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1.Workload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Folder id this workload is associated with
+   * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folderId. + */ + long getFolderId(); + + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The name of container folder of the assured workload
+   * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folder. + */ + java.lang.String getFolder(); + /** + * + * + *
+   * Output only. The name of container folder of the assured workload
+   * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for folder. + */ + com.google.protobuf.ByteString getFolderBytes(); + + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return Whether the workloadOnboardingState field is set. + */ + boolean hasWorkloadOnboardingState(); + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return The workloadOnboardingState. + */ + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState getWorkloadOnboardingState(); + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + com.google.cloud.cloudcontrolspartner.v1.WorkloadOnboardingStateOrBuilder + getWorkloadOnboardingStateOrBuilder(); + + /** + * + * + *
+   * Indicates whether a workload is fully onboarded.
+   * 
+ * + * bool is_onboarded = 6; + * + * @return The isOnboarded. + */ + boolean getIsOnboarded(); + + /** + * + * + *
+   * The project id of the key management project for the workload
+   * 
+ * + * string key_management_project_id = 7; + * + * @return The keyManagementProjectId. + */ + java.lang.String getKeyManagementProjectId(); + /** + * + * + *
+   * The project id of the key management project for the workload
+   * 
+ * + * string key_management_project_id = 7; + * + * @return The bytes for keyManagementProjectId. + */ + com.google.protobuf.ByteString getKeyManagementProjectIdBytes(); + + /** + * + * + *
+   * The Google Cloud location of the workload
+   * 
+ * + * string location = 8; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * The Google Cloud location of the workload
+   * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Partner associated with this workload.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @return The enum numeric value on the wire for partner. + */ + int getPartnerValue(); + /** + * + * + *
+   * Partner associated with this workload.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1.Workload.Partner partner = 9; + * + * @return The partner. + */ + com.google.cloud.cloudcontrolspartner.v1.Workload.Partner getPartner(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto new file mode 100644 index 000000000000..42dfa2229d52 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto @@ -0,0 +1,146 @@ +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessApprovalRequestsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// Details about the Access request. +message AccessApprovalRequest { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/AccessApprovalRequest" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}" + plural: "accessApprovalRequests" + singular: "accessApprovalRequest" + }; + + // Identifier. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The time at which approval was requested. + google.protobuf.Timestamp request_time = 2; + + // The justification for which approval is being requested. + AccessReason requested_reason = 3; + + // The requested expiration for the approval. If the request is approved, + // access will be granted from the time of approval until the expiration time. + google.protobuf.Timestamp requested_expiration_time = 4; +} + +// Request for getting the access requests associated with a workload. +message ListAccessApprovalRequestsRequest { + // Required. Parent resource + // Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/AccessApprovalRequest" + } + ]; + + // Optional. The maximum number of access requests to return. The service may + // return fewer than this value. If unspecified, at most 500 access requests + // will be returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent + // page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for list access requests. +message ListAccessApprovalRequestsResponse { + // List of access approval requests + repeated AccessApprovalRequest access_approval_requests = 1; + + // A token that 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; +} + +// Reason for the access. +message AccessReason { + // Type of access justification. + enum Type { + // Default value for proto, shouldn't be used. + TYPE_UNSPECIFIED = 0; + + // Customer made a request or raised an issue that required the principal to + // access customer data. `detail` is of the form ("#####" is the issue ID): + // + // - "Feedback Report: #####" + // - "Case Number: #####" + // - "Case ID: #####" + // - "E-PIN Reference: #####" + // - "Google-#####" + // - "T-#####" + CUSTOMER_INITIATED_SUPPORT = 1; + + // The principal accessed customer data in order to diagnose or resolve a + // suspected issue in services. Often this access is used to confirm that + // customers are not affected by a suspected service issue or to remediate a + // reversible system issue. + GOOGLE_INITIATED_SERVICE = 2; + + // Google initiated service for security, fraud, abuse, or compliance + // purposes. + GOOGLE_INITIATED_REVIEW = 3; + + // The principal was compelled to access customer data in order to respond + // to a legal third party data request or process, including legal processes + // from customers themselves. + THIRD_PARTY_DATA_REQUEST = 4; + + // The principal accessed customer data in order to diagnose or resolve a + // suspected issue in services or a known outage. + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 5; + + // Similar to 'GOOGLE_INITIATED_SERVICE' or 'GOOGLE_INITIATED_REVIEW', but + // with universe agnostic naming. The principal accessed customer data in + // order to diagnose or resolve a suspected issue in services or a known + // outage, or for security, fraud, abuse, or compliance review purposes. + CLOUD_INITIATED_ACCESS = 6; + } + + // Type of access justification. + Type type = 1; + + // More detail about certain reason types. See comments for each type above. + string detail = 2; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/completion_state.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/completion_state.proto new file mode 100644 index 000000000000..54ed3cb940c1 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/completion_state.proto @@ -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 +// +// 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.cloud.cloudcontrolspartner.v1; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "CompletionStateProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// Enum for possible completion states. +enum CompletionState { + // Unspecified completion state. + COMPLETION_STATE_UNSPECIFIED = 0; + + // Task started (has start date) but not yet completed. + PENDING = 1; + + // Succeeded state. + SUCCEEDED = 2; + + // Failed state. + FAILED = 3; + + // Not applicable state. + NOT_APPLICABLE = 4; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/core.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/core.proto new file mode 100644 index 000000000000..121ec502c8c0 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/core.proto @@ -0,0 +1,144 @@ +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto"; +import "google/cloud/cloudcontrolspartner/v1/customer_workloads.proto"; +import "google/cloud/cloudcontrolspartner/v1/customers.proto"; +import "google/cloud/cloudcontrolspartner/v1/ekm_connections.proto"; +import "google/cloud/cloudcontrolspartner/v1/partner_permissions.proto"; +import "google/cloud/cloudcontrolspartner/v1/partners.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "CoreProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; +option (google.api.resource_definition) = { + type: "cloudcontrolspartner.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Service describing handlers for resources +service CloudControlsPartnerCore { + option (google.api.default_host) = "cloudcontrolspartner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets details of a single workload + rpc GetWorkload(GetWorkloadRequest) returns (Workload) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/customers/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists customer workloads for a given customer org id + rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*/customers/*}/workloads" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single customer + rpc GetCustomer(GetCustomerRequest) returns (Customer) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/customers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists customers of a partner identified by its Google Cloud organization ID + rpc ListCustomers(ListCustomersRequest) returns (ListCustomersResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/customers" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the EKM connections associated with a workload + rpc GetEkmConnections(GetEkmConnectionsRequest) returns (EkmConnections) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/customers/*/workloads/*/ekmConnections}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the partner permissions granted for a workload + rpc GetPartnerPermissions(GetPartnerPermissionsRequest) + returns (PartnerPermissions) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/customers/*/workloads/*/partnerPermissions}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists access requests associated with a workload + rpc ListAccessApprovalRequests(ListAccessApprovalRequestsRequest) + returns (ListAccessApprovalRequestsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests" + }; + option (google.api.method_signature) = "parent"; + } + + // Get details of a Partner. + rpc GetPartner(GetPartnerRequest) returns (Partner) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/partner}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have been cancelled successfully + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/customer_workloads.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/customer_workloads.proto new file mode 100644 index 000000000000..8511f8bdd97f --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/customer_workloads.proto @@ -0,0 +1,182 @@ +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/cloudcontrolspartner/v1/completion_state.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "CustomerWorkloadsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// Contains metadata around the [Workload +// resource](https://cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/Workload) +// in the Assured Workloads API. +message Workload { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/Workload" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}" + plural: "workloads" + singular: "workload" + }; + + // Supported Assured Workloads Partners. + enum Partner { + // Unknown Partner. + PARTNER_UNSPECIFIED = 0; + + // Enum representing S3NS (Thales) partner. + PARTNER_LOCAL_CONTROLS_BY_S3NS = 1; + + // Enum representing T_SYSTEM (TSI) partner. + PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS = 2; + + // Enum representing SIA_MINSAIT (Indra) partner. + PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT = 3; + + // Enum representing PSN (TIM) partner. + PARTNER_SOVEREIGN_CONTROLS_BY_PSN = 4; + + // Enum representing CNTXT (Kingdom of Saudi Arabia) partner. + PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT = 6; + + // Enum representing CNXT (Kingdom of Saudi Arabia) partner offering without + // EKM provisioning. + PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM = 7; + } + + // Identifier. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Folder id this workload is associated with + int64 folder_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time the resource was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of container folder of the assured workload + string folder = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Container for workload onboarding steps. + WorkloadOnboardingState workload_onboarding_state = 5; + + // Indicates whether a workload is fully onboarded. + bool is_onboarded = 6; + + // The project id of the key management project for the workload + string key_management_project_id = 7; + + // The Google Cloud location of the workload + string location = 8; + + // Partner associated with this workload. + Partner partner = 9; +} + +// Request to list customer workloads. +message ListWorkloadsRequest { + // Required. Parent resource + // Format: + // `organizations/{organization}/locations/{location}/customers/{customer}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/Workload" + } + ]; + + // The maximum number of workloads to return. The service may return fewer + // than this value. If unspecified, at most 500 workloads will be returned. + int32 page_size = 2; + + // A page token, received from a previous `ListWorkloads` call. + // Provide this to retrieve the subsequent page. + string page_token = 3; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for list customer workloads requests. +message ListWorkloadsResponse { + // List of customer workloads + repeated Workload workloads = 1; + + // A token that 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 customer workload. +message GetWorkloadRequest { + // Required. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Workload" + } + ]; +} + +// Container for workload onboarding steps. +message WorkloadOnboardingState { + // List of workload onboarding steps. + repeated WorkloadOnboardingStep onboarding_steps = 1; +} + +// Container for workload onboarding information. +message WorkloadOnboardingStep { + // Enum for possible onboarding steps. + enum Step { + // Unspecified step. + STEP_UNSPECIFIED = 0; + + // EKM Provisioned step. + EKM_PROVISIONED = 1; + + // Signed Access Approval step. + SIGNED_ACCESS_APPROVAL_CONFIGURED = 2; + } + + // The onboarding step. + Step step = 1; + + // The starting time of the onboarding step. + google.protobuf.Timestamp start_time = 2; + + // The completion time of the onboarding step. + google.protobuf.Timestamp completion_time = 3; + + // Output only. The completion state of the onboarding step. + CompletionState completion_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/customers.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/customers.proto new file mode 100644 index 000000000000..fdbb246b0d94 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/customers.proto @@ -0,0 +1,138 @@ +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/cloudcontrolspartner/v1/completion_state.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "CustomersProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// Contains metadata around a Cloud Controls Partner Customer +message Customer { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/Customer" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}" + plural: "customers" + singular: "customer" + }; + + // Identifier. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The customer organization's display name. E.g. "google.com". + string display_name = 2; + + // Container for customer onboarding steps + CustomerOnboardingState customer_onboarding_state = 3; + + // Indicates whether a customer is fully onboarded + bool is_onboarded = 4; +} + +// Request to list customers +message ListCustomersRequest { + // Required. Parent resource + // Format: `organizations/{organization}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/Customer" + } + ]; + + // The maximum number of Customers to return. The service may return fewer + // than this value. If unspecified, at most 500 Customers will be returned. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomers` call. + // Provide this to retrieve the subsequent page. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for list customer Customers requests +message ListCustomersResponse { + // List of customers + repeated Customer customers = 1; + + // A token that 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 customer +message GetCustomerRequest { + // Required. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Customer" + } + ]; +} + +// Container for customer onboarding steps +message CustomerOnboardingState { + // List of customer onboarding steps + repeated CustomerOnboardingStep onboarding_steps = 1; +} + +// Container for customer onboarding information +message CustomerOnboardingStep { + // Enum for possible onboarding steps + enum Step { + // Unspecified step + STEP_UNSPECIFIED = 0; + + // KAJ Enrollment + KAJ_ENROLLMENT = 1; + + // Customer Environment + CUSTOMER_ENVIRONMENT = 2; + } + + // The onboarding step + Step step = 1; + + // The starting time of the onboarding step + google.protobuf.Timestamp start_time = 2; + + // The completion time of the onboarding step + google.protobuf.Timestamp completion_time = 3; + + // Output only. Current state of the step + CompletionState completion_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/ekm_connections.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/ekm_connections.proto new file mode 100644 index 000000000000..7195ef2ca604 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/ekm_connections.proto @@ -0,0 +1,97 @@ +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "EkmConnectionsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// The EKM connections associated with a workload +message EkmConnections { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/EkmConnections" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections" + }; + + // Identifier. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The EKM connections associated with the workload + repeated EkmConnection ekm_connections = 2; +} + +// Request for getting the EKM connections associated with a workload +message GetEkmConnectionsRequest { + // Required. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/EkmConnections" + } + ]; +} + +// Details about the EKM connection +message EkmConnection { + // Information around the error that occurred if the connection state is + // anything other than available or unspecified + message ConnectionError { + // The error domain for the error + string error_domain = 1; + + // The error message for the error + string error_message = 2; + } + + // The EKM connection state. + enum ConnectionState { + // Unspecified EKM connection state + CONNECTION_STATE_UNSPECIFIED = 0; + + // Available EKM connection state + AVAILABLE = 1; + + // Not available EKM connection state + NOT_AVAILABLE = 2; + + // Error EKM connection state + ERROR = 3; + + // Permission denied EKM connection state + PERMISSION_DENIED = 4; + } + + // Resource name of the EKM connection in the format: + // projects/{project}/locations/{location}/ekmConnections/{ekm_connection} + string connection_name = 1; + + // Output only. The connection state + ConnectionState connection_state = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The connection error that occurred if any + ConnectionError connection_error = 3; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/monitoring.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/monitoring.proto new file mode 100644 index 000000000000..0faddab72b6e --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/monitoring.proto @@ -0,0 +1,58 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/cloudcontrolspartner/v1/violations.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "MonitoringProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// Service describing handlers for resources +service CloudControlsPartnerMonitoring { + option (google.api.default_host) = "cloudcontrolspartner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Violations for a workload + // Callers may also choose to read across multiple Customers or for a single + // customer as per + // [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash + // character) as a wildcard character instead of {customer} & {workload}. + // Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + rpc ListViolations(ListViolationsRequest) returns (ListViolationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*/customers/*/workloads/*}/violations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Violation. + rpc GetViolation(GetViolationRequest) returns (Violation) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/customers/*/workloads/*/violations/*}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/partner_permissions.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/partner_permissions.proto new file mode 100644 index 000000000000..478dfe2eeea8 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/partner_permissions.proto @@ -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 +// +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "PartnerPermissionsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// The permissions granted to the partner for a workload +message PartnerPermissions { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/PartnerPermissions" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions" + }; + + enum Permission { + // Unspecified partner permission + PERMISSION_UNSPECIFIED = 0; + + // Permission for Access Transparency and emergency logs + ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS = 1; + + // Permission for Assured Workloads monitoring violations + ASSURED_WORKLOADS_MONITORING = 2; + + // Permission for Access Approval requests + ACCESS_APPROVAL_REQUESTS = 3; + + // Permission for External Key Manager connection status + ASSURED_WORKLOADS_EKM_CONNECTION_STATUS = 4; + } + + // Identifier. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The partner permissions granted for the workload + repeated Permission partner_permissions = 2; +} + +// Request for getting the partner permissions granted for a workload +message GetPartnerPermissionsRequest { + // Required. Name of the resource to get in the format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/PartnerPermissions" + } + ]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/partners.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/partners.proto new file mode 100644 index 000000000000..8be8b6579e68 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/partners.proto @@ -0,0 +1,121 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "PartnersProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// Message describing Partner resource +message Partner { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/Partner" + pattern: "organizations/{organization}/locations/{location}/partner" + singular: "partner" + }; + + // Identifier. The resource name of the partner. + // Format: `organizations/{organization}/locations/{location}/partner` + // Example: "organizations/123456/locations/us-central1/partner" + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // List of SKUs the partner is offering + repeated Sku skus = 3; + + // List of Google Cloud supported EKM partners supported by the partner + repeated EkmMetadata ekm_solutions = 4; + + // List of Google Cloud regions that the partner sells services to customers. + // Valid Google Cloud regions found here: + // https://cloud.google.com/compute/docs/regions-zones + repeated string operated_cloud_regions = 5; + + // Google Cloud project ID in the partner's Google Cloud organization for + // receiving enhanced Logs for Partners. + string partner_project_id = 7; + + // Output only. Time the resource was created + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the resource was updated + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for getting a Partner +message GetPartnerRequest { + // Required. Format: + // `organizations/{organization}/locations/{location}/partner` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Partner" + } + ]; +} + +// Represents the SKU a partner owns inside Google Cloud to sell to customers. +message Sku { + // Argentum product SKU, that is associated with the partner offerings to + // customers used by Syntro for billing purposes. SKUs can represent resold + // Google products or support services. + string id = 1; + + // Display name of the product identified by the SKU. A partner may want to + // show partner branded names for their offerings such as local sovereign + // cloud solutions. + string display_name = 2; +} + +// Holds information needed by Mudbray to use partner EKMs for workloads. +message EkmMetadata { + // Represents Google Cloud supported external key management partners + // [Google Cloud EKM partners + // docs](https://cloud.google.com/kms/docs/ekm#supported_partners). + enum EkmSolution { + // Unspecified EKM solution + EKM_SOLUTION_UNSPECIFIED = 0; + + // EKM Partner Fortanix + FORTANIX = 1; + + // EKM Partner FutureX + FUTUREX = 2; + + // EKM Partner Thales + THALES = 3; + + // EKM Partner Virtu + VIRTRU = 4; + } + + // The Cloud EKM partner. + EkmSolution ekm_solution = 1; + + // Endpoint for sending requests to the EKM for key provisioning during + // Assured Workload creation. + string ekm_endpoint_uri = 2; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/violations.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/violations.proto new file mode 100644 index 000000000000..e77e40ae3024 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1/src/main/proto/google/cloud/cloudcontrolspartner/v1/violations.proto @@ -0,0 +1,233 @@ +// 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.cloud.cloudcontrolspartner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "ViolationsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1"; + +// Details of resource Violation +message Violation { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/Violation" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}" + plural: "violations" + singular: "violation" + }; + + // Represents remediation guidance to resolve compliance violation for + // AssuredWorkload + message Remediation { + // Instructions to remediate violation + message Instructions { + // Remediation instructions to resolve violation via gcloud cli + message Gcloud { + // Gcloud command to resolve violation + repeated string gcloud_commands = 1; + + // Steps to resolve violation via gcloud cli + repeated string steps = 2; + + // Additional urls for more information about steps + repeated string additional_links = 3; + } + + // Remediation instructions to resolve violation via cloud console + message Console { + // Link to console page where violations can be resolved + repeated string console_uris = 1; + + // Steps to resolve violation via cloud console + repeated string steps = 2; + + // Additional urls for more information about steps + repeated string additional_links = 3; + } + + // Remediation instructions to resolve violation via gcloud cli + Gcloud gcloud_instructions = 1; + + // Remediation instructions to resolve violation via cloud console + Console console_instructions = 2; + } + + // Classifying remediation into various types based on the kind of + // violation. For example, violations caused due to changes in boolean org + // policy requires different remediation instructions compared to violation + // caused due to changes in allowed values of list org policy. + enum RemediationType { + // Unspecified remediation type + REMEDIATION_TYPE_UNSPECIFIED = 0; + + // Remediation type for boolean org policy + REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + + // Remediation type for list org policy which have allowed values in the + // monitoring rule + REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + + // Remediation type for list org policy which have denied values in the + // monitoring rule + REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + + // Remediation type for gcp.restrictCmekCryptoKeyProjects + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + + // Remediation type for resource violation. + REMEDIATION_RESOURCE_VIOLATION = 5; + } + + // Required. Remediation instructions to resolve violations + Instructions instructions = 1 [(google.api.field_behavior) = REQUIRED]; + + // Values that can resolve the violation + // For example: for list org policy violations, this will either be the list + // of allowed or denied values + repeated string compliant_values = 2; + + // Output only. Remediation type based on the type of org policy values + // violated + RemediationType remediation_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Violation State Values + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Violation is resolved. + RESOLVED = 1; + + // Violation is Unresolved + UNRESOLVED = 2; + + // Violation is Exception + EXCEPTION = 3; + } + + // Identifier. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Description for the Violation. + // e.g. OrgPolicy gcp.resourceLocations has non compliant value. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time of the event which triggered the Violation. + google.protobuf.Timestamp begin_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time when the Violation record was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time of the event which fixed the Violation. + // If the violation is ACTIVE this will be empty. + google.protobuf.Timestamp resolve_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Category under which this violation is mapped. + // e.g. Location, Service Usage, Access, Encryption, etc. + string category = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the violation + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Immutable. Name of the OrgPolicy which was modified with + // non-compliant change and resulted this violation. Format: + // `projects/{project_number}/policies/{constraint_name}` + // `folders/{folder_id}/policies/{constraint_name}` + // `organizations/{organization_id}/policies/{constraint_name}` + string non_compliant_org_policy = 8 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // The folder_id of the violation + int64 folder_id = 9; + + // Output only. Compliance violation remediation + Remediation remediation = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for requesting list of Violations +message ListViolationsRequest { + // Required. Parent resource + // Format + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/Violation" + } + ]; + + // Optional. The maximum number of customers row to return. The service may + // return fewer than this value. If unspecified, at most 10 customers will be + // returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListViolations` call. + // Provide this to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the interval for retrieving violations. + // if unspecified, all violations will be returned. + google.type.Interval interval = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for list customer violation requests +message ListViolationsResponse { + // List of violation + repeated Violation violations = 1; + + // A token that 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; + + // Workloads that could not be reached due to permission errors or any other + // error. Ref: https://google.aip.dev/217 + repeated string unreachable = 3; +} + +// Message for getting a Violation +message GetViolationRequest { + // Required. Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Violation" + } + ]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/clirr-ignored-differences.xml b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..1f7b429cc394 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/cloudcontrolspartner/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/cloudcontrolspartner/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/cloudcontrolspartner/v1beta/*OrBuilder + boolean has*(*) + + diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/pom.xml b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/pom.xml new file mode 100644 index 000000000000..357cccf7ed67 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-cloudcontrolspartner-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-cloudcontrolspartner-v1beta + Proto library for google-cloud-cloudcontrolspartner + + com.google.cloud + google-cloud-cloudcontrolspartner-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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequest.java new file mode 100644 index 000000000000..c2d5d7465548 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequest.java @@ -0,0 +1,1482 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Details about the Access request.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest} + */ +public final class AccessApprovalRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest) + AccessApprovalRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessApprovalRequest.newBuilder() to construct. + private AccessApprovalRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessApprovalRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessApprovalRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp requestTime_; + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + @java.lang.Override + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestTime() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; + } + + public static final int REQUESTED_REASON_FIELD_NUMBER = 3; + private com.google.cloud.cloudcontrolspartner.v1beta.AccessReason requestedReason_; + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + @java.lang.Override + public boolean hasRequestedReason() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReason getRequestedReason() { + return requestedReason_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.getDefaultInstance() + : requestedReason_; + } + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReasonOrBuilder + getRequestedReasonOrBuilder() { + return requestedReason_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.getDefaultInstance() + : requestedReason_; + } + + public static final int REQUESTED_EXPIRATION_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp requestedExpirationTime_; + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return Whether the requestedExpirationTime field is set. + */ + @java.lang.Override + public boolean hasRequestedExpirationTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return The requestedExpirationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRequestedExpirationTime() { + return requestedExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpirationTime_; + } + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRequestedExpirationTimeOrBuilder() { + return requestedExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpirationTime_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRequestTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getRequestedReason()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getRequestedExpirationTime()); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestedReason()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getRequestedExpirationTime()); + } + 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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasRequestTime() != other.hasRequestTime()) return false; + if (hasRequestTime()) { + if (!getRequestTime().equals(other.getRequestTime())) return false; + } + if (hasRequestedReason() != other.hasRequestedReason()) return false; + if (hasRequestedReason()) { + if (!getRequestedReason().equals(other.getRequestedReason())) return false; + } + if (hasRequestedExpirationTime() != other.hasRequestedExpirationTime()) return false; + if (hasRequestedExpirationTime()) { + if (!getRequestedExpirationTime().equals(other.getRequestedExpirationTime())) 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 (hasRequestTime()) { + hash = (37 * hash) + REQUEST_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestTime().hashCode(); + } + if (hasRequestedReason()) { + hash = (37 * hash) + REQUESTED_REASON_FIELD_NUMBER; + hash = (53 * hash) + getRequestedReason().hashCode(); + } + if (hasRequestedExpirationTime()) { + hash = (37 * hash) + REQUESTED_EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRequestedExpirationTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + 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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest 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; + } + /** + * + * + *
+   * Details about the Access request.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest) + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRequestTimeFieldBuilder(); + getRequestedReasonFieldBuilder(); + getRequestedExpirationTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + requestedReason_ = null; + if (requestedReasonBuilder_ != null) { + requestedReasonBuilder_.dispose(); + requestedReasonBuilder_ = null; + } + requestedExpirationTime_ = null; + if (requestedExpirationTimeBuilder_ != null) { + requestedExpirationTimeBuilder_.dispose(); + requestedExpirationTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestedReason_ = + requestedReasonBuilder_ == null ? requestedReason_ : requestedReasonBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestedExpirationTime_ = + requestedExpirationTimeBuilder_ == null + ? requestedExpirationTime_ + : requestedExpirationTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasRequestTime()) { + mergeRequestTime(other.getRequestTime()); + } + if (other.hasRequestedReason()) { + mergeRequestedReason(other.getRequestedReason()); + } + if (other.hasRequestedExpirationTime()) { + mergeRequestedExpirationTime(other.getRequestedExpirationTime()); + } + 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: + { + input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getRequestedReasonFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + getRequestedExpirationTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp requestTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestTimeBuilder_; + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + public boolean hasRequestTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + public com.google.protobuf.Timestamp getRequestTime() { + if (requestTimeBuilder_ == null) { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } else { + return requestTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestTime_ = value; + } else { + requestTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestTimeBuilder_ == null) { + requestTime_ = builderForValue.build(); + } else { + requestTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { + if (requestTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); + } else { + requestTime_ = value; + } + } else { + requestTimeBuilder_.mergeFrom(value); + } + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public Builder clearRequestTime() { + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); + requestTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRequestTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { + if (requestTimeBuilder_ != null) { + return requestTimeBuilder_.getMessageOrBuilder(); + } else { + return requestTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestTime_; + } + } + /** + * + * + *
+     * The time at which approval was requested.
+     * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestTime(), getParentForChildren(), isClean()); + requestTime_ = null; + } + return requestTimeBuilder_; + } + + private com.google.cloud.cloudcontrolspartner.v1beta.AccessReason requestedReason_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason, + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.AccessReasonOrBuilder> + requestedReasonBuilder_; + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + public boolean hasRequestedReason() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReason getRequestedReason() { + if (requestedReasonBuilder_ == null) { + return requestedReason_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.getDefaultInstance() + : requestedReason_; + } else { + return requestedReasonBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + public Builder setRequestedReason( + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason value) { + if (requestedReasonBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedReason_ = value; + } else { + requestedReasonBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + public Builder setRequestedReason( + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Builder builderForValue) { + if (requestedReasonBuilder_ == null) { + requestedReason_ = builderForValue.build(); + } else { + requestedReasonBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + public Builder mergeRequestedReason( + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason value) { + if (requestedReasonBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && requestedReason_ != null + && requestedReason_ + != com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.getDefaultInstance()) { + getRequestedReasonBuilder().mergeFrom(value); + } else { + requestedReason_ = value; + } + } else { + requestedReasonBuilder_.mergeFrom(value); + } + if (requestedReason_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + public Builder clearRequestedReason() { + bitField0_ = (bitField0_ & ~0x00000004); + requestedReason_ = null; + if (requestedReasonBuilder_ != null) { + requestedReasonBuilder_.dispose(); + requestedReasonBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Builder + getRequestedReasonBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getRequestedReasonFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReasonOrBuilder + getRequestedReasonOrBuilder() { + if (requestedReasonBuilder_ != null) { + return requestedReasonBuilder_.getMessageOrBuilder(); + } else { + return requestedReason_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.getDefaultInstance() + : requestedReason_; + } + } + /** + * + * + *
+     * The justification for which approval is being requested.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason, + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.AccessReasonOrBuilder> + getRequestedReasonFieldBuilder() { + if (requestedReasonBuilder_ == null) { + requestedReasonBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason, + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.AccessReasonOrBuilder>( + getRequestedReason(), getParentForChildren(), isClean()); + requestedReason_ = null; + } + return requestedReasonBuilder_; + } + + private com.google.protobuf.Timestamp requestedExpirationTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + requestedExpirationTimeBuilder_; + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return Whether the requestedExpirationTime field is set. + */ + public boolean hasRequestedExpirationTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return The requestedExpirationTime. + */ + public com.google.protobuf.Timestamp getRequestedExpirationTime() { + if (requestedExpirationTimeBuilder_ == null) { + return requestedExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpirationTime_; + } else { + return requestedExpirationTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public Builder setRequestedExpirationTime(com.google.protobuf.Timestamp value) { + if (requestedExpirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedExpirationTime_ = value; + } else { + requestedExpirationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public Builder setRequestedExpirationTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (requestedExpirationTimeBuilder_ == null) { + requestedExpirationTime_ = builderForValue.build(); + } else { + requestedExpirationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public Builder mergeRequestedExpirationTime(com.google.protobuf.Timestamp value) { + if (requestedExpirationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && requestedExpirationTime_ != null + && requestedExpirationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestedExpirationTimeBuilder().mergeFrom(value); + } else { + requestedExpirationTime_ = value; + } + } else { + requestedExpirationTimeBuilder_.mergeFrom(value); + } + if (requestedExpirationTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public Builder clearRequestedExpirationTime() { + bitField0_ = (bitField0_ & ~0x00000008); + requestedExpirationTime_ = null; + if (requestedExpirationTimeBuilder_ != null) { + requestedExpirationTimeBuilder_.dispose(); + requestedExpirationTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getRequestedExpirationTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getRequestedExpirationTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getRequestedExpirationTimeOrBuilder() { + if (requestedExpirationTimeBuilder_ != null) { + return requestedExpirationTimeBuilder_.getMessageOrBuilder(); + } else { + return requestedExpirationTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : requestedExpirationTime_; + } + } + /** + * + * + *
+     * The requested expiration for the approval. If the request is approved,
+     * access will be granted from the time of approval until the expiration time.
+     * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRequestedExpirationTimeFieldBuilder() { + if (requestedExpirationTimeBuilder_ == null) { + requestedExpirationTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRequestedExpirationTime(), getParentForChildren(), isClean()); + requestedExpirationTime_ = null; + } + return requestedExpirationTimeBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessApprovalRequest 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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestName.java new file mode 100644 index 000000000000..5d483766daa9 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestName.java @@ -0,0 +1,308 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class AccessApprovalRequestName implements ResourceName { + private static final PathTemplate + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_ACCESS_APPROVAL_REQUEST = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + private final String accessApprovalRequest; + + @Deprecated + protected AccessApprovalRequestName() { + organization = null; + location = null; + customer = null; + workload = null; + accessApprovalRequest = null; + } + + private AccessApprovalRequestName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + accessApprovalRequest = Preconditions.checkNotNull(builder.getAccessApprovalRequest()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public String getAccessApprovalRequest() { + return accessApprovalRequest; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static AccessApprovalRequestName of( + String organization, + String location, + String customer, + String workload, + String accessApprovalRequest) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .setAccessApprovalRequest(accessApprovalRequest) + .build(); + } + + public static String format( + String organization, + String location, + String customer, + String workload, + String accessApprovalRequest) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .setAccessApprovalRequest(accessApprovalRequest) + .build() + .toString(); + } + + public static AccessApprovalRequestName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_ACCESS_APPROVAL_REQUEST.validatedMatch( + formattedString, + "AccessApprovalRequestName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload"), + matchMap.get("access_approval_request")); + } + + 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 (AccessApprovalRequestName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_ACCESS_APPROVAL_REQUEST.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + if (accessApprovalRequest != null) { + fieldMapBuilder.put("access_approval_request", accessApprovalRequest); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_ACCESS_APPROVAL_REQUEST.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload, + "access_approval_request", + accessApprovalRequest); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + AccessApprovalRequestName that = ((AccessApprovalRequestName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload) + && Objects.equals(this.accessApprovalRequest, that.accessApprovalRequest); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + h *= 1000003; + h ^= Objects.hashCode(accessApprovalRequest); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + private String accessApprovalRequest; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public String getAccessApprovalRequest() { + return accessApprovalRequest; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + public Builder setAccessApprovalRequest(String accessApprovalRequest) { + this.accessApprovalRequest = accessApprovalRequest; + return this; + } + + private Builder(AccessApprovalRequestName accessApprovalRequestName) { + this.organization = accessApprovalRequestName.organization; + this.location = accessApprovalRequestName.location; + this.customer = accessApprovalRequestName.customer; + this.workload = accessApprovalRequestName.workload; + this.accessApprovalRequest = accessApprovalRequestName.accessApprovalRequest; + } + + public AccessApprovalRequestName build() { + return new AccessApprovalRequestName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestOrBuilder.java new file mode 100644 index 000000000000..031f84b0dab3 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface AccessApprovalRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return Whether the requestTime field is set. + */ + boolean hasRequestTime(); + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + * + * @return The requestTime. + */ + com.google.protobuf.Timestamp getRequestTime(); + /** + * + * + *
+   * The time at which approval was requested.
+   * 
+ * + * .google.protobuf.Timestamp request_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder(); + + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + * + * @return Whether the requestedReason field is set. + */ + boolean hasRequestedReason(); + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + * + * @return The requestedReason. + */ + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason getRequestedReason(); + /** + * + * + *
+   * The justification for which approval is being requested.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason requested_reason = 3; + */ + com.google.cloud.cloudcontrolspartner.v1beta.AccessReasonOrBuilder getRequestedReasonOrBuilder(); + + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return Whether the requestedExpirationTime field is set. + */ + boolean hasRequestedExpirationTime(); + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + * + * @return The requestedExpirationTime. + */ + com.google.protobuf.Timestamp getRequestedExpirationTime(); + /** + * + * + *
+   * The requested expiration for the approval. If the request is approved,
+   * access will be granted from the time of approval until the expiration time.
+   * 
+ * + * .google.protobuf.Timestamp requested_expiration_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getRequestedExpirationTimeOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestsProto.java new file mode 100644 index 000000000000..22469db9c20e --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessApprovalRequestsProto.java @@ -0,0 +1,154 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class AccessApprovalRequestsProto { + private AccessApprovalRequestsProto() {} + + 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_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nGgoogle/cloud/cloudcontrolspartner/v1be" + + "ta/access_approval_requests.proto\022(googl" + + "e.cloud.cloudcontrolspartner.v1beta\032\037goo" + + "gle/api/field_behavior.proto\032\031google/api" + + "/resource.proto\032\037google/protobuf/timesta" + + "mp.proto\"\355\003\n\025AccessApprovalRequest\022\021\n\004na" + + "me\030\001 \001(\tB\003\340A\010\0220\n\014request_time\030\002 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022P\n\020requested_rea" + + "son\030\003 \001(\01326.google.cloud.cloudcontrolspa" + + "rtner.v1beta.AccessReason\022=\n\031requested_e" + + "xpiration_time\030\004 \001(\0132\032.google.protobuf.T" + + "imestamp:\375\001\352A\371\001\n9cloudcontrolspartner.go" + + "ogleapis.com/AccessApprovalRequest\022\214\001org" + + "anizations/{organization}/locations/{loc" + + "ation}/customers/{customer}/workloads/{w" + + "orkload}/accessApprovalRequests/{access_" + + "approval_request}*\026accessApprovalRequest" + + "s2\025accessApprovalRequest\"\323\001\n!ListAccessA" + + "pprovalRequestsRequest\022Q\n\006parent\030\001 \001(\tBA" + + "\340A\002\372A;\0229cloudcontrolspartner.googleapis." + + "com/AccessApprovalRequest\022\026\n\tpage_size\030\002" + + " \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\022\023\n\006fi" + + "lter\030\004 \001(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001\"\265" + + "\001\n\"ListAccessApprovalRequestsResponse\022a\n" + + "\030access_approval_requests\030\001 \003(\0132?.google" + + ".cloud.cloudcontrolspartner.v1beta.Acces" + + "sApprovalRequest\022\027\n\017next_page_token\030\002 \001(" + + "\t\022\023\n\013unreachable\030\003 \003(\t\"\306\002\n\014AccessReason\022" + + "I\n\004type\030\001 \001(\0162;.google.cloud.cloudcontro" + + "lspartner.v1beta.AccessReason.Type\022\016\n\006de" + + "tail\030\002 \001(\t\"\332\001\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020" + + "\000\022\036\n\032CUSTOMER_INITIATED_SUPPORT\020\001\022\034\n\030GOO" + + "GLE_INITIATED_SERVICE\020\002\022\033\n\027GOOGLE_INITIA" + + "TED_REVIEW\020\003\022\034\n\030THIRD_PARTY_DATA_REQUEST" + + "\020\004\022\'\n#GOOGLE_RESPONSE_TO_PRODUCTION_ALER" + + "T\020\005\022\032\n\026CLOUD_INITIATED_ACCESS\020\006B\263\002\n,com." + + "google.cloud.cloudcontrolspartner.v1beta" + + "B\033AccessApprovalRequestsProtoP\001Z`cloud.g" + + "oogle.com/go/cloudcontrolspartner/apiv1b" + + "eta/cloudcontrolspartnerpb;cloudcontrols" + + "partnerpb\252\002(Google.Cloud.CloudControlsPa" + + "rtner.V1Beta\312\002(Google\\Cloud\\CloudControl" + + "sPartner\\V1beta\352\002+Google::Cloud::CloudCo" + + "ntrolsPartner::V1betab\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(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessApprovalRequest_descriptor, + new java.lang.String[] { + "Name", "RequestTime", "RequestedReason", "RequestedExpirationTime", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_descriptor, + new java.lang.String[] { + "AccessApprovalRequests", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_descriptor, + new java.lang.String[] { + "Type", "Detail", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessReason.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessReason.java new file mode 100644 index 000000000000..c3e5806c957a --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessReason.java @@ -0,0 +1,1065 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Reason for the access.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.AccessReason} + */ +public final class AccessReason extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.AccessReason) + AccessReasonOrBuilder { + private static final long serialVersionUID = 0L; + // Use AccessReason.newBuilder() to construct. + private AccessReason(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AccessReason() { + type_ = 0; + detail_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AccessReason(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.class, + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Builder.class); + } + + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type} + */ + public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value for proto, shouldn't be used.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Customer made a request or raised an issue that required the principal to
+     * access customer data. `detail` is of the form ("#####" is the issue ID):
+     *
+     * - "Feedback Report: #####"
+     * - "Case Number: #####"
+     * - "Case ID: #####"
+     * - "E-PIN Reference: #####"
+     * - "Google-#####"
+     * - "T-#####"
+     * 
+ * + * CUSTOMER_INITIATED_SUPPORT = 1; + */ + CUSTOMER_INITIATED_SUPPORT(1), + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services. Often this access is used to confirm that
+     * customers are not affected by a suspected service issue or to remediate a
+     * reversible system issue.
+     * 
+ * + * GOOGLE_INITIATED_SERVICE = 2; + */ + GOOGLE_INITIATED_SERVICE(2), + /** + * + * + *
+     * Google initiated service for security, fraud, abuse, or compliance
+     * purposes.
+     * 
+ * + * GOOGLE_INITIATED_REVIEW = 3; + */ + GOOGLE_INITIATED_REVIEW(3), + /** + * + * + *
+     * The principal was compelled to access customer data in order to respond
+     * to a legal third party data request or process, including legal processes
+     * from customers themselves.
+     * 
+ * + * THIRD_PARTY_DATA_REQUEST = 4; + */ + THIRD_PARTY_DATA_REQUEST(4), + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services or a known outage.
+     * 
+ * + * GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 5; + */ + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT(5), + /** + * + * + *
+     * Similar to 'GOOGLE_INITIATED_SERVICE' or 'GOOGLE_INITIATED_REVIEW', but
+     * with universe agnostic naming. The principal accessed customer data in
+     * order to diagnose or resolve a suspected issue in services or a known
+     * outage, or for security, fraud, abuse, or compliance review purposes.
+     * 
+ * + * CLOUD_INITIATED_ACCESS = 6; + */ + CLOUD_INITIATED_ACCESS(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value for proto, shouldn't be used.
+     * 
+ * + * TYPE_UNSPECIFIED = 0; + */ + public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Customer made a request or raised an issue that required the principal to
+     * access customer data. `detail` is of the form ("#####" is the issue ID):
+     *
+     * - "Feedback Report: #####"
+     * - "Case Number: #####"
+     * - "Case ID: #####"
+     * - "E-PIN Reference: #####"
+     * - "Google-#####"
+     * - "T-#####"
+     * 
+ * + * CUSTOMER_INITIATED_SUPPORT = 1; + */ + public static final int CUSTOMER_INITIATED_SUPPORT_VALUE = 1; + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services. Often this access is used to confirm that
+     * customers are not affected by a suspected service issue or to remediate a
+     * reversible system issue.
+     * 
+ * + * GOOGLE_INITIATED_SERVICE = 2; + */ + public static final int GOOGLE_INITIATED_SERVICE_VALUE = 2; + /** + * + * + *
+     * Google initiated service for security, fraud, abuse, or compliance
+     * purposes.
+     * 
+ * + * GOOGLE_INITIATED_REVIEW = 3; + */ + public static final int GOOGLE_INITIATED_REVIEW_VALUE = 3; + /** + * + * + *
+     * The principal was compelled to access customer data in order to respond
+     * to a legal third party data request or process, including legal processes
+     * from customers themselves.
+     * 
+ * + * THIRD_PARTY_DATA_REQUEST = 4; + */ + public static final int THIRD_PARTY_DATA_REQUEST_VALUE = 4; + /** + * + * + *
+     * The principal accessed customer data in order to diagnose or resolve a
+     * suspected issue in services or a known outage.
+     * 
+ * + * GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 5; + */ + public static final int GOOGLE_RESPONSE_TO_PRODUCTION_ALERT_VALUE = 5; + /** + * + * + *
+     * Similar to 'GOOGLE_INITIATED_SERVICE' or 'GOOGLE_INITIATED_REVIEW', but
+     * with universe agnostic naming. The principal accessed customer data in
+     * order to diagnose or resolve a suspected issue in services or a known
+     * outage, or for security, fraud, abuse, or compliance review purposes.
+     * 
+ * + * CLOUD_INITIATED_ACCESS = 6; + */ + public static final int CLOUD_INITIATED_ACCESS_VALUE = 6; + + 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 Type 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 Type forNumber(int value) { + switch (value) { + case 0: + return TYPE_UNSPECIFIED; + case 1: + return CUSTOMER_INITIATED_SUPPORT; + case 2: + return GOOGLE_INITIATED_SERVICE; + case 3: + return GOOGLE_INITIATED_REVIEW; + case 4: + return THIRD_PARTY_DATA_REQUEST; + case 5: + return GOOGLE_RESPONSE_TO_PRODUCTION_ALERT; + case 6: + return CLOUD_INITIATED_ACCESS; + 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 Type findValueByNumber(int number) { + return Type.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.cloud.cloudcontrolspartner.v1beta.AccessReason.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Type[] VALUES = values(); + + public static Type 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 Type(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type getType() { + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type result = + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type.forNumber(type_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type.UNRECOGNIZED + : result; + } + + public static final int DETAIL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object detail_ = ""; + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The detail. + */ + @java.lang.Override + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + 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(); + detail_ = s; + return s; + } + } + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = 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 (type_ + != com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type.TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, detail_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ + != com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type.TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(detail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, detail_); + } + 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.cloud.cloudcontrolspartner.v1beta.AccessReason)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason other = + (com.google.cloud.cloudcontrolspartner.v1beta.AccessReason) obj; + + if (type_ != other.type_) return false; + if (!getDetail().equals(other.getDetail())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason 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.cloud.cloudcontrolspartner.v1beta.AccessReason parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason 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.cloud.cloudcontrolspartner.v1beta.AccessReason parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason 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.cloud.cloudcontrolspartner.v1beta.AccessReason parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason 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.cloud.cloudcontrolspartner.v1beta.AccessReason 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; + } + /** + * + * + *
+   * Reason for the access.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.AccessReason} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.AccessReason) + com.google.cloud.cloudcontrolspartner.v1beta.AccessReasonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.class, + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + detail_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_AccessReason_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReason getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReason build() { + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReason buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason result = + new com.google.cloud.cloudcontrolspartner.v1beta.AccessReason(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.AccessReason result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.detail_ = detail_; + } + } + + @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.cloud.cloudcontrolspartner.v1beta.AccessReason) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.AccessReason) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.AccessReason other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.getDefaultInstance()) + return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + detail_ = 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 int type_ = 0; + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type getType() { + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type result = + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type.forNumber(type_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of access justification.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + detail_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @return This builder for chaining. + */ + public Builder clearDetail() { + detail_ = getDefaultInstance().getDetail(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * More detail about certain reason types. See comments for each type above.
+     * 
+ * + * string detail = 2; + * + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + detail_ = 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.cloud.cloudcontrolspartner.v1beta.AccessReason) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.AccessReason) + private static final com.google.cloud.cloudcontrolspartner.v1beta.AccessReason DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.AccessReason(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.AccessReason getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AccessReason 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.cloud.cloudcontrolspartner.v1beta.AccessReason getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessReasonOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessReasonOrBuilder.java new file mode 100644 index 000000000000..6b52128750ad --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/AccessReasonOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface AccessReasonOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.AccessReason) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Type of access justification.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type type = 1; + * + * @return The type. + */ + com.google.cloud.cloudcontrolspartner.v1beta.AccessReason.Type getType(); + + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The detail. + */ + java.lang.String getDetail(); + /** + * + * + *
+   * More detail about certain reason types. See comments for each type above.
+   * 
+ * + * string detail = 2; + * + * @return The bytes for detail. + */ + com.google.protobuf.ByteString getDetailBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CompletionState.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CompletionState.java new file mode 100644 index 000000000000..2652facfac3e --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CompletionState.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/completion_state.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Enum for possible completion states.
+ * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.CompletionState} + */ +public enum CompletionState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified completion state.
+   * 
+ * + * COMPLETION_STATE_UNSPECIFIED = 0; + */ + COMPLETION_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * Task started (has start date) but not yet completed.
+   * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + * + * + *
+   * Succeeded state.
+   * 
+ * + * SUCCEEDED = 2; + */ + SUCCEEDED(2), + /** + * + * + *
+   * Failed state.
+   * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+   * Not applicable state.
+   * 
+ * + * NOT_APPLICABLE = 4; + */ + NOT_APPLICABLE(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified completion state.
+   * 
+ * + * COMPLETION_STATE_UNSPECIFIED = 0; + */ + public static final int COMPLETION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Task started (has start date) but not yet completed.
+   * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + /** + * + * + *
+   * Succeeded state.
+   * 
+ * + * SUCCEEDED = 2; + */ + public static final int SUCCEEDED_VALUE = 2; + /** + * + * + *
+   * Failed state.
+   * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+   * Not applicable state.
+   * 
+ * + * NOT_APPLICABLE = 4; + */ + public static final int NOT_APPLICABLE_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CompletionState 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 CompletionState forNumber(int value) { + switch (value) { + case 0: + return COMPLETION_STATE_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return SUCCEEDED; + case 3: + return FAILED; + case 4: + return NOT_APPLICABLE; + 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 CompletionState findValueByNumber(int number) { + return CompletionState.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.cloud.cloudcontrolspartner.v1beta.CompletionStateProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final CompletionState[] VALUES = values(); + + public static CompletionState 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 CompletionState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.CompletionState) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CompletionStateProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CompletionStateProto.java new file mode 100644 index 000000000000..cb5b59312887 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CompletionStateProto.java @@ -0,0 +1,60 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/completion_state.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class CompletionStateProto { + private CompletionStateProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + 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/cloud/cloudcontrolspartner/v1be" + + "ta/completion_state.proto\022(google.cloud." + + "cloudcontrolspartner.v1beta*o\n\017Completio" + + "nState\022 \n\034COMPLETION_STATE_UNSPECIFIED\020\000" + + "\022\013\n\007PENDING\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n\006FAILED\020\003" + + "\022\022\n\016NOT_APPLICABLE\020\004B\254\002\n,com.google.clou" + + "d.cloudcontrolspartner.v1betaB\024Completio" + + "nStateProtoP\001Z`cloud.google.com/go/cloud" + + "controlspartner/apiv1beta/cloudcontrolsp" + + "artnerpb;cloudcontrolspartnerpb\252\002(Google" + + ".Cloud.CloudControlsPartner.V1Beta\312\002(Goo" + + "gle\\Cloud\\CloudControlsPartner\\V1beta\352\002+" + + "Google::Cloud::CloudControlsPartner::V1b" + + "etab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CoreProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CoreProto.java new file mode 100644 index 000000000000..a9f8382e197a --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CoreProto.java @@ -0,0 +1,183 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/core.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class CoreProto { + private CoreProto() {} + + 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_cloud_cloudcontrolspartner_v1beta_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/cloudcontrolspartner/v1be" + + "ta/core.proto\022(google.cloud.cloudcontrol" + + "spartner.v1beta\032\034google/api/annotations." + + "proto\032\027google/api/client.proto\032\037google/a" + + "pi/field_behavior.proto\032\031google/api/reso" + + "urce.proto\032Ggoogle/cloud/cloudcontrolspa" + + "rtner/v1beta/access_approval_requests.pr" + + "oto\032Agoogle/cloud/cloudcontrolspartner/v" + + "1beta/customer_workloads.proto\0328google/c" + + "loud/cloudcontrolspartner/v1beta/custome" + + "rs.proto\032>google/cloud/cloudcontrolspart" + + "ner/v1beta/ekm_connections.proto\032Bgoogle" + + "/cloud/cloudcontrolspartner/v1beta/partn" + + "er_permissions.proto\0327google/cloud/cloud" + + "controlspartner/v1beta/partners.proto\032\037g" + + "oogle/protobuf/timestamp.proto\"\200\002\n\021Opera" + + "tionMetadata\0224\n\013create_time\030\001 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0221\n\010end_time\030\002" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\023\n" + + "\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n" + + "\016status_message\030\005 \001(\tB\003\340A\003\022#\n\026requested_" + + "cancellation\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007" + + " \001(\tB\003\340A\0032\273\017\n\030CloudControlsPartnerCore\022\322" + + "\001\n\013GetWorkload\022<.google.cloud.cloudcontr" + + "olspartner.v1beta.GetWorkloadRequest\0322.g" + + "oogle.cloud.cloudcontrolspartner.v1beta." + + "Workload\"Q\332A\004name\202\323\344\223\002D\022B/v1beta/{name=o" + + "rganizations/*/locations/*/customers/*/w" + + "orkloads/*}\022\345\001\n\rListWorkloads\022>.google.c" + + "loud.cloudcontrolspartner.v1beta.ListWor" + + "kloadsRequest\032?.google.cloud.cloudcontro" + + "lspartner.v1beta.ListWorkloadsResponse\"S" + + "\332A\006parent\202\323\344\223\002D\022B/v1beta/{parent=organiz" + + "ations/*/locations/*/customers/*}/worklo" + + "ads\022\306\001\n\013GetCustomer\022<.google.cloud.cloud" + + "controlspartner.v1beta.GetCustomerReques" + + "t\0322.google.cloud.cloudcontrolspartner.v1" + + "beta.Customer\"E\332A\004name\202\323\344\223\0028\0226/v1beta/{n" + + "ame=organizations/*/locations/*/customer" + + "s/*}\022\331\001\n\rListCustomers\022>.google.cloud.cl" + + "oudcontrolspartner.v1beta.ListCustomersR" + + "equest\032?.google.cloud.cloudcontrolspartn" + + "er.v1beta.ListCustomersResponse\"G\332A\006pare" + + "nt\202\323\344\223\0028\0226/v1beta/{parent=organizations/" + + "*/locations/*}/customers\022\363\001\n\021GetEkmConne" + + "ctions\022B.google.cloud.cloudcontrolspartn" + + "er.v1beta.GetEkmConnectionsRequest\0328.goo" + + "gle.cloud.cloudcontrolspartner.v1beta.Ek" + + "mConnections\"`\332A\004name\202\323\344\223\002S\022Q/v1beta/{na" + + "me=organizations/*/locations/*/customers" + + "/*/workloads/*/ekmConnections}\022\203\002\n\025GetPa" + + "rtnerPermissions\022F.google.cloud.cloudcon" + + "trolspartner.v1beta.GetPartnerPermission" + + "sRequest\032<.google.cloud.cloudcontrolspar" + + "tner.v1beta.PartnerPermissions\"d\332A\004name\202" + + "\323\344\223\002W\022U/v1beta/{name=organizations/*/loc" + + "ations/*/customers/*/workloads/*/partner" + + "Permissions}\022\245\002\n\032ListAccessApprovalReque" + + "sts\022K.google.cloud.cloudcontrolspartner." + + "v1beta.ListAccessApprovalRequestsRequest" + + "\032L.google.cloud.cloudcontrolspartner.v1b" + + "eta.ListAccessApprovalRequestsResponse\"l" + + "\332A\006parent\202\323\344\223\002]\022[/v1beta/{parent=organiz" + + "ations/*/locations/*/customers/*/workloa" + + "ds/*}/accessApprovalRequests\022\277\001\n\nGetPart" + + "ner\022;.google.cloud.cloudcontrolspartner." + + "v1beta.GetPartnerRequest\0321.google.cloud." + + "cloudcontrolspartner.v1beta.Partner\"A\332A\004" + + "name\202\323\344\223\0024\0222/v1beta/{name=organizations/" + + "*/locations/*/partner}\032W\312A#cloudcontrols" + + "partner.googleapis.com\322A.https://www.goo" + + "gleapis.com/auth/cloud-platformB\221\003\n,com." + + "google.cloud.cloudcontrolspartner.v1beta" + + "B\tCoreProtoP\001Z`cloud.google.com/go/cloud" + + "controlspartner/apiv1beta/cloudcontrolsp" + + "artnerpb;cloudcontrolspartnerpb\252\002(Google" + + ".Cloud.CloudControlsPartner.V1Beta\312\002(Goo" + + "gle\\Cloud\\CloudControlsPartner\\V1beta\352\002+" + + "Google::Cloud::CloudControlsPartner::V1b" + + "eta\352Am\n8cloudcontrolspartner.googleapis." + + "com/OrganizationLocation\0221organizations/" + + "{organization}/locations/{location}b\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto.getDescriptor(), + com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + 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); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Customer.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Customer.java new file mode 100644 index 000000000000..f4bbfb821888 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Customer.java @@ -0,0 +1,1231 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Contains metadata around a Cloud Controls Partner Customer
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Customer} + */ +public final class Customer extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Customer) + CustomerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Customer.newBuilder() to construct. + private Customer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Customer() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Customer(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Customer.class, + com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * The customer organization's display name. E.g. "google.com".
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * The customer organization's display name. E.g. "google.com".
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOMER_ONBOARDING_STATE_FIELD_NUMBER = 3; + private com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + customerOnboardingState_; + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return Whether the customerOnboardingState field is set. + */ + @java.lang.Override + public boolean hasCustomerOnboardingState() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return The customerOnboardingState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + getCustomerOnboardingState() { + return customerOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.getDefaultInstance() + : customerOnboardingState_; + } + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStateOrBuilder + getCustomerOnboardingStateOrBuilder() { + return customerOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.getDefaultInstance() + : customerOnboardingState_; + } + + public static final int IS_ONBOARDED_FIELD_NUMBER = 4; + private boolean isOnboarded_ = false; + /** + * + * + *
+   * Indicates whether a customer is fully onboarded
+   * 
+ * + * bool is_onboarded = 4; + * + * @return The isOnboarded. + */ + @java.lang.Override + public boolean getIsOnboarded() { + return isOnboarded_; + } + + 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(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCustomerOnboardingState()); + } + if (isOnboarded_ != false) { + output.writeBool(4, isOnboarded_); + } + 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(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCustomerOnboardingState()); + } + if (isOnboarded_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, isOnboarded_); + } + 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.cloud.cloudcontrolspartner.v1beta.Customer)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Customer other = + (com.google.cloud.cloudcontrolspartner.v1beta.Customer) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasCustomerOnboardingState() != other.hasCustomerOnboardingState()) return false; + if (hasCustomerOnboardingState()) { + if (!getCustomerOnboardingState().equals(other.getCustomerOnboardingState())) return false; + } + if (getIsOnboarded() != other.getIsOnboarded()) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (hasCustomerOnboardingState()) { + hash = (37 * hash) + CUSTOMER_ONBOARDING_STATE_FIELD_NUMBER; + hash = (53 * hash) + getCustomerOnboardingState().hashCode(); + } + hash = (37 * hash) + IS_ONBOARDED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsOnboarded()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer 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.cloud.cloudcontrolspartner.v1beta.Customer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer 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.cloud.cloudcontrolspartner.v1beta.Customer parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer 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.cloud.cloudcontrolspartner.v1beta.Customer parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer 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.cloud.cloudcontrolspartner.v1beta.Customer 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; + } + /** + * + * + *
+   * Contains metadata around a Cloud Controls Partner Customer
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Customer} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Customer) + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Customer.class, + com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.Customer.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCustomerOnboardingStateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + displayName_ = ""; + customerOnboardingState_ = null; + if (customerOnboardingStateBuilder_ != null) { + customerOnboardingStateBuilder_.dispose(); + customerOnboardingStateBuilder_ = null; + } + isOnboarded_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Customer getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Customer.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Customer build() { + com.google.cloud.cloudcontrolspartner.v1beta.Customer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Customer buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Customer result = + new com.google.cloud.cloudcontrolspartner.v1beta.Customer(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.Customer result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.customerOnboardingState_ = + customerOnboardingStateBuilder_ == null + ? customerOnboardingState_ + : customerOnboardingStateBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.isOnboarded_ = isOnboarded_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.Customer) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.Customer) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.Customer other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.Customer.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCustomerOnboardingState()) { + mergeCustomerOnboardingState(other.getCustomerOnboardingState()); + } + if (other.getIsOnboarded() != false) { + setIsOnboarded(other.getIsOnboarded()); + } + 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: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getCustomerOnboardingStateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + isOnboarded_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The customer organization's display name. E.g. "google.com".
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + customerOnboardingState_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStateOrBuilder> + customerOnboardingStateBuilder_; + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return Whether the customerOnboardingState field is set. + */ + public boolean hasCustomerOnboardingState() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return The customerOnboardingState. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + getCustomerOnboardingState() { + if (customerOnboardingStateBuilder_ == null) { + return customerOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + .getDefaultInstance() + : customerOnboardingState_; + } else { + return customerOnboardingStateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public Builder setCustomerOnboardingState( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState value) { + if (customerOnboardingStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customerOnboardingState_ = value; + } else { + customerOnboardingStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public Builder setCustomerOnboardingState( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.Builder + builderForValue) { + if (customerOnboardingStateBuilder_ == null) { + customerOnboardingState_ = builderForValue.build(); + } else { + customerOnboardingStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public Builder mergeCustomerOnboardingState( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState value) { + if (customerOnboardingStateBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && customerOnboardingState_ != null + && customerOnboardingState_ + != com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + .getDefaultInstance()) { + getCustomerOnboardingStateBuilder().mergeFrom(value); + } else { + customerOnboardingState_ = value; + } + } else { + customerOnboardingStateBuilder_.mergeFrom(value); + } + if (customerOnboardingState_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public Builder clearCustomerOnboardingState() { + bitField0_ = (bitField0_ & ~0x00000004); + customerOnboardingState_ = null; + if (customerOnboardingStateBuilder_ != null) { + customerOnboardingStateBuilder_.dispose(); + customerOnboardingStateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.Builder + getCustomerOnboardingStateBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCustomerOnboardingStateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStateOrBuilder + getCustomerOnboardingStateOrBuilder() { + if (customerOnboardingStateBuilder_ != null) { + return customerOnboardingStateBuilder_.getMessageOrBuilder(); + } else { + return customerOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + .getDefaultInstance() + : customerOnboardingState_; + } + } + /** + * + * + *
+     * Container for customer onboarding steps
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStateOrBuilder> + getCustomerOnboardingStateFieldBuilder() { + if (customerOnboardingStateBuilder_ == null) { + customerOnboardingStateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStateOrBuilder>( + getCustomerOnboardingState(), getParentForChildren(), isClean()); + customerOnboardingState_ = null; + } + return customerOnboardingStateBuilder_; + } + + private boolean isOnboarded_; + /** + * + * + *
+     * Indicates whether a customer is fully onboarded
+     * 
+ * + * bool is_onboarded = 4; + * + * @return The isOnboarded. + */ + @java.lang.Override + public boolean getIsOnboarded() { + return isOnboarded_; + } + /** + * + * + *
+     * Indicates whether a customer is fully onboarded
+     * 
+ * + * bool is_onboarded = 4; + * + * @param value The isOnboarded to set. + * @return This builder for chaining. + */ + public Builder setIsOnboarded(boolean value) { + + isOnboarded_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether a customer is fully onboarded
+     * 
+ * + * bool is_onboarded = 4; + * + * @return This builder for chaining. + */ + public Builder clearIsOnboarded() { + bitField0_ = (bitField0_ & ~0x00000008); + isOnboarded_ = false; + 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.cloud.cloudcontrolspartner.v1beta.Customer) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Customer) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Customer DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.Customer(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Customer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Customer 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.cloud.cloudcontrolspartner.v1beta.Customer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerName.java new file mode 100644 index 000000000000..4bc943317a77 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerName.java @@ -0,0 +1,227 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CustomerName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + + @Deprecated + protected CustomerName() { + organization = null; + location = null; + customer = null; + } + + private CustomerName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CustomerName of(String organization, String location, String customer) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .build(); + } + + public static String format(String organization, String location, String customer) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .build() + .toString(); + } + + public static CustomerName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER.validatedMatch( + formattedString, "CustomerName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location"), matchMap.get("customer")); + } + + 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 (CustomerName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER.instantiate( + "organization", organization, "location", location, "customer", customer); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + CustomerName that = ((CustomerName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}/customers/{customer}. */ + public static class Builder { + private String organization; + private String location; + private String customer; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + private Builder(CustomerName customerName) { + this.organization = customerName.organization; + this.location = customerName.location; + this.customer = customerName.customer; + } + + public CustomerName build() { + return new CustomerName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingState.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingState.java new file mode 100644 index 000000000000..915f0d56e3f0 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingState.java @@ -0,0 +1,1031 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Container for customer onboarding steps
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState} + */ +public final class CustomerOnboardingState extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState) + CustomerOnboardingStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomerOnboardingState.newBuilder() to construct. + private CustomerOnboardingState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomerOnboardingState() { + onboardingSteps_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomerOnboardingState(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.class, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.Builder.class); + } + + public static final int ONBOARDING_STEPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + onboardingSteps_; + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public java.util.List + getOnboardingStepsList() { + return onboardingSteps_; + } + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList() { + return onboardingSteps_; + } + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public int getOnboardingStepsCount() { + return onboardingSteps_.size(); + } + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep getOnboardingSteps( + int index) { + return onboardingSteps_.get(index); + } + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index) { + return onboardingSteps_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < onboardingSteps_.size(); i++) { + output.writeMessage(1, onboardingSteps_.get(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 < onboardingSteps_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, onboardingSteps_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState other = + (com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState) obj; + + if (!getOnboardingStepsList().equals(other.getOnboardingStepsList())) 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 (getOnboardingStepsCount() > 0) { + hash = (37 * hash) + ONBOARDING_STEPS_FIELD_NUMBER; + hash = (53 * hash) + getOnboardingStepsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState 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; + } + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState) + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.class, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (onboardingStepsBuilder_ == null) { + onboardingSteps_ = java.util.Collections.emptyList(); + } else { + onboardingSteps_ = null; + onboardingStepsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState build() { + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState result = + new com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState result) { + if (onboardingStepsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + onboardingSteps_ = java.util.Collections.unmodifiableList(onboardingSteps_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.onboardingSteps_ = onboardingSteps_; + } else { + result.onboardingSteps_ = onboardingStepsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + .getDefaultInstance()) return this; + if (onboardingStepsBuilder_ == null) { + if (!other.onboardingSteps_.isEmpty()) { + if (onboardingSteps_.isEmpty()) { + onboardingSteps_ = other.onboardingSteps_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.addAll(other.onboardingSteps_); + } + onChanged(); + } + } else { + if (!other.onboardingSteps_.isEmpty()) { + if (onboardingStepsBuilder_.isEmpty()) { + onboardingStepsBuilder_.dispose(); + onboardingStepsBuilder_ = null; + onboardingSteps_ = other.onboardingSteps_; + bitField0_ = (bitField0_ & ~0x00000001); + onboardingStepsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOnboardingStepsFieldBuilder() + : null; + } else { + onboardingStepsBuilder_.addAllMessages(other.onboardingSteps_); + } + } + } + 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + .parser(), + extensionRegistry); + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(m); + } else { + onboardingStepsBuilder_.addMessage(m); + } + 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.util.List + onboardingSteps_ = java.util.Collections.emptyList(); + + private void ensureOnboardingStepsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + onboardingSteps_ = + new java.util.ArrayList< + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep>( + onboardingSteps_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder> + onboardingStepsBuilder_; + + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List + getOnboardingStepsList() { + if (onboardingStepsBuilder_ == null) { + return java.util.Collections.unmodifiableList(onboardingSteps_); + } else { + return onboardingStepsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public int getOnboardingStepsCount() { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.size(); + } else { + return onboardingStepsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep getOnboardingSteps( + int index) { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.get(index); + } else { + return onboardingStepsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder setOnboardingSteps( + int index, com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.set(index, value); + onChanged(); + } else { + onboardingStepsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder setOnboardingSteps( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder + builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.set(index, builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(value); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + int index, com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(index, value); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder + builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder + builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(index, builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder addAllOnboardingSteps( + java.lang.Iterable< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep> + values) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, onboardingSteps_); + onChanged(); + } else { + onboardingStepsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder clearOnboardingSteps() { + if (onboardingStepsBuilder_ == null) { + onboardingSteps_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + onboardingStepsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public Builder removeOnboardingSteps(int index) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.remove(index); + onChanged(); + } else { + onboardingStepsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder + getOnboardingStepsBuilder(int index) { + return getOnboardingStepsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index) { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.get(index); + } else { + return onboardingStepsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList() { + if (onboardingStepsBuilder_ != null) { + return onboardingStepsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(onboardingSteps_); + } + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder + addOnboardingStepsBuilder() { + return getOnboardingStepsFieldBuilder() + .addBuilder( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + .getDefaultInstance()); + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder + addOnboardingStepsBuilder(int index) { + return getOnboardingStepsFieldBuilder() + .addBuilder( + index, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + .getDefaultInstance()); + } + /** + * + * + *
+     * List of customer onboarding steps
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List< + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder> + getOnboardingStepsBuilderList() { + return getOnboardingStepsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder> + getOnboardingStepsFieldBuilder() { + if (onboardingStepsBuilder_ == null) { + onboardingStepsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder>( + onboardingSteps_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + onboardingSteps_ = null; + } + return onboardingStepsBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState) + private static final com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomerOnboardingState 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStateOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStateOrBuilder.java new file mode 100644 index 000000000000..708498ea18a3 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStateOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface CustomerOnboardingStateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + java.util.List + getOnboardingStepsList(); + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep getOnboardingSteps(int index); + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + int getOnboardingStepsCount(); + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList(); + /** + * + * + *
+   * List of customer onboarding steps
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep onboarding_steps = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStep.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStep.java new file mode 100644 index 000000000000..d9117d362d61 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStep.java @@ -0,0 +1,1482 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Container for customer onboarding information
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep} + */ +public final class CustomerOnboardingStep extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep) + CustomerOnboardingStepOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomerOnboardingStep.newBuilder() to construct. + private CustomerOnboardingStep(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomerOnboardingStep() { + step_ = 0; + completionState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomerOnboardingStep(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.class, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder.class); + } + + /** + * + * + *
+   * Enum for possible onboarding steps
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step} + */ + public enum Step implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified step
+     * 
+ * + * STEP_UNSPECIFIED = 0; + */ + STEP_UNSPECIFIED(0), + /** + * + * + *
+     * KAJ Enrollment
+     * 
+ * + * KAJ_ENROLLMENT = 1; + */ + KAJ_ENROLLMENT(1), + /** + * + * + *
+     * Customer Environment
+     * 
+ * + * CUSTOMER_ENVIRONMENT = 2; + */ + CUSTOMER_ENVIRONMENT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified step
+     * 
+ * + * STEP_UNSPECIFIED = 0; + */ + public static final int STEP_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * KAJ Enrollment
+     * 
+ * + * KAJ_ENROLLMENT = 1; + */ + public static final int KAJ_ENROLLMENT_VALUE = 1; + /** + * + * + *
+     * Customer Environment
+     * 
+ * + * CUSTOMER_ENVIRONMENT = 2; + */ + public static final int CUSTOMER_ENVIRONMENT_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 Step 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 Step forNumber(int value) { + switch (value) { + case 0: + return STEP_UNSPECIFIED; + case 1: + return KAJ_ENROLLMENT; + case 2: + return CUSTOMER_ENVIRONMENT; + 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 Step findValueByNumber(int number) { + return Step.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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Step[] VALUES = values(); + + public static Step 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 Step(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step) + } + + private int bitField0_; + public static final int STEP_FIELD_NUMBER = 1; + private int step_ = 0; + /** + * + * + *
+   * The onboarding step
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+   * The onboarding step
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step getStep() { + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step result = + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step.forNumber(step_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step.UNRECOGNIZED + : result; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int COMPLETION_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp completionTime_; + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + @java.lang.Override + public boolean hasCompletionTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCompletionTime() { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder() { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + + public static final int COMPLETION_STATE_FIELD_NUMBER = 4; + private int completionState_ = 0; + /** + * + * + *
+   * Output only. Current state of the step
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + @java.lang.Override + public int getCompletionStateValue() { + return completionState_; + } + /** + * + * + *
+   * Output only. Current state of the step
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CompletionState getCompletionState() { + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState result = + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.forNumber(completionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.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 (step_ + != com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step.STEP_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, step_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getCompletionTime()); + } + if (completionState_ + != com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.COMPLETION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, completionState_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (step_ + != com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step.STEP_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, step_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCompletionTime()); + } + if (completionState_ + != com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.COMPLETION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, completionState_); + } + 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep other = + (com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep) obj; + + if (step_ != other.step_) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasCompletionTime() != other.hasCompletionTime()) return false; + if (hasCompletionTime()) { + if (!getCompletionTime().equals(other.getCompletionTime())) return false; + } + if (completionState_ != other.completionState_) 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) + STEP_FIELD_NUMBER; + hash = (53 * hash) + step_; + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasCompletionTime()) { + hash = (37 * hash) + COMPLETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCompletionTime().hashCode(); + } + hash = (37 * hash) + COMPLETION_STATE_FIELD_NUMBER; + hash = (53 * hash) + completionState_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep 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; + } + /** + * + * + *
+   * Container for customer onboarding information
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep) + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStepOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.class, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getCompletionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + step_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + completionTime_ = null; + if (completionTimeBuilder_ != null) { + completionTimeBuilder_.dispose(); + completionTimeBuilder_ = null; + } + completionState_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep build() { + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep result = + new com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.step_ = step_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.completionTime_ = + completionTimeBuilder_ == null ? completionTime_ : completionTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.completionState_ = completionState_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + .getDefaultInstance()) return this; + if (other.step_ != 0) { + setStepValue(other.getStepValue()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasCompletionTime()) { + mergeCompletionTime(other.getCompletionTime()); + } + if (other.completionState_ != 0) { + setCompletionStateValue(other.getCompletionStateValue()); + } + 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: + { + step_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCompletionTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + completionState_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 int step_ = 0; + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @param value The enum numeric value on the wire for step to set. + * @return This builder for chaining. + */ + public Builder setStepValue(int value) { + step_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step getStep() { + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step result = + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step.forNumber(step_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @param value The step to set. + * @return This builder for chaining. + */ + public Builder setStep( + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + step_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The onboarding step
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @return This builder for chaining. + */ + public Builder clearStep() { + bitField0_ = (bitField0_ & ~0x00000001); + step_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The starting time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp completionTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + completionTimeBuilder_; + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + public boolean hasCompletionTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + public com.google.protobuf.Timestamp getCompletionTime() { + if (completionTimeBuilder_ == null) { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } else { + return completionTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder setCompletionTime(com.google.protobuf.Timestamp value) { + if (completionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionTime_ = value; + } else { + completionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder setCompletionTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (completionTimeBuilder_ == null) { + completionTime_ = builderForValue.build(); + } else { + completionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder mergeCompletionTime(com.google.protobuf.Timestamp value) { + if (completionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && completionTime_ != null + && completionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCompletionTimeBuilder().mergeFrom(value); + } else { + completionTime_ = value; + } + } else { + completionTimeBuilder_.mergeFrom(value); + } + if (completionTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder clearCompletionTime() { + bitField0_ = (bitField0_ & ~0x00000004); + completionTime_ = null; + if (completionTimeBuilder_ != null) { + completionTimeBuilder_.dispose(); + completionTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCompletionTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCompletionTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder() { + if (completionTimeBuilder_ != null) { + return completionTimeBuilder_.getMessageOrBuilder(); + } else { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + } + /** + * + * + *
+     * The completion time of the onboarding step
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCompletionTimeFieldBuilder() { + if (completionTimeBuilder_ == null) { + completionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCompletionTime(), getParentForChildren(), isClean()); + completionTime_ = null; + } + return completionTimeBuilder_; + } + + private int completionState_ = 0; + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + @java.lang.Override + public int getCompletionStateValue() { + return completionState_; + } + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for completionState to set. + * @return This builder for chaining. + */ + public Builder setCompletionStateValue(int value) { + completionState_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CompletionState getCompletionState() { + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState result = + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.forNumber(completionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The completionState to set. + * @return This builder for chaining. + */ + public Builder setCompletionState( + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + completionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the step
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCompletionState() { + bitField0_ = (bitField0_ & ~0x00000008); + completionState_ = 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep) + private static final com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomerOnboardingStep 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.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStepOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStepOrBuilder.java new file mode 100644 index 000000000000..bbdc6f92cbd0 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOnboardingStepOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface CustomerOnboardingStepOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The onboarding step
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + int getStepValue(); + /** + * + * + *
+   * The onboarding step
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step step = 1; + * + * @return The step. + */ + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStep.Step getStep(); + + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The starting time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + boolean hasCompletionTime(); + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + com.google.protobuf.Timestamp getCompletionTime(); + /** + * + * + *
+   * The completion time of the onboarding step
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Current state of the step
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + int getCompletionStateValue(); + /** + * + * + *
+   * Output only. Current state of the step
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState getCompletionState(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOrBuilder.java new file mode 100644 index 000000000000..5fad6343d63f --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface CustomerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Customer) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The customer organization's display name. E.g. "google.com".
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * The customer organization's display name. E.g. "google.com".
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return Whether the customerOnboardingState field is set. + */ + boolean hasCustomerOnboardingState(); + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + * + * @return The customerOnboardingState. + */ + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState getCustomerOnboardingState(); + /** + * + * + *
+   * Container for customer onboarding steps
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState customer_onboarding_state = 3; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingStateOrBuilder + getCustomerOnboardingStateOrBuilder(); + + /** + * + * + *
+   * Indicates whether a customer is fully onboarded
+   * 
+ * + * bool is_onboarded = 4; + * + * @return The isOnboarded. + */ + boolean getIsOnboarded(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerWorkloadsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerWorkloadsProto.java new file mode 100644 index 000000000000..a3cabaf4c499 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomerWorkloadsProto.java @@ -0,0 +1,203 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class CustomerWorkloadsProto { + private CustomerWorkloadsProto() {} + + 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_cloud_cloudcontrolspartner_v1beta_Workload_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nAgoogle/cloud/cloudcontrolspartner/v1be" + + "ta/customer_workloads.proto\022(google.clou" + + "d.cloudcontrolspartner.v1beta\032\037google/ap" + + "i/field_behavior.proto\032\031google/api/resou" + + "rce.proto\032?google/cloud/cloudcontrolspar" + + "tner/v1beta/completion_state.proto\032\037goog" + + "le/protobuf/timestamp.proto\"\312\006\n\010Workload" + + "\022\021\n\004name\030\001 \001(\tB\003\340A\010\022\026\n\tfolder_id\030\002 \001(\003B\003" + + "\340A\003\0224\n\013create_time\030\003 \001(\0132\032.google.protob" + + "uf.TimestampB\003\340A\003\022\023\n\006folder\030\004 \001(\tB\003\340A\003\022d" + + "\n\031workload_onboarding_state\030\005 \001(\0132A.goog" + + "le.cloud.cloudcontrolspartner.v1beta.Wor" + + "kloadOnboardingState\022\024\n\014is_onboarded\030\006 \001" + + "(\010\022!\n\031key_management_project_id\030\007 \001(\t\022\020\n" + + "\010location\030\010 \001(\t\022K\n\007partner\030\t \001(\0162:.googl" + + "e.cloud.cloudcontrolspartner.v1beta.Work" + + "load.Partner\"\242\002\n\007Partner\022\027\n\023PARTNER_UNSP" + + "ECIFIED\020\000\022\"\n\036PARTNER_LOCAL_CONTROLS_BY_S" + + "3NS\020\001\022+\n\'PARTNER_SOVEREIGN_CONTROLS_BY_T" + + "_SYSTEMS\020\002\022-\n)PARTNER_SOVEREIGN_CONTROLS" + + "_BY_SIA_MINSAIT\020\003\022%\n!PARTNER_SOVEREIGN_C" + + "ONTROLS_BY_PSN\020\004\022\'\n#PARTNER_SOVEREIGN_CO" + + "NTROLS_BY_CNTXT\020\006\022.\n*PARTNER_SOVEREIGN_C" + + "ONTROLS_BY_CNTXT_NO_EKM\020\007:\244\001\352A\240\001\n,cloudc" + + "ontrolspartner.googleapis.com/Workload\022[" + + "organizations/{organization}/locations/{" + + "location}/customers/{customer}/workloads" + + "/{workload}*\tworkloads2\010workload\"\257\001\n\024Lis" + + "tWorkloadsRequest\022D\n\006parent\030\001 \001(\tB4\340A\002\372A" + + ".\022,cloudcontrolspartner.googleapis.com/W" + + "orkload\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token" + + "\030\003 \001(\t\022\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010order_by\030" + + "\005 \001(\tB\003\340A\001\"\214\001\n\025ListWorkloadsResponse\022E\n\t" + + "workloads\030\001 \003(\01322.google.cloud.cloudcont" + + "rolspartner.v1beta.Workload\022\027\n\017next_page" + + "_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"X\n\022Get" + + "WorkloadRequest\022B\n\004name\030\001 \001(\tB4\340A\002\372A.\n,c" + + "loudcontrolspartner.googleapis.com/Workl" + + "oad\"u\n\027WorkloadOnboardingState\022Z\n\020onboar" + + "ding_steps\030\001 \003(\0132@.google.cloud.cloudcon" + + "trolspartner.v1beta.WorkloadOnboardingSt" + + "ep\"\206\003\n\026WorkloadOnboardingStep\022S\n\004step\030\001 " + + "\001(\0162E.google.cloud.cloudcontrolspartner." + + "v1beta.WorkloadOnboardingStep.Step\022.\n\nst" + + "art_time\030\002 \001(\0132\032.google.protobuf.Timesta" + + "mp\0223\n\017completion_time\030\003 \001(\0132\032.google.pro" + + "tobuf.Timestamp\022X\n\020completion_state\030\004 \001(" + + "\01629.google.cloud.cloudcontrolspartner.v1" + + "beta.CompletionStateB\003\340A\003\"X\n\004Step\022\024\n\020STE" + + "P_UNSPECIFIED\020\000\022\023\n\017EKM_PROVISIONED\020\001\022%\n!" + + "SIGNED_ACCESS_APPROVAL_CONFIGURED\020\002B\256\002\n," + + "com.google.cloud.cloudcontrolspartner.v1" + + "betaB\026CustomerWorkloadsProtoP\001Z`cloud.go" + + "ogle.com/go/cloudcontrolspartner/apiv1be" + + "ta/cloudcontrolspartnerpb;cloudcontrolsp" + + "artnerpb\252\002(Google.Cloud.CloudControlsPar" + + "tner.V1Beta\312\002(Google\\Cloud\\CloudControls" + + "Partner\\V1beta\352\002+Google::Cloud::CloudCon" + + "trolsPartner::V1betab\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.cloud.cloudcontrolspartner.v1beta.CompletionStateProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_descriptor, + new java.lang.String[] { + "Name", + "FolderId", + "CreateTime", + "Folder", + "WorkloadOnboardingState", + "IsOnboarded", + "KeyManagementProjectId", + "Location", + "Partner", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_descriptor, + new java.lang.String[] { + "Workloads", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_descriptor, + new java.lang.String[] { + "OnboardingSteps", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_descriptor, + new java.lang.String[] { + "Step", "StartTime", "CompletionTime", "CompletionState", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.CompletionStateProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomersProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomersProto.java new file mode 100644 index 000000000000..0081b34ff238 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/CustomersProto.java @@ -0,0 +1,181 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class CustomersProto { + private CustomersProto() {} + + 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_cloud_cloudcontrolspartner_v1beta_Customer_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n8google/cloud/cloudcontrolspartner/v1be" + + "ta/customers.proto\022(google.cloud.cloudco" + + "ntrolspartner.v1beta\032\037google/api/field_b" + + "ehavior.proto\032\031google/api/resource.proto" + + "\032?google/cloud/cloudcontrolspartner/v1be" + + "ta/completion_state.proto\032\037google/protob" + + "uf/timestamp.proto\"\301\002\n\010Customer\022\021\n\004name\030" + + "\001 \001(\tB\003\340A\010\022\024\n\014display_name\030\002 \001(\t\022d\n\031cust" + + "omer_onboarding_state\030\003 \001(\0132A.google.clo" + + "ud.cloudcontrolspartner.v1beta.CustomerO" + + "nboardingState\022\024\n\014is_onboarded\030\004 \001(\010:\217\001\352" + + "A\213\001\n,cloudcontrolspartner.googleapis.com" + + "/Customer\022Forganizations/{organization}/" + + "locations/{location}/customers/{customer" + + "}*\tcustomers2\010customer\"\257\001\n\024ListCustomers" + + "Request\022D\n\006parent\030\001 \001(\tB4\340A\002\372A.\022,cloudco" + + "ntrolspartner.googleapis.com/Customer\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\023\n\006" + + "filter\030\004 \001(\tB\003\340A\001\022\025\n\010order_by\030\005 \001(\tB\003\340A\001" + + "\"\214\001\n\025ListCustomersResponse\022E\n\tcustomers\030" + + "\001 \003(\01322.google.cloud.cloudcontrolspartne" + + "r.v1beta.Customer\022\027\n\017next_page_token\030\002 \001" + + "(\t\022\023\n\013unreachable\030\003 \003(\t\"X\n\022GetCustomerRe" + + "quest\022B\n\004name\030\001 \001(\tB4\340A\002\372A.\n,cloudcontro" + + "lspartner.googleapis.com/Customer\"u\n\027Cus" + + "tomerOnboardingState\022Z\n\020onboarding_steps" + + "\030\001 \003(\0132@.google.cloud.cloudcontrolspartn" + + "er.v1beta.CustomerOnboardingStep\"\370\002\n\026Cus" + + "tomerOnboardingStep\022S\n\004step\030\001 \001(\0162E.goog" + + "le.cloud.cloudcontrolspartner.v1beta.Cus" + + "tomerOnboardingStep.Step\022.\n\nstart_time\030\002" + + " \001(\0132\032.google.protobuf.Timestamp\0223\n\017comp" + + "letion_time\030\003 \001(\0132\032.google.protobuf.Time" + + "stamp\022X\n\020completion_state\030\004 \001(\01629.google" + + ".cloud.cloudcontrolspartner.v1beta.Compl" + + "etionStateB\003\340A\003\"J\n\004Step\022\024\n\020STEP_UNSPECIF" + + "IED\020\000\022\022\n\016KAJ_ENROLLMENT\020\001\022\030\n\024CUSTOMER_EN" + + "VIRONMENT\020\002B\246\002\n,com.google.cloud.cloudco" + + "ntrolspartner.v1betaB\016CustomersProtoP\001Z`" + + "cloud.google.com/go/cloudcontrolspartner" + + "/apiv1beta/cloudcontrolspartnerpb;cloudc" + + "ontrolspartnerpb\252\002(Google.Cloud.CloudCon" + + "trolsPartner.V1Beta\312\002(Google\\Cloud\\Cloud" + + "ControlsPartner\\V1beta\352\002+Google::Cloud::" + + "CloudControlsPartner::V1betab\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.cloud.cloudcontrolspartner.v1beta.CompletionStateProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Customer_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "CustomerOnboardingState", "IsOnboarded", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_descriptor, + new java.lang.String[] { + "Customers", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingState_descriptor, + new java.lang.String[] { + "OnboardingSteps", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_CustomerOnboardingStep_descriptor, + new java.lang.String[] { + "Step", "StartTime", "CompletionTime", "CompletionState", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.CompletionStateProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnection.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnection.java new file mode 100644 index 000000000000..e49f80a22d32 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnection.java @@ -0,0 +1,2211 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Details about the EKM connection
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.EkmConnection} + */ +public final class EkmConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.EkmConnection) + EkmConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use EkmConnection.newBuilder() to construct. + private EkmConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EkmConnection() { + connectionName_ = ""; + connectionState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EkmConnection(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.class, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder.class); + } + + /** + * + * + *
+   * The EKM connection state.
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState} + */ + public enum ConnectionState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified EKM connection state
+     * 
+ * + * CONNECTION_STATE_UNSPECIFIED = 0; + */ + CONNECTION_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Available EKM connection state
+     * 
+ * + * AVAILABLE = 1; + */ + AVAILABLE(1), + /** + * + * + *
+     * Not available EKM connection state
+     * 
+ * + * NOT_AVAILABLE = 2; + */ + NOT_AVAILABLE(2), + /** + * + * + *
+     * Error EKM connection state
+     * 
+ * + * ERROR = 3; + */ + ERROR(3), + /** + * + * + *
+     * Permission denied EKM connection state
+     * 
+ * + * PERMISSION_DENIED = 4; + */ + PERMISSION_DENIED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified EKM connection state
+     * 
+ * + * CONNECTION_STATE_UNSPECIFIED = 0; + */ + public static final int CONNECTION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Available EKM connection state
+     * 
+ * + * AVAILABLE = 1; + */ + public static final int AVAILABLE_VALUE = 1; + /** + * + * + *
+     * Not available EKM connection state
+     * 
+ * + * NOT_AVAILABLE = 2; + */ + public static final int NOT_AVAILABLE_VALUE = 2; + /** + * + * + *
+     * Error EKM connection state
+     * 
+ * + * ERROR = 3; + */ + public static final int ERROR_VALUE = 3; + /** + * + * + *
+     * Permission denied EKM connection state
+     * 
+ * + * PERMISSION_DENIED = 4; + */ + public static final int PERMISSION_DENIED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConnectionState 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 ConnectionState forNumber(int value) { + switch (value) { + case 0: + return CONNECTION_STATE_UNSPECIFIED; + case 1: + return AVAILABLE; + case 2: + return NOT_AVAILABLE; + case 3: + return ERROR; + case 4: + return PERMISSION_DENIED; + 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 ConnectionState findValueByNumber(int number) { + return ConnectionState.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.cloud.cloudcontrolspartner.v1beta.EkmConnection.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ConnectionState[] VALUES = values(); + + public static ConnectionState 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 ConnectionState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState) + } + + public interface ConnectionErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The error domain for the error
+     * 
+ * + * string error_domain = 1; + * + * @return The errorDomain. + */ + java.lang.String getErrorDomain(); + /** + * + * + *
+     * The error domain for the error
+     * 
+ * + * string error_domain = 1; + * + * @return The bytes for errorDomain. + */ + com.google.protobuf.ByteString getErrorDomainBytes(); + + /** + * + * + *
+     * The error message for the error
+     * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * + * + *
+     * The error message for the error
+     * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); + } + /** + * + * + *
+   * Information around the error that occurred if the connection state is
+   * anything other than available or unspecified
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError} + */ + public static final class ConnectionError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError) + ConnectionErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionError.newBuilder() to construct. + private ConnectionError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionError() { + errorDomain_ = ""; + errorMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionError(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.class, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.Builder + .class); + } + + public static final int ERROR_DOMAIN_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorDomain_ = ""; + /** + * + * + *
+     * The error domain for the error
+     * 
+ * + * string error_domain = 1; + * + * @return The errorDomain. + */ + @java.lang.Override + public java.lang.String getErrorDomain() { + java.lang.Object ref = errorDomain_; + 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(); + errorDomain_ = s; + return s; + } + } + /** + * + * + *
+     * The error domain for the error
+     * 
+ * + * string error_domain = 1; + * + * @return The bytes for errorDomain. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorDomainBytes() { + java.lang.Object ref = errorDomain_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorDomain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + /** + * + * + *
+     * The error message for the error
+     * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + 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(); + errorMessage_ = s; + return s; + } + } + /** + * + * + *
+     * The error message for the error
+     * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = 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(errorDomain_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, errorDomain_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); + } + 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(errorDomain_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, errorDomain_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); + } + 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.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError other = + (com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError) obj; + + if (!getErrorDomain().equals(other.getErrorDomain())) return false; + if (!getErrorMessage().equals(other.getErrorMessage())) 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) + ERROR_DOMAIN_FIELD_NUMBER; + hash = (53 * hash) + getErrorDomain().hashCode(); + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + 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.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + 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.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + 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.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + 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.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError 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; + } + /** + * + * + *
+     * Information around the error that occurred if the connection state is
+     * anything other than available or unspecified
+     * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError) + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.class, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.Builder + .class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + errorDomain_ = ""; + errorMessage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError build() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError result = + new com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.errorDomain_ = errorDomain_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorMessage_ = errorMessage_; + } + } + + @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.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + .getDefaultInstance()) return this; + if (!other.getErrorDomain().isEmpty()) { + errorDomain_ = other.errorDomain_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + 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: + { + errorDomain_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + errorMessage_ = 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.lang.Object errorDomain_ = ""; + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @return The errorDomain. + */ + public java.lang.String getErrorDomain() { + java.lang.Object ref = errorDomain_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorDomain_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @return The bytes for errorDomain. + */ + public com.google.protobuf.ByteString getErrorDomainBytes() { + java.lang.Object ref = errorDomain_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorDomain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @param value The errorDomain to set. + * @return This builder for chaining. + */ + public Builder setErrorDomain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorDomain_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @return This builder for chaining. + */ + public Builder clearErrorDomain() { + errorDomain_ = getDefaultInstance().getErrorDomain(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * The error domain for the error
+       * 
+ * + * string error_domain = 1; + * + * @param value The bytes for errorDomain to set. + * @return This builder for chaining. + */ + public Builder setErrorDomainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorDomain_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMessage_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * The error message for the error
+       * 
+ * + * string error_message = 2; + * + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMessage_ = 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.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError) + private static final com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionError 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.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int CONNECTION_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object connectionName_ = ""; + /** + * + * + *
+   * Resource name of the EKM connection in the format:
+   * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+   * 
+ * + * string connection_name = 1; + * + * @return The connectionName. + */ + @java.lang.Override + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + 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(); + connectionName_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of the EKM connection in the format:
+   * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+   * 
+ * + * string connection_name = 1; + * + * @return The bytes for connectionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONNECTION_STATE_FIELD_NUMBER = 2; + private int connectionState_ = 0; + /** + * + * + *
+   * Output only. The connection state
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionState. + */ + @java.lang.Override + public int getConnectionStateValue() { + return connectionState_; + } + /** + * + * + *
+   * Output only. The connection state
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState + getConnectionState() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState result = + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState.forNumber( + connectionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState.UNRECOGNIZED + : result; + } + + public static final int CONNECTION_ERROR_FIELD_NUMBER = 3; + private com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + connectionError_; + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return Whether the connectionError field is set. + */ + @java.lang.Override + public boolean hasConnectionError() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return The connectionError. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + getConnectionError() { + return connectionError_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + .getDefaultInstance() + : connectionError_; + } + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionErrorOrBuilder + getConnectionErrorOrBuilder() { + return connectionError_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + .getDefaultInstance() + : connectionError_; + } + + 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(connectionName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, connectionName_); + } + if (connectionState_ + != com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState + .CONNECTION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, connectionState_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getConnectionError()); + } + 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(connectionName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, connectionName_); + } + if (connectionState_ + != com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState + .CONNECTION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, connectionState_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getConnectionError()); + } + 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.cloud.cloudcontrolspartner.v1beta.EkmConnection)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection other = + (com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection) obj; + + if (!getConnectionName().equals(other.getConnectionName())) return false; + if (connectionState_ != other.connectionState_) return false; + if (hasConnectionError() != other.hasConnectionError()) return false; + if (hasConnectionError()) { + if (!getConnectionError().equals(other.getConnectionError())) 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) + CONNECTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getConnectionName().hashCode(); + hash = (37 * hash) + CONNECTION_STATE_FIELD_NUMBER; + hash = (53 * hash) + connectionState_; + if (hasConnectionError()) { + hash = (37 * hash) + CONNECTION_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getConnectionError().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection 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.cloud.cloudcontrolspartner.v1beta.EkmConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection 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.cloud.cloudcontrolspartner.v1beta.EkmConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection 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.cloud.cloudcontrolspartner.v1beta.EkmConnection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection 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.cloud.cloudcontrolspartner.v1beta.EkmConnection 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; + } + /** + * + * + *
+   * Details about the EKM connection
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.EkmConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.EkmConnection) + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.class, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConnectionErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + connectionName_ = ""; + connectionState_ = 0; + connectionError_ = null; + if (connectionErrorBuilder_ != null) { + connectionErrorBuilder_.dispose(); + connectionErrorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection build() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection result = + new com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.connectionName_ = connectionName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.connectionState_ = connectionState_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.connectionError_ = + connectionErrorBuilder_ == null ? connectionError_ : connectionErrorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.getDefaultInstance()) + return this; + if (!other.getConnectionName().isEmpty()) { + connectionName_ = other.connectionName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.connectionState_ != 0) { + setConnectionStateValue(other.getConnectionStateValue()); + } + if (other.hasConnectionError()) { + mergeConnectionError(other.getConnectionError()); + } + 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: + { + connectionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + connectionState_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getConnectionErrorFieldBuilder().getBuilder(), extensionRegistry); + 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 connectionName_ = ""; + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @return The connectionName. + */ + public java.lang.String getConnectionName() { + java.lang.Object ref = connectionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + connectionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @return The bytes for connectionName. + */ + public com.google.protobuf.ByteString getConnectionNameBytes() { + java.lang.Object ref = connectionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + connectionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @param value The connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + connectionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearConnectionName() { + connectionName_ = getDefaultInstance().getConnectionName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of the EKM connection in the format:
+     * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+     * 
+ * + * string connection_name = 1; + * + * @param value The bytes for connectionName to set. + * @return This builder for chaining. + */ + public Builder setConnectionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + connectionName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int connectionState_ = 0; + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionState. + */ + @java.lang.Override + public int getConnectionStateValue() { + return connectionState_; + } + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for connectionState to set. + * @return This builder for chaining. + */ + public Builder setConnectionStateValue(int value) { + connectionState_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState + getConnectionState() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState result = + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState.forNumber( + connectionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The connectionState to set. + * @return This builder for chaining. + */ + public Builder setConnectionState( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + connectionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The connection state
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionState() { + bitField0_ = (bitField0_ & ~0x00000002); + connectionState_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + connectionError_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionErrorOrBuilder> + connectionErrorBuilder_; + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return Whether the connectionError field is set. + */ + public boolean hasConnectionError() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return The connectionError. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + getConnectionError() { + if (connectionErrorBuilder_ == null) { + return connectionError_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + .getDefaultInstance() + : connectionError_; + } else { + return connectionErrorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + public Builder setConnectionError( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError value) { + if (connectionErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionError_ = value; + } else { + connectionErrorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + public Builder setConnectionError( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.Builder + builderForValue) { + if (connectionErrorBuilder_ == null) { + connectionError_ = builderForValue.build(); + } else { + connectionErrorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + public Builder mergeConnectionError( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError value) { + if (connectionErrorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && connectionError_ != null + && connectionError_ + != com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + .getDefaultInstance()) { + getConnectionErrorBuilder().mergeFrom(value); + } else { + connectionError_ = value; + } + } else { + connectionErrorBuilder_.mergeFrom(value); + } + if (connectionError_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + public Builder clearConnectionError() { + bitField0_ = (bitField0_ & ~0x00000004); + connectionError_ = null; + if (connectionErrorBuilder_ != null) { + connectionErrorBuilder_.dispose(); + connectionErrorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.Builder + getConnectionErrorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getConnectionErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionErrorOrBuilder + getConnectionErrorOrBuilder() { + if (connectionErrorBuilder_ != null) { + return connectionErrorBuilder_.getMessageOrBuilder(); + } else { + return connectionError_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError + .getDefaultInstance() + : connectionError_; + } + } + /** + * + * + *
+     * The connection error that occurred if any
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionErrorOrBuilder> + getConnectionErrorFieldBuilder() { + if (connectionErrorBuilder_ == null) { + connectionErrorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection + .ConnectionErrorOrBuilder>( + getConnectionError(), getParentForChildren(), isClean()); + connectionError_ = null; + } + return connectionErrorBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1beta.EkmConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.EkmConnection) + private static final com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EkmConnection 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.cloud.cloudcontrolspartner.v1beta.EkmConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionOrBuilder.java new file mode 100644 index 000000000000..b83ab81e3eb5 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionOrBuilder.java @@ -0,0 +1,124 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface EkmConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.EkmConnection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Resource name of the EKM connection in the format:
+   * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+   * 
+ * + * string connection_name = 1; + * + * @return The connectionName. + */ + java.lang.String getConnectionName(); + /** + * + * + *
+   * Resource name of the EKM connection in the format:
+   * projects/{project}/locations/{location}/ekmConnections/{ekm_connection}
+   * 
+ * + * string connection_name = 1; + * + * @return The bytes for connectionName. + */ + com.google.protobuf.ByteString getConnectionNameBytes(); + + /** + * + * + *
+   * Output only. The connection state
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionState. + */ + int getConnectionStateValue(); + /** + * + * + *
+   * Output only. The connection state
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState connection_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionState. + */ + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionState getConnectionState(); + + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return Whether the connectionError field is set. + */ + boolean hasConnectionError(); + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + * + * @return The connectionError. + */ + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError getConnectionError(); + /** + * + * + *
+   * The connection error that occurred if any
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionError connection_error = 3; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.ConnectionErrorOrBuilder + getConnectionErrorOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnections.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnections.java new file mode 100644 index 000000000000..d75b841748c3 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnections.java @@ -0,0 +1,1175 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * The EKM connections associated with a workload
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.EkmConnections} + */ +public final class EkmConnections extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.EkmConnections) + EkmConnectionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use EkmConnections.newBuilder() to construct. + private EkmConnections(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EkmConnections() { + name_ = ""; + ekmConnections_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EkmConnections(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections.class, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EKM_CONNECTIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + ekmConnections_; + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + @java.lang.Override + public java.util.List + getEkmConnectionsList() { + return ekmConnections_; + } + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder> + getEkmConnectionsOrBuilderList() { + return ekmConnections_; + } + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + @java.lang.Override + public int getEkmConnectionsCount() { + return ekmConnections_.size(); + } + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection getEkmConnections(int index) { + return ekmConnections_.get(index); + } + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder + getEkmConnectionsOrBuilder(int index) { + return ekmConnections_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < ekmConnections_.size(); i++) { + output.writeMessage(2, ekmConnections_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < ekmConnections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, ekmConnections_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections other = + (com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEkmConnectionsList().equals(other.getEkmConnectionsList())) 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 (getEkmConnectionsCount() > 0) { + hash = (37 * hash) + EKM_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getEkmConnectionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections 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.cloud.cloudcontrolspartner.v1beta.EkmConnections parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections 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.cloud.cloudcontrolspartner.v1beta.EkmConnections parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections 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.cloud.cloudcontrolspartner.v1beta.EkmConnections parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections 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.cloud.cloudcontrolspartner.v1beta.EkmConnections 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 EKM connections associated with a workload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.EkmConnections} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.EkmConnections) + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections.class, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (ekmConnectionsBuilder_ == null) { + ekmConnections_ = java.util.Collections.emptyList(); + } else { + ekmConnections_ = null; + ekmConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections build() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections result = + new com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections result) { + if (ekmConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + ekmConnections_ = java.util.Collections.unmodifiableList(ekmConnections_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ekmConnections_ = ekmConnections_; + } else { + result.ekmConnections_ = ekmConnectionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections 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.cloud.cloudcontrolspartner.v1beta.EkmConnections) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (ekmConnectionsBuilder_ == null) { + if (!other.ekmConnections_.isEmpty()) { + if (ekmConnections_.isEmpty()) { + ekmConnections_ = other.ekmConnections_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEkmConnectionsIsMutable(); + ekmConnections_.addAll(other.ekmConnections_); + } + onChanged(); + } + } else { + if (!other.ekmConnections_.isEmpty()) { + if (ekmConnectionsBuilder_.isEmpty()) { + ekmConnectionsBuilder_.dispose(); + ekmConnectionsBuilder_ = null; + ekmConnections_ = other.ekmConnections_; + bitField0_ = (bitField0_ & ~0x00000002); + ekmConnectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEkmConnectionsFieldBuilder() + : null; + } else { + ekmConnectionsBuilder_.addAllMessages(other.ekmConnections_); + } + } + } + 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.cloud.cloudcontrolspartner.v1beta.EkmConnection m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.parser(), + extensionRegistry); + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(m); + } else { + ekmConnectionsBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List + ekmConnections_ = java.util.Collections.emptyList(); + + private void ensureEkmConnectionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ekmConnections_ = + new java.util.ArrayList( + ekmConnections_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder> + ekmConnectionsBuilder_; + + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public java.util.List + getEkmConnectionsList() { + if (ekmConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(ekmConnections_); + } else { + return ekmConnectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public int getEkmConnectionsCount() { + if (ekmConnectionsBuilder_ == null) { + return ekmConnections_.size(); + } else { + return ekmConnectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection getEkmConnections(int index) { + if (ekmConnectionsBuilder_ == null) { + return ekmConnections_.get(index); + } else { + return ekmConnectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder setEkmConnections( + int index, com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection value) { + if (ekmConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmConnectionsIsMutable(); + ekmConnections_.set(index, value); + onChanged(); + } else { + ekmConnectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder setEkmConnections( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder builderForValue) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + ekmConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder addEkmConnections( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection value) { + if (ekmConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(value); + onChanged(); + } else { + ekmConnectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder addEkmConnections( + int index, com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection value) { + if (ekmConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(index, value); + onChanged(); + } else { + ekmConnectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder addEkmConnections( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder builderForValue) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(builderForValue.build()); + onChanged(); + } else { + ekmConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder addEkmConnections( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder builderForValue) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + ekmConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder addAllEkmConnections( + java.lang.Iterable + values) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ekmConnections_); + onChanged(); + } else { + ekmConnectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder clearEkmConnections() { + if (ekmConnectionsBuilder_ == null) { + ekmConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + ekmConnectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public Builder removeEkmConnections(int index) { + if (ekmConnectionsBuilder_ == null) { + ensureEkmConnectionsIsMutable(); + ekmConnections_.remove(index); + onChanged(); + } else { + ekmConnectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder + getEkmConnectionsBuilder(int index) { + return getEkmConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder + getEkmConnectionsOrBuilder(int index) { + if (ekmConnectionsBuilder_ == null) { + return ekmConnections_.get(index); + } else { + return ekmConnectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder> + getEkmConnectionsOrBuilderList() { + if (ekmConnectionsBuilder_ != null) { + return ekmConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ekmConnections_); + } + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder + addEkmConnectionsBuilder() { + return getEkmConnectionsFieldBuilder() + .addBuilder( + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.getDefaultInstance()); + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder + addEkmConnectionsBuilder(int index) { + return getEkmConnectionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.getDefaultInstance()); + } + /** + * + * + *
+     * The EKM connections associated with the workload
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + public java.util.List + getEkmConnectionsBuilderList() { + return getEkmConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder> + getEkmConnectionsFieldBuilder() { + if (ekmConnectionsBuilder_ == null) { + ekmConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder>( + ekmConnections_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + ekmConnections_ = null; + } + return ekmConnectionsBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1beta.EkmConnections) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.EkmConnections) + private static final com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EkmConnections 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.cloud.cloudcontrolspartner.v1beta.EkmConnections getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsName.java new file mode 100644 index 000000000000..e95efef7ff9f --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class EkmConnectionsName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + + @Deprecated + protected EkmConnectionsName() { + organization = null; + location = null; + customer = null; + workload = null; + } + + private EkmConnectionsName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static EkmConnectionsName of( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build(); + } + + public static String format( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build() + .toString(); + } + + public static EkmConnectionsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.validatedMatch( + formattedString, "EkmConnectionsName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload")); + } + + 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 (EkmConnectionsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + EkmConnectionsName that = ((EkmConnectionsName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + private Builder(EkmConnectionsName ekmConnectionsName) { + this.organization = ekmConnectionsName.organization; + this.location = ekmConnectionsName.location; + this.customer = ekmConnectionsName.customer; + this.workload = ekmConnectionsName.workload; + } + + public EkmConnectionsName build() { + return new EkmConnectionsName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsOrBuilder.java new file mode 100644 index 000000000000..afd0ba25abbc --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface EkmConnectionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.EkmConnections) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + java.util.List + getEkmConnectionsList(); + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnection getEkmConnections(int index); + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + int getEkmConnectionsCount(); + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + java.util.List + getEkmConnectionsOrBuilderList(); + /** + * + * + *
+   * The EKM connections associated with the workload
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmConnection ekm_connections = 2; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionOrBuilder getEkmConnectionsOrBuilder( + int index); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsProto.java new file mode 100644 index 000000000000..65abf9ae83dc --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmConnectionsProto.java @@ -0,0 +1,143 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class EkmConnectionsProto { + private EkmConnectionsProto() {} + + 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_cloud_cloudcontrolspartner_v1beta_EkmConnections_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_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/cloud/cloudcontrolspartner/v1be" + + "ta/ekm_connections.proto\022(google.cloud.c" + + "loudcontrolspartner.v1beta\032\037google/api/f" + + "ield_behavior.proto\032\031google/api/resource" + + ".proto\"\234\002\n\016EkmConnections\022\021\n\004name\030\001 \001(\tB" + + "\003\340A\010\022P\n\017ekm_connections\030\002 \003(\01327.google.c" + + "loud.cloudcontrolspartner.v1beta.EkmConn" + + "ection:\244\001\352A\240\001\n2cloudcontrolspartner.goog" + + "leapis.com/EkmConnections\022jorganizations" + + "/{organization}/locations/{location}/cus" + + "tomers/{customer}/workloads/{workload}/e" + + "kmConnections\"d\n\030GetEkmConnectionsReques" + + "t\022H\n\004name\030\001 \001(\tB:\340A\002\372A4\n2cloudcontrolspa" + + "rtner.googleapis.com/EkmConnections\"\254\003\n\r" + + "EkmConnection\022\027\n\017connection_name\030\001 \001(\t\022f" + + "\n\020connection_state\030\002 \001(\0162G.google.cloud." + + "cloudcontrolspartner.v1beta.EkmConnectio" + + "n.ConnectionStateB\003\340A\003\022a\n\020connection_err" + + "or\030\003 \001(\0132G.google.cloud.cloudcontrolspar" + + "tner.v1beta.EkmConnection.ConnectionErro" + + "r\032>\n\017ConnectionError\022\024\n\014error_domain\030\001 \001" + + "(\t\022\025\n\rerror_message\030\002 \001(\t\"w\n\017ConnectionS" + + "tate\022 \n\034CONNECTION_STATE_UNSPECIFIED\020\000\022\r" + + "\n\tAVAILABLE\020\001\022\021\n\rNOT_AVAILABLE\020\002\022\t\n\005ERRO" + + "R\020\003\022\025\n\021PERMISSION_DENIED\020\004B\253\002\n,com.googl" + + "e.cloud.cloudcontrolspartner.v1betaB\023Ekm" + + "ConnectionsProtoP\001Z`cloud.google.com/go/" + + "cloudcontrolspartner/apiv1beta/cloudcont" + + "rolspartnerpb;cloudcontrolspartnerpb\252\002(G" + + "oogle.Cloud.CloudControlsPartner.V1Beta\312" + + "\002(Google\\Cloud\\CloudControlsPartner\\V1be" + + "ta\352\002+Google::Cloud::CloudControlsPartner" + + "::V1betab\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(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnections_descriptor, + new java.lang.String[] { + "Name", "EkmConnections", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_descriptor, + new java.lang.String[] { + "ConnectionName", "ConnectionState", "ConnectionError", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmConnection_ConnectionError_descriptor, + new java.lang.String[] { + "ErrorDomain", "ErrorMessage", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmMetadata.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmMetadata.java new file mode 100644 index 000000000000..d116b7c8c994 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmMetadata.java @@ -0,0 +1,1006 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Holds information needed by Mudbray to use partner EKMs for workloads.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.EkmMetadata} + */ +public final class EkmMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.EkmMetadata) + EkmMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use EkmMetadata.newBuilder() to construct. + private EkmMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EkmMetadata() { + ekmSolution_ = 0; + ekmEndpointUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EkmMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.class, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder.class); + } + + /** + * + * + *
+   * Represents Google Cloud supported external key management partners
+   * [Google Cloud EKM partners
+   * docs](https://cloud.google.com/kms/docs/ekm#supported_partners).
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution} + */ + public enum EkmSolution implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified EKM solution
+     * 
+ * + * EKM_SOLUTION_UNSPECIFIED = 0; + */ + EKM_SOLUTION_UNSPECIFIED(0), + /** + * + * + *
+     * EKM Partner Fortanix
+     * 
+ * + * FORTANIX = 1; + */ + FORTANIX(1), + /** + * + * + *
+     * EKM Partner FutureX
+     * 
+ * + * FUTUREX = 2; + */ + FUTUREX(2), + /** + * + * + *
+     * EKM Partner Thales
+     * 
+ * + * THALES = 3; + */ + THALES(3), + /** + * + * + *
+     * EKM Partner Virtu
+     * 
+ * + * VIRTRU = 4; + */ + VIRTRU(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified EKM solution
+     * 
+ * + * EKM_SOLUTION_UNSPECIFIED = 0; + */ + public static final int EKM_SOLUTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * EKM Partner Fortanix
+     * 
+ * + * FORTANIX = 1; + */ + public static final int FORTANIX_VALUE = 1; + /** + * + * + *
+     * EKM Partner FutureX
+     * 
+ * + * FUTUREX = 2; + */ + public static final int FUTUREX_VALUE = 2; + /** + * + * + *
+     * EKM Partner Thales
+     * 
+ * + * THALES = 3; + */ + public static final int THALES_VALUE = 3; + /** + * + * + *
+     * EKM Partner Virtu
+     * 
+ * + * VIRTRU = 4; + */ + public static final int VIRTRU_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EkmSolution 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 EkmSolution forNumber(int value) { + switch (value) { + case 0: + return EKM_SOLUTION_UNSPECIFIED; + case 1: + return FORTANIX; + case 2: + return FUTUREX; + case 3: + return THALES; + case 4: + return VIRTRU; + 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 EkmSolution findValueByNumber(int number) { + return EkmSolution.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.cloud.cloudcontrolspartner.v1beta.EkmMetadata.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EkmSolution[] VALUES = values(); + + public static EkmSolution 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 EkmSolution(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution) + } + + public static final int EKM_SOLUTION_FIELD_NUMBER = 1; + private int ekmSolution_ = 0; + /** + * + * + *
+   * The Cloud EKM partner.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @return The enum numeric value on the wire for ekmSolution. + */ + @java.lang.Override + public int getEkmSolutionValue() { + return ekmSolution_; + } + /** + * + * + *
+   * The Cloud EKM partner.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @return The ekmSolution. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution getEkmSolution() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution result = + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution.forNumber( + ekmSolution_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution.UNRECOGNIZED + : result; + } + + public static final int EKM_ENDPOINT_URI_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ekmEndpointUri_ = ""; + /** + * + * + *
+   * Endpoint for sending requests to the EKM for key provisioning during
+   * Assured Workload creation.
+   * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The ekmEndpointUri. + */ + @java.lang.Override + public java.lang.String getEkmEndpointUri() { + java.lang.Object ref = ekmEndpointUri_; + 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(); + ekmEndpointUri_ = s; + return s; + } + } + /** + * + * + *
+   * Endpoint for sending requests to the EKM for key provisioning during
+   * Assured Workload creation.
+   * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The bytes for ekmEndpointUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEkmEndpointUriBytes() { + java.lang.Object ref = ekmEndpointUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ekmEndpointUri_ = 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 (ekmSolution_ + != com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution + .EKM_SOLUTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, ekmSolution_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ekmEndpointUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ekmEndpointUri_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ekmSolution_ + != com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution + .EKM_SOLUTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, ekmSolution_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ekmEndpointUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ekmEndpointUri_); + } + 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.cloud.cloudcontrolspartner.v1beta.EkmMetadata)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata other = + (com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata) obj; + + if (ekmSolution_ != other.ekmSolution_) return false; + if (!getEkmEndpointUri().equals(other.getEkmEndpointUri())) 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) + EKM_SOLUTION_FIELD_NUMBER; + hash = (53 * hash) + ekmSolution_; + hash = (37 * hash) + EKM_ENDPOINT_URI_FIELD_NUMBER; + hash = (53 * hash) + getEkmEndpointUri().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata 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.cloud.cloudcontrolspartner.v1beta.EkmMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata 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.cloud.cloudcontrolspartner.v1beta.EkmMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata 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.cloud.cloudcontrolspartner.v1beta.EkmMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata 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.cloud.cloudcontrolspartner.v1beta.EkmMetadata 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; + } + /** + * + * + *
+   * Holds information needed by Mudbray to use partner EKMs for workloads.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.EkmMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.EkmMetadata) + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.class, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ekmSolution_ = 0; + ekmEndpointUri_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata build() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata result = + new com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ekmSolution_ = ekmSolution_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ekmEndpointUri_ = ekmEndpointUri_; + } + } + + @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.cloud.cloudcontrolspartner.v1beta.EkmMetadata) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.getDefaultInstance()) + return this; + if (other.ekmSolution_ != 0) { + setEkmSolutionValue(other.getEkmSolutionValue()); + } + if (!other.getEkmEndpointUri().isEmpty()) { + ekmEndpointUri_ = other.ekmEndpointUri_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + ekmSolution_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + ekmEndpointUri_ = 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 int ekmSolution_ = 0; + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @return The enum numeric value on the wire for ekmSolution. + */ + @java.lang.Override + public int getEkmSolutionValue() { + return ekmSolution_; + } + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @param value The enum numeric value on the wire for ekmSolution to set. + * @return This builder for chaining. + */ + public Builder setEkmSolutionValue(int value) { + ekmSolution_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @return The ekmSolution. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution getEkmSolution() { + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution result = + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution.forNumber( + ekmSolution_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @param value The ekmSolution to set. + * @return This builder for chaining. + */ + public Builder setEkmSolution( + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + ekmSolution_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud EKM partner.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @return This builder for chaining. + */ + public Builder clearEkmSolution() { + bitField0_ = (bitField0_ & ~0x00000001); + ekmSolution_ = 0; + onChanged(); + return this; + } + + private java.lang.Object ekmEndpointUri_ = ""; + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The ekmEndpointUri. + */ + public java.lang.String getEkmEndpointUri() { + java.lang.Object ref = ekmEndpointUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ekmEndpointUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The bytes for ekmEndpointUri. + */ + public com.google.protobuf.ByteString getEkmEndpointUriBytes() { + java.lang.Object ref = ekmEndpointUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ekmEndpointUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @param value The ekmEndpointUri to set. + * @return This builder for chaining. + */ + public Builder setEkmEndpointUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ekmEndpointUri_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearEkmEndpointUri() { + ekmEndpointUri_ = getDefaultInstance().getEkmEndpointUri(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Endpoint for sending requests to the EKM for key provisioning during
+     * Assured Workload creation.
+     * 
+ * + * string ekm_endpoint_uri = 2; + * + * @param value The bytes for ekmEndpointUri to set. + * @return This builder for chaining. + */ + public Builder setEkmEndpointUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ekmEndpointUri_ = 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.cloud.cloudcontrolspartner.v1beta.EkmMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.EkmMetadata) + private static final com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EkmMetadata 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.cloud.cloudcontrolspartner.v1beta.EkmMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmMetadataOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmMetadataOrBuilder.java new file mode 100644 index 000000000000..c7bae45a478d --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/EkmMetadataOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface EkmMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.EkmMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Cloud EKM partner.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @return The enum numeric value on the wire for ekmSolution. + */ + int getEkmSolutionValue(); + /** + * + * + *
+   * The Cloud EKM partner.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution ekm_solution = 1; + * + * + * @return The ekmSolution. + */ + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.EkmSolution getEkmSolution(); + + /** + * + * + *
+   * Endpoint for sending requests to the EKM for key provisioning during
+   * Assured Workload creation.
+   * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The ekmEndpointUri. + */ + java.lang.String getEkmEndpointUri(); + /** + * + * + *
+   * Endpoint for sending requests to the EKM for key provisioning during
+   * Assured Workload creation.
+   * 
+ * + * string ekm_endpoint_uri = 2; + * + * @return The bytes for ekmEndpointUri. + */ + com.google.protobuf.ByteString getEkmEndpointUriBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetCustomerRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetCustomerRequest.java new file mode 100644 index 000000000000..45abd73253ad --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetCustomerRequest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Message for getting a customer
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest} + */ +public final class GetCustomerRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) + GetCustomerRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCustomerRequest.newBuilder() to construct. + private GetCustomerRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCustomerRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCustomerRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * + * 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. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest 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 customer
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest.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.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetCustomerRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest.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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCustomerRequest 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.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetCustomerRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetCustomerRequestOrBuilder.java new file mode 100644 index 000000000000..ee3d11cdc02c --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetCustomerRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface GetCustomerRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetEkmConnectionsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetEkmConnectionsRequest.java new file mode 100644 index 000000000000..93c8fd99b15c --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetEkmConnectionsRequest.java @@ -0,0 +1,658 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Request for getting the EKM connections associated with a workload
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest} + */ +public final class GetEkmConnectionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) + GetEkmConnectionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetEkmConnectionsRequest.newBuilder() to construct. + private GetEkmConnectionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetEkmConnectionsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetEkmConnectionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+   * 
+ * + * + * 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. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for getting the EKM connections associated with a workload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest.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.cloud.cloudcontrolspartner.v1beta.EkmConnectionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetEkmConnectionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + .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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetEkmConnectionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetEkmConnectionsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetEkmConnectionsRequestOrBuilder.java new file mode 100644 index 000000000000..ff68d4b1afb8 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetEkmConnectionsRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface GetEkmConnectionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerPermissionsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerPermissionsRequest.java new file mode 100644 index 000000000000..aae97f995b5a --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerPermissionsRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Request for getting the partner permissions granted for a workload
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest} + */ +public final class GetPartnerPermissionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) + GetPartnerPermissionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPartnerPermissionsRequest.newBuilder() to construct. + private GetPartnerPermissionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPartnerPermissionsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPartnerPermissionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest.Builder + .class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource to get in the format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+   * 
+ * + * + * 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 to get in the format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for getting the partner permissions granted for a workload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest.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.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + .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 to get in the format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * + * 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 to get in the format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * + * 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 to get in the format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * + * 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 to get in the format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * + * 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 to get in the format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPartnerPermissionsRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerPermissionsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerPermissionsRequestOrBuilder.java new file mode 100644 index 000000000000..517e87db473b --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerPermissionsRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface GetPartnerPermissionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource to get in the format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource to get in the format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerRequest.java new file mode 100644 index 000000000000..8ff5ba281220 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerRequest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Message for getting a Partner
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest} + */ +public final class GetPartnerRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) + GetPartnerRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPartnerRequest.newBuilder() to construct. + private GetPartnerRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPartnerRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPartnerRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format: organizations/{organization}/locations/{location}/partner
+   * 
+ * + * + * 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. Format: organizations/{organization}/locations/{location}/partner
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest 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 Partner
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest.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.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest.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. Format: organizations/{organization}/locations/{location}/partner
+     * 
+ * + * + * 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. Format: organizations/{organization}/locations/{location}/partner
+     * 
+ * + * + * 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. Format: organizations/{organization}/locations/{location}/partner
+     * 
+ * + * + * 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. Format: organizations/{organization}/locations/{location}/partner
+     * 
+ * + * + * 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. Format: organizations/{organization}/locations/{location}/partner
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPartnerRequest 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.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerRequestOrBuilder.java new file mode 100644 index 000000000000..01c7f1a4fcb7 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetPartnerRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface GetPartnerRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format: organizations/{organization}/locations/{location}/partner
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format: organizations/{organization}/locations/{location}/partner
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetViolationRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetViolationRequest.java new file mode 100644 index 000000000000..877e793629ad --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetViolationRequest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Message for getting a Violation
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest} + */ +public final class GetViolationRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) + GetViolationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetViolationRequest.newBuilder() to construct. + private GetViolationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetViolationRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetViolationRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+   * 
+ * + * + * 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. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest 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 Violation
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest.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.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest.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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetViolationRequest 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.cloud.cloudcontrolspartner.v1beta.GetViolationRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetViolationRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetViolationRequestOrBuilder.java new file mode 100644 index 000000000000..ceb730e52e68 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetViolationRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface GetViolationRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetWorkloadRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetWorkloadRequest.java new file mode 100644 index 000000000000..9266476743a1 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetWorkloadRequest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Message for getting a customer workload.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest} + */ +public final class GetWorkloadRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) + GetWorkloadRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetWorkloadRequest.newBuilder() to construct. + private GetWorkloadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetWorkloadRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetWorkloadRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * 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. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest 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 customer workload.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest.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.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_GetWorkloadRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest.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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetWorkloadRequest 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.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetWorkloadRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetWorkloadRequestOrBuilder.java new file mode 100644 index 000000000000..ba61e6d8baae --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/GetWorkloadRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface GetWorkloadRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsRequest.java new file mode 100644 index 000000000000..252a05f4f040 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsRequest.java @@ -0,0 +1,1343 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Request for getting the access requests associated with a workload.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest} + */ +public final class ListAccessApprovalRequestsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) + ListAccessApprovalRequestsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAccessApprovalRequestsRequest.newBuilder() to construct. + private ListAccessApprovalRequestsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAccessApprovalRequestsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAccessApprovalRequestsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest.Builder + .class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * 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 resource
+   * Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of access requests to return. The service may
+   * return fewer than this value. If unspecified, at most 500 access requests
+   * will be returned.
+   * 
+ * + * 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 page token, received from a previous
+   * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+   * page.
+   * 
+ * + * 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 page token, received from a previous
+   * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+   * page.
+   * 
+ * + * 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. Filtering results.
+   * 
+ * + * 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. Filtering results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for getting the access requests associated with a workload.
+   * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest.Builder + .class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest.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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + .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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of access requests to return. The service may
+     * return fewer than this value. If unspecified, at most 500 access requests
+     * will be returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of access requests to return. The service may
+     * return fewer than this value. If unspecified, at most 500 access requests
+     * will be returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of access requests to return. The service may
+     * return fewer than this value. If unspecified, at most 500 access requests
+     * will be returned.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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 page token, received from a previous
+     * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+     * page.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta + .ListAccessApprovalRequestsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAccessApprovalRequestsRequest 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsRequestOrBuilder.java new file mode 100644 index 000000000000..7acad2700ec8 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsRequestOrBuilder.java @@ -0,0 +1,153 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ListAccessApprovalRequestsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of access requests to return. The service may
+   * return fewer than this value. If unspecified, at most 500 access requests
+   * will be returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+   * page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous
+   * `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent
+   * page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsResponse.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsResponse.java new file mode 100644 index 000000000000..92599fd39a3f --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsResponse.java @@ -0,0 +1,1517 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Response message for list access requests.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse} + */ +public final class ListAccessApprovalRequestsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse) + ListAccessApprovalRequestsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAccessApprovalRequestsResponse.newBuilder() to construct. + private ListAccessApprovalRequestsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAccessApprovalRequestsResponse() { + accessApprovalRequests_ = 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 ListAccessApprovalRequestsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse.Builder + .class); + } + + public static final int ACCESS_APPROVAL_REQUESTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + accessApprovalRequests_; + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public java.util.List + getAccessApprovalRequestsList() { + return accessApprovalRequests_; + } + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder> + getAccessApprovalRequestsOrBuilderList() { + return accessApprovalRequests_; + } + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public int getAccessApprovalRequestsCount() { + return accessApprovalRequests_.size(); + } + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + getAccessApprovalRequests(int index) { + return accessApprovalRequests_.get(index); + } + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder + getAccessApprovalRequestsOrBuilder(int index) { + return accessApprovalRequests_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that 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 that 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 < accessApprovalRequests_.size(); i++) { + output.writeMessage(1, accessApprovalRequests_.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 < accessApprovalRequests_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, accessApprovalRequests_.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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse other = + (com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse) obj; + + if (!getAccessApprovalRequestsList().equals(other.getAccessApprovalRequestsList())) + 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 (getAccessApprovalRequestsCount() > 0) { + hash = (37 * hash) + ACCESS_APPROVAL_REQUESTS_FIELD_NUMBER; + hash = (53 * hash) + getAccessApprovalRequestsList().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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for list access requests.
+   * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse) + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + .Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (accessApprovalRequestsBuilder_ == null) { + accessApprovalRequests_ = java.util.Collections.emptyList(); + } else { + accessApprovalRequests_ = null; + accessApprovalRequestsBuilder_.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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListAccessApprovalRequestsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse build() { + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse result = + new com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse result) { + if (accessApprovalRequestsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + accessApprovalRequests_ = java.util.Collections.unmodifiableList(accessApprovalRequests_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.accessApprovalRequests_ = accessApprovalRequests_; + } else { + result.accessApprovalRequests_ = accessApprovalRequestsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + .getDefaultInstance()) return this; + if (accessApprovalRequestsBuilder_ == null) { + if (!other.accessApprovalRequests_.isEmpty()) { + if (accessApprovalRequests_.isEmpty()) { + accessApprovalRequests_ = other.accessApprovalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.addAll(other.accessApprovalRequests_); + } + onChanged(); + } + } else { + if (!other.accessApprovalRequests_.isEmpty()) { + if (accessApprovalRequestsBuilder_.isEmpty()) { + accessApprovalRequestsBuilder_.dispose(); + accessApprovalRequestsBuilder_ = null; + accessApprovalRequests_ = other.accessApprovalRequests_; + bitField0_ = (bitField0_ & ~0x00000001); + accessApprovalRequestsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAccessApprovalRequestsFieldBuilder() + : null; + } else { + accessApprovalRequestsBuilder_.addAllMessages(other.accessApprovalRequests_); + } + } + } + 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.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.parser(), + extensionRegistry); + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(m); + } else { + accessApprovalRequestsBuilder_.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 + accessApprovalRequests_ = java.util.Collections.emptyList(); + + private void ensureAccessApprovalRequestsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + accessApprovalRequests_ = + new java.util.ArrayList< + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest>( + accessApprovalRequests_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder> + accessApprovalRequestsBuilder_; + + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public java.util.List + getAccessApprovalRequestsList() { + if (accessApprovalRequestsBuilder_ == null) { + return java.util.Collections.unmodifiableList(accessApprovalRequests_); + } else { + return accessApprovalRequestsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public int getAccessApprovalRequestsCount() { + if (accessApprovalRequestsBuilder_ == null) { + return accessApprovalRequests_.size(); + } else { + return accessApprovalRequestsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + getAccessApprovalRequests(int index) { + if (accessApprovalRequestsBuilder_ == null) { + return accessApprovalRequests_.get(index); + } else { + return accessApprovalRequestsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder setAccessApprovalRequests( + int index, com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest value) { + if (accessApprovalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.set(index, value); + onChanged(); + } else { + accessApprovalRequestsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder setAccessApprovalRequests( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder + builderForValue) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.set(index, builderForValue.build()); + onChanged(); + } else { + accessApprovalRequestsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest value) { + if (accessApprovalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(value); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAccessApprovalRequests( + int index, com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest value) { + if (accessApprovalRequestsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(index, value); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAccessApprovalRequests( + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder + builderForValue) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(builderForValue.build()); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAccessApprovalRequests( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder + builderForValue) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.add(index, builderForValue.build()); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder addAllAccessApprovalRequests( + java.lang.Iterable< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest> + values) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, accessApprovalRequests_); + onChanged(); + } else { + accessApprovalRequestsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder clearAccessApprovalRequests() { + if (accessApprovalRequestsBuilder_ == null) { + accessApprovalRequests_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + accessApprovalRequestsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public Builder removeAccessApprovalRequests(int index) { + if (accessApprovalRequestsBuilder_ == null) { + ensureAccessApprovalRequestsIsMutable(); + accessApprovalRequests_.remove(index); + onChanged(); + } else { + accessApprovalRequestsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder + getAccessApprovalRequestsBuilder(int index) { + return getAccessApprovalRequestsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder + getAccessApprovalRequestsOrBuilder(int index) { + if (accessApprovalRequestsBuilder_ == null) { + return accessApprovalRequests_.get(index); + } else { + return accessApprovalRequestsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder> + getAccessApprovalRequestsOrBuilderList() { + if (accessApprovalRequestsBuilder_ != null) { + return accessApprovalRequestsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(accessApprovalRequests_); + } + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder + addAccessApprovalRequestsBuilder() { + return getAccessApprovalRequestsFieldBuilder() + .addBuilder( + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + .getDefaultInstance()); + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder + addAccessApprovalRequestsBuilder(int index) { + return getAccessApprovalRequestsFieldBuilder() + .addBuilder( + index, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest + .getDefaultInstance()); + } + /** + * + * + *
+     * List of access approval requests
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + public java.util.List< + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder> + getAccessApprovalRequestsBuilderList() { + return getAccessApprovalRequestsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder> + getAccessApprovalRequestsFieldBuilder() { + if (accessApprovalRequestsBuilder_ == null) { + accessApprovalRequestsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder>( + accessApprovalRequests_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + accessApprovalRequests_ = null; + } + return accessApprovalRequestsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that 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 that 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 that 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 that 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 that 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse) + private static final com.google.cloud.cloudcontrolspartner.v1beta + .ListAccessApprovalRequestsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAccessApprovalRequestsResponse 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.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsResponseOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsResponseOrBuilder.java new file mode 100644 index 000000000000..6e213fe481d6 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListAccessApprovalRequestsResponseOrBuilder.java @@ -0,0 +1,170 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ListAccessApprovalRequestsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + java.util.List + getAccessApprovalRequestsList(); + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest getAccessApprovalRequests( + int index); + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + int getAccessApprovalRequestsCount(); + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder> + getAccessApprovalRequestsOrBuilderList(); + /** + * + * + *
+   * List of access approval requests
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest access_approval_requests = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequestOrBuilder + getAccessApprovalRequestsOrBuilder(int index); + + /** + * + * + *
+   * A token that 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 that 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersRequest.java new file mode 100644 index 000000000000..b74d4596e598 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersRequest.java @@ -0,0 +1,1306 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Request to list customers
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest} + */ +public final class ListCustomersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) + ListCustomersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCustomersRequest.newBuilder() to construct. + private ListCustomersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCustomersRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCustomersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource
+   * Format: organizations/{organization}/locations/{location}
+   * 
+ * + * + * 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 resource
+   * Format: organizations/{organization}/locations/{location}
+   * 
+ * + * + * 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; + /** + * + * + *
+   * The maximum number of Customers to return. The service may return fewer
+   * than this value. If unspecified, at most 500 Customers will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListCustomers` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListCustomers` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * 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. Filtering results
+   * 
+ * + * 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. Hint for how to order the results
+   * 
+ * + * 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. Hint for how to order the results
+   * 
+ * + * 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest + 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request to list customers
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest.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.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest.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 resource
+     * Format: organizations/{organization}/locations/{location}
+     * 
+ * + * + * 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 resource
+     * Format: organizations/{organization}/locations/{location}
+     * 
+ * + * + * 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 resource
+     * Format: organizations/{organization}/locations/{location}
+     * 
+ * + * + * 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 resource
+     * Format: organizations/{organization}/locations/{location}
+     * 
+ * + * + * 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 resource
+     * Format: organizations/{organization}/locations/{location}
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * The maximum number of Customers to return. The service may return fewer
+     * than this value. If unspecified, at most 500 Customers will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of Customers to return. The service may return fewer
+     * than this value. If unspecified, at most 500 Customers will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of Customers to return. The service may return fewer
+     * than this value. If unspecified, at most 500 Customers will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListCustomers` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomersRequest 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.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersRequestOrBuilder.java new file mode 100644 index 000000000000..6d6e9c15aa63 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ListCustomersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource
+   * Format: organizations/{organization}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource
+   * Format: organizations/{organization}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of Customers to return. The service may return fewer
+   * than this value. If unspecified, at most 500 Customers will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListCustomers` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListCustomers` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersResponse.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersResponse.java new file mode 100644 index 000000000000..837c1d8c701d --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersResponse.java @@ -0,0 +1,1427 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Response message for list customer Customers requests
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse} + */ +public final class ListCustomersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse) + ListCustomersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCustomersResponse.newBuilder() to construct. + private ListCustomersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCustomersResponse() { + customers_ = 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 ListCustomersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse.Builder.class); + } + + public static final int CUSTOMERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List customers_; + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + @java.lang.Override + public java.util.List getCustomersList() { + return customers_; + } + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + @java.lang.Override + public java.util.List + getCustomersOrBuilderList() { + return customers_; + } + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + @java.lang.Override + public int getCustomersCount() { + return customers_.size(); + } + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Customer getCustomers(int index) { + return customers_.get(index); + } + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOrBuilder getCustomersOrBuilder( + int index) { + return customers_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that 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 that 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 < customers_.size(); i++) { + output.writeMessage(1, customers_.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 < customers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, customers_.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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse other = + (com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse) obj; + + if (!getCustomersList().equals(other.getCustomersList())) 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 (getCustomersCount() > 0) { + hash = (37 * hash) + CUSTOMERS_FIELD_NUMBER; + hash = (53 * hash) + getCustomersList().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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + 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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for list customer Customers requests
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse) + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (customersBuilder_ == null) { + customers_ = java.util.Collections.emptyList(); + } else { + customers_ = null; + customersBuilder_.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.cloud.cloudcontrolspartner.v1beta.CustomersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListCustomersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse build() { + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse result = + new com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse result) { + if (customersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + customers_ = java.util.Collections.unmodifiableList(customers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.customers_ = customers_; + } else { + result.customers_ = customersBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse 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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + .getDefaultInstance()) return this; + if (customersBuilder_ == null) { + if (!other.customers_.isEmpty()) { + if (customers_.isEmpty()) { + customers_ = other.customers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCustomersIsMutable(); + customers_.addAll(other.customers_); + } + onChanged(); + } + } else { + if (!other.customers_.isEmpty()) { + if (customersBuilder_.isEmpty()) { + customersBuilder_.dispose(); + customersBuilder_ = null; + customers_ = other.customers_; + bitField0_ = (bitField0_ & ~0x00000001); + customersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCustomersFieldBuilder() + : null; + } else { + customersBuilder_.addAllMessages(other.customers_); + } + } + } + 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.cloud.cloudcontrolspartner.v1beta.Customer m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.Customer.parser(), + extensionRegistry); + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.add(m); + } else { + customersBuilder_.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 customers_ = + java.util.Collections.emptyList(); + + private void ensureCustomersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + customers_ = + new java.util.ArrayList( + customers_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Customer, + com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOrBuilder> + customersBuilder_; + + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public java.util.List + getCustomersList() { + if (customersBuilder_ == null) { + return java.util.Collections.unmodifiableList(customers_); + } else { + return customersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public int getCustomersCount() { + if (customersBuilder_ == null) { + return customers_.size(); + } else { + return customersBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Customer getCustomers(int index) { + if (customersBuilder_ == null) { + return customers_.get(index); + } else { + return customersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder setCustomers( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Customer value) { + if (customersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomersIsMutable(); + customers_.set(index, value); + onChanged(); + } else { + customersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder setCustomers( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder builderForValue) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.set(index, builderForValue.build()); + onChanged(); + } else { + customersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder addCustomers(com.google.cloud.cloudcontrolspartner.v1beta.Customer value) { + if (customersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomersIsMutable(); + customers_.add(value); + onChanged(); + } else { + customersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder addCustomers( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Customer value) { + if (customersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomersIsMutable(); + customers_.add(index, value); + onChanged(); + } else { + customersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder addCustomers( + com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder builderForValue) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.add(builderForValue.build()); + onChanged(); + } else { + customersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder addCustomers( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder builderForValue) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.add(index, builderForValue.build()); + onChanged(); + } else { + customersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder addAllCustomers( + java.lang.Iterable + values) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customers_); + onChanged(); + } else { + customersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder clearCustomers() { + if (customersBuilder_ == null) { + customers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + customersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public Builder removeCustomers(int index) { + if (customersBuilder_ == null) { + ensureCustomersIsMutable(); + customers_.remove(index); + onChanged(); + } else { + customersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder getCustomersBuilder( + int index) { + return getCustomersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.CustomerOrBuilder getCustomersOrBuilder( + int index) { + if (customersBuilder_ == null) { + return customers_.get(index); + } else { + return customersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public java.util.List + getCustomersOrBuilderList() { + if (customersBuilder_ != null) { + return customersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customers_); + } + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder addCustomersBuilder() { + return getCustomersFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1beta.Customer.getDefaultInstance()); + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder addCustomersBuilder( + int index) { + return getCustomersFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1beta.Customer.getDefaultInstance()); + } + /** + * + * + *
+     * List of customers
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + public java.util.List + getCustomersBuilderList() { + return getCustomersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Customer, + com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOrBuilder> + getCustomersFieldBuilder() { + if (customersBuilder_ == null) { + customersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Customer, + com.google.cloud.cloudcontrolspartner.v1beta.Customer.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOrBuilder>( + customers_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + customers_ = null; + } + return customersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that 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 that 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 that 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 that 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 that 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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse) + private static final com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomersResponse 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.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersResponseOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersResponseOrBuilder.java new file mode 100644 index 000000000000..47245f6198df --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListCustomersResponseOrBuilder.java @@ -0,0 +1,156 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customers.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ListCustomersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + java.util.List getCustomersList(); + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + com.google.cloud.cloudcontrolspartner.v1beta.Customer getCustomers(int index); + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + int getCustomersCount(); + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + java.util.List + getCustomersOrBuilderList(); + /** + * + * + *
+   * List of customers
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Customer customers = 1; + */ + com.google.cloud.cloudcontrolspartner.v1beta.CustomerOrBuilder getCustomersOrBuilder(int index); + + /** + * + * + *
+   * A token that 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 that 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsRequest.java new file mode 100644 index 000000000000..99897345b6ee --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsRequest.java @@ -0,0 +1,1602 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Message for requesting list of Violations
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest} + */ +public final class ListViolationsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) + ListViolationsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListViolationsRequest.newBuilder() to construct. + private ListViolationsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListViolationsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListViolationsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource
+   * Format
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * 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 resource
+   * Format
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. The maximum number of customers row to return. The service may
+   * return fewer than this value. If unspecified, at most 10 customers will be
+   * returned.
+   * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * 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. Filtering results
+   * 
+ * + * 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. Filtering results
+   * 
+ * + * 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. Hint for how to order the results
+   * 
+ * + * 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. Hint for how to order the results
+   * 
+ * + * 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; + } + } + + public static final int INTERVAL_FIELD_NUMBER = 6; + private com.google.type.Interval interval_; + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the interval field is set. + */ + @java.lang.Override + public boolean hasInterval() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interval. + */ + @java.lang.Override + public com.google.type.Interval getInterval() { + return interval_ == null ? com.google.type.Interval.getDefaultInstance() : interval_; + } + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.type.IntervalOrBuilder getIntervalOrBuilder() { + return interval_ == null ? com.google.type.Interval.getDefaultInstance() : interval_; + } + + 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_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getInterval()); + } + 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_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getInterval()); + } + 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.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) 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 (hasInterval() != other.hasInterval()) return false; + if (hasInterval()) { + if (!getInterval().equals(other.getInterval())) 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(); + if (hasInterval()) { + hash = (37 * hash) + INTERVAL_FIELD_NUMBER; + hash = (53 * hash) + getInterval().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest 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.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest 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.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + 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.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest 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.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest 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 Violations
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getIntervalFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + interval_ = null; + if (intervalBuilder_ != null) { + intervalBuilder_.dispose(); + intervalBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest 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_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.interval_ = intervalBuilder_ == null ? interval_ : intervalBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + .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(); + } + if (other.hasInterval()) { + mergeInterval(other.getInterval()); + } + 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 + case 50: + { + input.readMessage(getIntervalFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + 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 resource
+     * Format
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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 resource
+     * Format
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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 resource
+     * Format
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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 resource
+     * Format
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * 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 resource
+     * Format
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of customers row to return. The service may
+     * return fewer than this value. If unspecified, at most 10 customers will be
+     * returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of customers row to return. The service may
+     * return fewer than this value. If unspecified, at most 10 customers will be
+     * returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of customers row to return. The service may
+     * return fewer than this value. If unspecified, at most 10 customers will be
+     * returned.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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 page token, received from a previous `ListViolations` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Filtering results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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. Hint for how to order the results
+     * 
+ * + * 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; + } + + private com.google.type.Interval interval_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + intervalBuilder_; + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the interval field is set. + */ + public boolean hasInterval() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interval. + */ + public com.google.type.Interval getInterval() { + if (intervalBuilder_ == null) { + return interval_ == null ? com.google.type.Interval.getDefaultInstance() : interval_; + } else { + return intervalBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setInterval(com.google.type.Interval value) { + if (intervalBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + interval_ = value; + } else { + intervalBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setInterval(com.google.type.Interval.Builder builderForValue) { + if (intervalBuilder_ == null) { + interval_ = builderForValue.build(); + } else { + intervalBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeInterval(com.google.type.Interval value) { + if (intervalBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && interval_ != null + && interval_ != com.google.type.Interval.getDefaultInstance()) { + getIntervalBuilder().mergeFrom(value); + } else { + interval_ = value; + } + } else { + intervalBuilder_.mergeFrom(value); + } + if (interval_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearInterval() { + bitField0_ = (bitField0_ & ~0x00000020); + interval_ = null; + if (intervalBuilder_ != null) { + intervalBuilder_.dispose(); + intervalBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.type.Interval.Builder getIntervalBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getIntervalFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.type.IntervalOrBuilder getIntervalOrBuilder() { + if (intervalBuilder_ != null) { + return intervalBuilder_.getMessageOrBuilder(); + } else { + return interval_ == null ? com.google.type.Interval.getDefaultInstance() : interval_; + } + } + /** + * + * + *
+     * Optional. Specifies the interval for retrieving violations.
+     * if unspecified, all violations will be returned.
+     * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder> + getIntervalFieldBuilder() { + if (intervalBuilder_ == null) { + intervalBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Interval, + com.google.type.Interval.Builder, + com.google.type.IntervalOrBuilder>( + getInterval(), getParentForChildren(), isClean()); + interval_ = null; + } + return intervalBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListViolationsRequest 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.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsRequestOrBuilder.java new file mode 100644 index 000000000000..51476a6d2f1f --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsRequestOrBuilder.java @@ -0,0 +1,189 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ListViolationsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource
+   * Format
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource
+   * Format
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of customers row to return. The service may
+   * return fewer than this value. If unspecified, at most 10 customers will be
+   * returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListViolations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListViolations` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the interval field is set. + */ + boolean hasInterval(); + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interval. + */ + com.google.type.Interval getInterval(); + /** + * + * + *
+   * Optional. Specifies the interval for retrieving violations.
+   * if unspecified, all violations will be returned.
+   * 
+ * + * .google.type.Interval interval = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.type.IntervalOrBuilder getIntervalOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsResponse.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsResponse.java new file mode 100644 index 000000000000..a8d9c53d347b --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsResponse.java @@ -0,0 +1,1441 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Response message for list customer violation requests
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse} + */ +public final class ListViolationsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse) + ListViolationsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListViolationsResponse.newBuilder() to construct. + private ListViolationsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListViolationsResponse() { + violations_ = 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 ListViolationsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse.Builder.class); + } + + public static final int VIOLATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List violations_; + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + @java.lang.Override + public java.util.List + getViolationsList() { + return violations_; + } + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + @java.lang.Override + public java.util.List + getViolationsOrBuilderList() { + return violations_; + } + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + @java.lang.Override + public int getViolationsCount() { + return violations_.size(); + } + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation getViolations(int index) { + return violations_.get(index); + } + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ViolationOrBuilder getViolationsOrBuilder( + int index) { + return violations_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that 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 that 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(); + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * 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); + } + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * 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 < violations_.size(); i++) { + output.writeMessage(1, violations_.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 < violations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, violations_.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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse other = + (com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse) obj; + + if (!getViolationsList().equals(other.getViolationsList())) 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 (getViolationsCount() > 0) { + hash = (37 * hash) + VIOLATIONS_FIELD_NUMBER; + hash = (53 * hash) + getViolationsList().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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + 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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for list customer violation requests
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse) + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + } else { + violations_ = null; + violationsBuilder_.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.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse build() { + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse result = + new com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse result) { + if (violationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + violations_ = java.util.Collections.unmodifiableList(violations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.violations_ = violations_; + } else { + result.violations_ = violationsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse 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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + .getDefaultInstance()) return this; + if (violationsBuilder_ == null) { + if (!other.violations_.isEmpty()) { + if (violations_.isEmpty()) { + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureViolationsIsMutable(); + violations_.addAll(other.violations_); + } + onChanged(); + } + } else { + if (!other.violations_.isEmpty()) { + if (violationsBuilder_.isEmpty()) { + violationsBuilder_.dispose(); + violationsBuilder_ = null; + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + violationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getViolationsFieldBuilder() + : null; + } else { + violationsBuilder_.addAllMessages(other.violations_); + } + } + } + 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.cloud.cloudcontrolspartner.v1beta.Violation m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.parser(), + extensionRegistry); + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(m); + } else { + violationsBuilder_.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 violations_ = + java.util.Collections.emptyList(); + + private void ensureViolationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + violations_ = + new java.util.ArrayList( + violations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.ViolationOrBuilder> + violationsBuilder_; + + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public java.util.List + getViolationsList() { + if (violationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(violations_); + } else { + return violationsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public int getViolationsCount() { + if (violationsBuilder_ == null) { + return violations_.size(); + } else { + return violationsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation getViolations(int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); + } else { + return violationsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.set(index, value); + onChanged(); + } else { + violationsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.set(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder addViolations(com.google.cloud.cloudcontrolspartner.v1beta.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(value); + onChanged(); + } else { + violationsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(index, value); + onChanged(); + } else { + violationsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder addViolations( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder addAllViolations( + java.lang.Iterable + values) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, violations_); + onChanged(); + } else { + violationsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder clearViolations() { + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + violationsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public Builder removeViolations(int index) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.remove(index); + onChanged(); + } else { + violationsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder getViolationsBuilder( + int index) { + return getViolationsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.ViolationOrBuilder getViolationsOrBuilder( + int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); + } else { + return violationsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public java.util.List + getViolationsOrBuilderList() { + if (violationsBuilder_ != null) { + return violationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(violations_); + } + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder addViolationsBuilder() { + return getViolationsFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1beta.Violation.getDefaultInstance()); + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder addViolationsBuilder( + int index) { + return getViolationsFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1beta.Violation.getDefaultInstance()); + } + /** + * + * + *
+     * List of violation
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + public java.util.List + getViolationsBuilderList() { + return getViolationsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.ViolationOrBuilder> + getViolationsFieldBuilder() { + if (violationsBuilder_ == null) { + violationsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.ViolationOrBuilder>( + violations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + violations_ = null; + } + return violationsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that 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 that 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 that 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 that 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 that 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; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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); + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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); + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Workloads that could not be reached due to permission errors or any other
+     * error. Ref: https://google.aip.dev/217
+     * 
+ * + * 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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse) + private static final com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListViolationsResponse 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.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsResponseOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsResponseOrBuilder.java new file mode 100644 index 000000000000..79d15c807a89 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListViolationsResponseOrBuilder.java @@ -0,0 +1,160 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ListViolationsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + java.util.List getViolationsList(); + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation getViolations(int index); + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + int getViolationsCount(); + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + java.util.List + getViolationsOrBuilderList(); + /** + * + * + *
+   * List of violation
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Violation violations = 1; + */ + com.google.cloud.cloudcontrolspartner.v1beta.ViolationOrBuilder getViolationsOrBuilder(int index); + + /** + * + * + *
+   * A token that 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 that 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(); + + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * 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); + /** + * + * + *
+   * Workloads that could not be reached due to permission errors or any other
+   * error. Ref: https://google.aip.dev/217
+   * 
+ * + * 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsRequest.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsRequest.java new file mode 100644 index 000000000000..ea5d564c1b32 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsRequest.java @@ -0,0 +1,1313 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Request to list customer workloads.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest} + */ +public final class ListWorkloadsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) + ListWorkloadsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkloadsRequest.newBuilder() to construct. + private ListWorkloadsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkloadsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkloadsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * + * 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 resource
+   * Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * + * 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; + /** + * + * + *
+   * The maximum number of workloads to return. The service may return fewer
+   * than this value. If unspecified, at most 500 workloads will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * A page token, received from a previous `ListWorkloads` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListWorkloads` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * 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. Filtering results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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. Hint for how to order the results.
+   * 
+ * + * 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest other = + (com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest + 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request to list customer workloads.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest.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.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest build() { + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest result = + new com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest.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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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 resource
+     * Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * The maximum number of workloads to return. The service may return fewer
+     * than this value. If unspecified, at most 500 workloads will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of workloads to return. The service may return fewer
+     * than this value. If unspecified, at most 500 workloads will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of workloads to return. The service may return fewer
+     * than this value. If unspecified, at most 500 workloads will be returned.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListWorkloads` call.
+     * Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Filtering results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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. Hint for how to order the results.
+     * 
+ * + * 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) + private static final com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkloadsRequest 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsRequestOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsRequestOrBuilder.java new file mode 100644 index 000000000000..516cf86394e2 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsRequestOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ListWorkloadsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent resource
+   * Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of workloads to return. The service may return fewer
+   * than this value. If unspecified, at most 500 workloads will be returned.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListWorkloads` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListWorkloads` call.
+   * Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Hint for how to order the results.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsResponse.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsResponse.java new file mode 100644 index 000000000000..d81be9a8e686 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsResponse.java @@ -0,0 +1,1427 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Response message for list customer workloads requests.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse} + */ +public final class ListWorkloadsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse) + ListWorkloadsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkloadsResponse.newBuilder() to construct. + private ListWorkloadsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkloadsResponse() { + workloads_ = 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 ListWorkloadsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse.Builder.class); + } + + public static final int WORKLOADS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List workloads_; + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + @java.lang.Override + public java.util.List getWorkloadsList() { + return workloads_; + } + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + @java.lang.Override + public java.util.List + getWorkloadsOrBuilderList() { + return workloads_; + } + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + @java.lang.Override + public int getWorkloadsCount() { + return workloads_.size(); + } + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Workload getWorkloads(int index) { + return workloads_.get(index); + } + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOrBuilder getWorkloadsOrBuilder( + int index) { + return workloads_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token that 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 that 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 < workloads_.size(); i++) { + output.writeMessage(1, workloads_.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 < workloads_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, workloads_.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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse other = + (com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse) obj; + + if (!getWorkloadsList().equals(other.getWorkloadsList())) 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 (getWorkloadsCount() > 0) { + hash = (37 * hash) + WORKLOADS_FIELD_NUMBER; + hash = (53 * hash) + getWorkloadsList().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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for list customer workloads requests.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse) + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse.class, + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (workloadsBuilder_ == null) { + workloads_ = java.util.Collections.emptyList(); + } else { + workloads_ = null; + workloadsBuilder_.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.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_ListWorkloadsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse build() { + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse result = + new com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse result) { + if (workloadsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workloads_ = java.util.Collections.unmodifiableList(workloads_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workloads_ = workloads_; + } else { + result.workloads_ = workloadsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + .getDefaultInstance()) return this; + if (workloadsBuilder_ == null) { + if (!other.workloads_.isEmpty()) { + if (workloads_.isEmpty()) { + workloads_ = other.workloads_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkloadsIsMutable(); + workloads_.addAll(other.workloads_); + } + onChanged(); + } + } else { + if (!other.workloads_.isEmpty()) { + if (workloadsBuilder_.isEmpty()) { + workloadsBuilder_.dispose(); + workloadsBuilder_ = null; + workloads_ = other.workloads_; + bitField0_ = (bitField0_ & ~0x00000001); + workloadsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkloadsFieldBuilder() + : null; + } else { + workloadsBuilder_.addAllMessages(other.workloads_); + } + } + } + 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.cloud.cloudcontrolspartner.v1beta.Workload m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.Workload.parser(), + extensionRegistry); + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(m); + } else { + workloadsBuilder_.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 workloads_ = + java.util.Collections.emptyList(); + + private void ensureWorkloadsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workloads_ = + new java.util.ArrayList( + workloads_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Workload, + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOrBuilder> + workloadsBuilder_; + + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public java.util.List + getWorkloadsList() { + if (workloadsBuilder_ == null) { + return java.util.Collections.unmodifiableList(workloads_); + } else { + return workloadsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public int getWorkloadsCount() { + if (workloadsBuilder_ == null) { + return workloads_.size(); + } else { + return workloadsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Workload getWorkloads(int index) { + if (workloadsBuilder_ == null) { + return workloads_.get(index); + } else { + return workloadsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder setWorkloads( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.set(index, value); + onChanged(); + } else { + workloadsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder setWorkloads( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.set(index, builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder addWorkloads(com.google.cloud.cloudcontrolspartner.v1beta.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.add(value); + onChanged(); + } else { + workloadsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder addWorkloads( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Workload value) { + if (workloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkloadsIsMutable(); + workloads_.add(index, value); + onChanged(); + } else { + workloadsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder addWorkloads( + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder addWorkloads( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder builderForValue) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.add(index, builderForValue.build()); + onChanged(); + } else { + workloadsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder addAllWorkloads( + java.lang.Iterable + values) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workloads_); + onChanged(); + } else { + workloadsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder clearWorkloads() { + if (workloadsBuilder_ == null) { + workloads_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workloadsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public Builder removeWorkloads(int index) { + if (workloadsBuilder_ == null) { + ensureWorkloadsIsMutable(); + workloads_.remove(index); + onChanged(); + } else { + workloadsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder getWorkloadsBuilder( + int index) { + return getWorkloadsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOrBuilder getWorkloadsOrBuilder( + int index) { + if (workloadsBuilder_ == null) { + return workloads_.get(index); + } else { + return workloadsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public java.util.List + getWorkloadsOrBuilderList() { + if (workloadsBuilder_ != null) { + return workloadsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workloads_); + } + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder addWorkloadsBuilder() { + return getWorkloadsFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1beta.Workload.getDefaultInstance()); + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder addWorkloadsBuilder( + int index) { + return getWorkloadsFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1beta.Workload.getDefaultInstance()); + } + /** + * + * + *
+     * List of customer workloads
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + public java.util.List + getWorkloadsBuilderList() { + return getWorkloadsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Workload, + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOrBuilder> + getWorkloadsFieldBuilder() { + if (workloadsBuilder_ == null) { + workloadsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Workload, + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOrBuilder>( + workloads_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + workloads_ = null; + } + return workloadsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token that 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 that 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 that 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 that 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 that 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse) + private static final com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkloadsResponse 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.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsResponseOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsResponseOrBuilder.java new file mode 100644 index 000000000000..88ffc68c1ae9 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ListWorkloadsResponseOrBuilder.java @@ -0,0 +1,156 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ListWorkloadsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + java.util.List getWorkloadsList(); + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + com.google.cloud.cloudcontrolspartner.v1beta.Workload getWorkloads(int index); + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + int getWorkloadsCount(); + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + java.util.List + getWorkloadsOrBuilderList(); + /** + * + * + *
+   * List of customer workloads
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Workload workloads = 1; + */ + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOrBuilder getWorkloadsOrBuilder(int index); + + /** + * + * + *
+   * A token that 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 that 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-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/MonitoringProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/MonitoringProto.java new file mode 100644 index 000000000000..795841fa82f3 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/MonitoringProto.java @@ -0,0 +1,91 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/monitoring.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class MonitoringProto { + private MonitoringProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9google/cloud/cloudcontrolspartner/v1be" + + "ta/monitoring.proto\022(google.cloud.cloudc" + + "ontrolspartner.v1beta\032\034google/api/annota" + + "tions.proto\032\027google/api/client.proto\0329go" + + "ogle/cloud/cloudcontrolspartner/v1beta/v" + + "iolations.proto2\326\004\n\036CloudControlsPartner" + + "Monitoring\022\365\001\n\016ListViolations\022?.google.c" + + "loud.cloudcontrolspartner.v1beta.ListVio" + + "lationsRequest\032@.google.cloud.cloudcontr" + + "olspartner.v1beta.ListViolationsResponse" + + "\"`\332A\006parent\202\323\344\223\002Q\022O/v1beta/{parent=organ" + + "izations/*/locations/*/customers/*/workl" + + "oads/*}/violations\022\342\001\n\014GetViolation\022=.go" + + "ogle.cloud.cloudcontrolspartner.v1beta.G" + + "etViolationRequest\0323.google.cloud.cloudc" + + "ontrolspartner.v1beta.Violation\"^\332A\004name" + + "\202\323\344\223\002Q\022O/v1beta/{name=organizations/*/lo" + + "cations/*/customers/*/workloads/*/violat" + + "ions/*}\032W\312A#cloudcontrolspartner.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformB\247\002\n,com.google.cloud.cl" + + "oudcontrolspartner.v1betaB\017MonitoringPro" + + "toP\001Z`cloud.google.com/go/cloudcontrolsp" + + "artner/apiv1beta/cloudcontrolspartnerpb;" + + "cloudcontrolspartnerpb\252\002(Google.Cloud.Cl" + + "oudControlsPartner.V1Beta\312\002(Google\\Cloud" + + "\\CloudControlsPartner\\V1beta\352\002+Google::C" + + "loud::CloudControlsPartner::V1betab\006prot" + + "o3" + }; + 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.cloud.cloudcontrolspartner.v1beta.ViolationsProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OperationMetadata.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OperationMetadata.java new file mode 100644 index 000000000000..e0323677a546 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OperationMetadata.java @@ -0,0 +1,1855 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/core.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata.class, + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata.Builder.class); + } + + private int bitField0_; + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int TARGET_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object target_ = ""; + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object verb_ = ""; + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object statusMessage_ = ""; + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + @java.lang.Override + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUESTED_CANCELLATION_FIELD_NUMBER = 6; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have been cancelled successfully
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object apiVersion_ = ""; + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusMessage_); + } + if (requestedCancellation_ != false) { + output.writeBool(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusMessage_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, requestedCancellation_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + 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.cloud.cloudcontrolspartner.v1beta.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata other = + (com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata 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.cloud.cloudcontrolspartner.v1beta.OperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata 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.cloud.cloudcontrolspartner.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata 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.cloud.cloudcontrolspartner.v1beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata 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.cloud.cloudcontrolspartner.v1beta.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.OperationMetadata) + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata.class, + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CoreProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata build() { + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata result = + new com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + 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(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + 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.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + target_ = getDefaultInstance().getTarget(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + target_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + verb_ = getDefaultInstance().getVerb(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + verb_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + public com.google.protobuf.ByteString getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearStatusMessage() { + statusMessage_ = getDefaultInstance().getStatusMessage(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human-readable status of the operation, if any.
+     * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for statusMessage to set. + * @return This builder for chaining. + */ + public Builder setStatusMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + statusMessage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation
+     * of the operation. Operations that have been cancelled successfully
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
+     * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000020); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + apiVersion_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + apiVersion_ = getDefaultInstance().getApiVersion(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. API version used to start the operation.
+     * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + apiVersion_ = value; + bitField0_ |= 0x00000040; + 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.cloud.cloudcontrolspartner.v1beta.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.OperationMetadata) + private static final com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata 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.cloud.cloudcontrolspartner.v1beta.OperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OperationMetadataOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..4304aeb0e661 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OperationMetadataOrBuilder.java @@ -0,0 +1,219 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/core.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Output only. Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Output only. Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The statusMessage. + */ + java.lang.String getStatusMessage(); + /** + * + * + *
+   * Output only. Human-readable status of the operation, if any.
+   * 
+ * + * string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for statusMessage. + */ + com.google.protobuf.ByteString getStatusMessageBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation
+   * of the operation. Operations that have been cancelled successfully
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
+   * 
+ * + * bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * Output only. API version used to start the operation.
+   * 
+ * + * string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OrganizationLocationName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OrganizationLocationName.java new file mode 100644 index 000000000000..d7928bbadfb2 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/OrganizationLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class OrganizationLocationName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + + @Deprecated + protected OrganizationLocationName() { + organization = null; + location = null; + } + + private OrganizationLocationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationLocationName of(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build(); + } + + public static String format(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build().toString(); + } + + public static OrganizationLocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION.validatedMatch( + formattedString, "OrganizationLocationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location")); + } + + 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 (OrganizationLocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION.instantiate("organization", organization, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationLocationName that = ((OrganizationLocationName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}. */ + public static class Builder { + private String organization; + private String location; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(OrganizationLocationName organizationLocationName) { + this.organization = organizationLocationName.organization; + this.location = organizationLocationName.location; + } + + public OrganizationLocationName build() { + return new OrganizationLocationName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Partner.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Partner.java new file mode 100644 index 000000000000..cafc666ae43e --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Partner.java @@ -0,0 +1,2735 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Message describing Partner resource
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Partner} + */ +public final class Partner extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Partner) + PartnerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Partner.newBuilder() to construct. + private Partner(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Partner() { + name_ = ""; + skus_ = java.util.Collections.emptyList(); + ekmSolutions_ = java.util.Collections.emptyList(); + operatedCloudRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + partnerProjectId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Partner(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Partner.class, + com.google.cloud.cloudcontrolspartner.v1beta.Partner.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The resource name of the partner.
+   * Format: organizations/{organization}/locations/{location}/partner
+   * Example: "organizations/123456/locations/us-central1/partner"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. The resource name of the partner.
+   * Format: organizations/{organization}/locations/{location}/partner
+   * Example: "organizations/123456/locations/us-central1/partner"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SKUS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List skus_; + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + @java.lang.Override + public java.util.List getSkusList() { + return skus_; + } + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + @java.lang.Override + public java.util.List + getSkusOrBuilderList() { + return skus_; + } + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + @java.lang.Override + public int getSkusCount() { + return skus_.size(); + } + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Sku getSkus(int index) { + return skus_.get(index); + } + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.SkuOrBuilder getSkusOrBuilder(int index) { + return skus_.get(index); + } + + public static final int EKM_SOLUTIONS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List ekmSolutions_; + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public java.util.List + getEkmSolutionsList() { + return ekmSolutions_; + } + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public java.util.List + getEkmSolutionsOrBuilderList() { + return ekmSolutions_; + } + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public int getEkmSolutionsCount() { + return ekmSolutions_.size(); + } + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata getEkmSolutions(int index) { + return ekmSolutions_.get(index); + } + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadataOrBuilder getEkmSolutionsOrBuilder( + int index) { + return ekmSolutions_.get(index); + } + + public static final int OPERATED_CLOUD_REGIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList operatedCloudRegions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return A list containing the operatedCloudRegions. + */ + public com.google.protobuf.ProtocolStringList getOperatedCloudRegionsList() { + return operatedCloudRegions_; + } + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return The count of operatedCloudRegions. + */ + public int getOperatedCloudRegionsCount() { + return operatedCloudRegions_.size(); + } + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the element to return. + * @return The operatedCloudRegions at the given index. + */ + public java.lang.String getOperatedCloudRegions(int index) { + return operatedCloudRegions_.get(index); + } + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the value to return. + * @return The bytes of the operatedCloudRegions at the given index. + */ + public com.google.protobuf.ByteString getOperatedCloudRegionsBytes(int index) { + return operatedCloudRegions_.getByteString(index); + } + + public static final int PARTNER_PROJECT_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object partnerProjectId_ = ""; + /** + * + * + *
+   * Google Cloud project ID in the partner's Google Cloud organization for
+   * receiving enhanced Logs for Partners.
+   * 
+ * + * string partner_project_id = 7; + * + * @return The partnerProjectId. + */ + @java.lang.Override + public java.lang.String getPartnerProjectId() { + java.lang.Object ref = partnerProjectId_; + 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(); + partnerProjectId_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud project ID in the partner's Google Cloud organization for
+   * receiving enhanced Logs for Partners.
+   * 
+ * + * string partner_project_id = 7; + * + * @return The bytes for partnerProjectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPartnerProjectIdBytes() { + java.lang.Object ref = partnerProjectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + partnerProjectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.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. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.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 = 10; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.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. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + 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_); + } + for (int i = 0; i < skus_.size(); i++) { + output.writeMessage(3, skus_.get(i)); + } + for (int i = 0; i < ekmSolutions_.size(); i++) { + output.writeMessage(4, ekmSolutions_.get(i)); + } + for (int i = 0; i < operatedCloudRegions_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 5, operatedCloudRegions_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partnerProjectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, partnerProjectId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(9, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(10, getUpdateTime()); + } + 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 (int i = 0; i < skus_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, skus_.get(i)); + } + for (int i = 0; i < ekmSolutions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, ekmSolutions_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < operatedCloudRegions_.size(); i++) { + dataSize += computeStringSizeNoTag(operatedCloudRegions_.getRaw(i)); + } + size += dataSize; + size += 1 * getOperatedCloudRegionsList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partnerProjectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, partnerProjectId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getUpdateTime()); + } + 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.cloud.cloudcontrolspartner.v1beta.Partner)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Partner other = + (com.google.cloud.cloudcontrolspartner.v1beta.Partner) obj; + + if (!getName().equals(other.getName())) return false; + if (!getSkusList().equals(other.getSkusList())) return false; + if (!getEkmSolutionsList().equals(other.getEkmSolutionsList())) return false; + if (!getOperatedCloudRegionsList().equals(other.getOperatedCloudRegionsList())) return false; + if (!getPartnerProjectId().equals(other.getPartnerProjectId())) 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 (!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 (getSkusCount() > 0) { + hash = (37 * hash) + SKUS_FIELD_NUMBER; + hash = (53 * hash) + getSkusList().hashCode(); + } + if (getEkmSolutionsCount() > 0) { + hash = (37 * hash) + EKM_SOLUTIONS_FIELD_NUMBER; + hash = (53 * hash) + getEkmSolutionsList().hashCode(); + } + if (getOperatedCloudRegionsCount() > 0) { + hash = (37 * hash) + OPERATED_CLOUD_REGIONS_FIELD_NUMBER; + hash = (53 * hash) + getOperatedCloudRegionsList().hashCode(); + } + hash = (37 * hash) + PARTNER_PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getPartnerProjectId().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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner 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.cloud.cloudcontrolspartner.v1beta.Partner parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner 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.cloud.cloudcontrolspartner.v1beta.Partner parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner 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.cloud.cloudcontrolspartner.v1beta.Partner parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner 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.cloud.cloudcontrolspartner.v1beta.Partner 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 describing Partner resource
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Partner} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Partner) + com.google.cloud.cloudcontrolspartner.v1beta.PartnerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Partner.class, + com.google.cloud.cloudcontrolspartner.v1beta.Partner.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.Partner.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSkusFieldBuilder(); + getEkmSolutionsFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + if (skusBuilder_ == null) { + skus_ = java.util.Collections.emptyList(); + } else { + skus_ = null; + skusBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (ekmSolutionsBuilder_ == null) { + ekmSolutions_ = java.util.Collections.emptyList(); + } else { + ekmSolutions_ = null; + ekmSolutionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + operatedCloudRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + partnerProjectId_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Partner getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Partner.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Partner build() { + com.google.cloud.cloudcontrolspartner.v1beta.Partner result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Partner buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Partner result = + new com.google.cloud.cloudcontrolspartner.v1beta.Partner(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.Partner result) { + if (skusBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + skus_ = java.util.Collections.unmodifiableList(skus_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.skus_ = skus_; + } else { + result.skus_ = skusBuilder_.build(); + } + if (ekmSolutionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + ekmSolutions_ = java.util.Collections.unmodifiableList(ekmSolutions_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.ekmSolutions_ = ekmSolutions_; + } else { + result.ekmSolutions_ = ekmSolutionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.Partner result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + operatedCloudRegions_.makeImmutable(); + result.operatedCloudRegions_ = operatedCloudRegions_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.partnerProjectId_ = partnerProjectId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.Partner) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.Partner) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.Partner other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.Partner.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (skusBuilder_ == null) { + if (!other.skus_.isEmpty()) { + if (skus_.isEmpty()) { + skus_ = other.skus_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSkusIsMutable(); + skus_.addAll(other.skus_); + } + onChanged(); + } + } else { + if (!other.skus_.isEmpty()) { + if (skusBuilder_.isEmpty()) { + skusBuilder_.dispose(); + skusBuilder_ = null; + skus_ = other.skus_; + bitField0_ = (bitField0_ & ~0x00000002); + skusBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSkusFieldBuilder() + : null; + } else { + skusBuilder_.addAllMessages(other.skus_); + } + } + } + if (ekmSolutionsBuilder_ == null) { + if (!other.ekmSolutions_.isEmpty()) { + if (ekmSolutions_.isEmpty()) { + ekmSolutions_ = other.ekmSolutions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.addAll(other.ekmSolutions_); + } + onChanged(); + } + } else { + if (!other.ekmSolutions_.isEmpty()) { + if (ekmSolutionsBuilder_.isEmpty()) { + ekmSolutionsBuilder_.dispose(); + ekmSolutionsBuilder_ = null; + ekmSolutions_ = other.ekmSolutions_; + bitField0_ = (bitField0_ & ~0x00000004); + ekmSolutionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEkmSolutionsFieldBuilder() + : null; + } else { + ekmSolutionsBuilder_.addAllMessages(other.ekmSolutions_); + } + } + } + if (!other.operatedCloudRegions_.isEmpty()) { + if (operatedCloudRegions_.isEmpty()) { + operatedCloudRegions_ = other.operatedCloudRegions_; + bitField0_ |= 0x00000008; + } else { + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.addAll(other.operatedCloudRegions_); + } + onChanged(); + } + if (!other.getPartnerProjectId().isEmpty()) { + partnerProjectId_ = other.partnerProjectId_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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 26: + { + com.google.cloud.cloudcontrolspartner.v1beta.Sku m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.Sku.parser(), + extensionRegistry); + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.add(m); + } else { + skusBuilder_.addMessage(m); + } + break; + } // case 26 + case 34: + { + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.parser(), + extensionRegistry); + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(m); + } else { + ekmSolutionsBuilder_.addMessage(m); + } + break; + } // case 34 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.add(s); + break; + } // case 42 + case 58: + { + partnerProjectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 58 + case 74: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 74 + case 82: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: organizations/{organization}/locations/{location}/partner
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: organizations/{organization}/locations/{location}/partner
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: organizations/{organization}/locations/{location}/partner
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: organizations/{organization}/locations/{location}/partner
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The resource name of the partner.
+     * Format: organizations/{organization}/locations/{location}/partner
+     * Example: "organizations/123456/locations/us-central1/partner"
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List skus_ = + java.util.Collections.emptyList(); + + private void ensureSkusIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + skus_ = new java.util.ArrayList(skus_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Sku, + com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.SkuOrBuilder> + skusBuilder_; + + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public java.util.List getSkusList() { + if (skusBuilder_ == null) { + return java.util.Collections.unmodifiableList(skus_); + } else { + return skusBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public int getSkusCount() { + if (skusBuilder_ == null) { + return skus_.size(); + } else { + return skusBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Sku getSkus(int index) { + if (skusBuilder_ == null) { + return skus_.get(index); + } else { + return skusBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder setSkus(int index, com.google.cloud.cloudcontrolspartner.v1beta.Sku value) { + if (skusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkusIsMutable(); + skus_.set(index, value); + onChanged(); + } else { + skusBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder setSkus( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder builderForValue) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.set(index, builderForValue.build()); + onChanged(); + } else { + skusBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder addSkus(com.google.cloud.cloudcontrolspartner.v1beta.Sku value) { + if (skusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkusIsMutable(); + skus_.add(value); + onChanged(); + } else { + skusBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder addSkus(int index, com.google.cloud.cloudcontrolspartner.v1beta.Sku value) { + if (skusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSkusIsMutable(); + skus_.add(index, value); + onChanged(); + } else { + skusBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder addSkus( + com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder builderForValue) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.add(builderForValue.build()); + onChanged(); + } else { + skusBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder addSkus( + int index, com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder builderForValue) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.add(index, builderForValue.build()); + onChanged(); + } else { + skusBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder addAllSkus( + java.lang.Iterable values) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, skus_); + onChanged(); + } else { + skusBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder clearSkus() { + if (skusBuilder_ == null) { + skus_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + skusBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public Builder removeSkus(int index) { + if (skusBuilder_ == null) { + ensureSkusIsMutable(); + skus_.remove(index); + onChanged(); + } else { + skusBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder getSkusBuilder(int index) { + return getSkusFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.SkuOrBuilder getSkusOrBuilder(int index) { + if (skusBuilder_ == null) { + return skus_.get(index); + } else { + return skusBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public java.util.List + getSkusOrBuilderList() { + if (skusBuilder_ != null) { + return skusBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(skus_); + } + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder addSkusBuilder() { + return getSkusFieldBuilder() + .addBuilder(com.google.cloud.cloudcontrolspartner.v1beta.Sku.getDefaultInstance()); + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder addSkusBuilder(int index) { + return getSkusFieldBuilder() + .addBuilder(index, com.google.cloud.cloudcontrolspartner.v1beta.Sku.getDefaultInstance()); + } + /** + * + * + *
+     * List of SKUs the partner is offering
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + public java.util.List + getSkusBuilderList() { + return getSkusFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Sku, + com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.SkuOrBuilder> + getSkusFieldBuilder() { + if (skusBuilder_ == null) { + skusBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Sku, + com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.SkuOrBuilder>( + skus_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + skus_ = null; + } + return skusBuilder_; + } + + private java.util.List ekmSolutions_ = + java.util.Collections.emptyList(); + + private void ensureEkmSolutionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + ekmSolutions_ = + new java.util.ArrayList( + ekmSolutions_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadataOrBuilder> + ekmSolutionsBuilder_; + + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public java.util.List + getEkmSolutionsList() { + if (ekmSolutionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(ekmSolutions_); + } else { + return ekmSolutionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public int getEkmSolutionsCount() { + if (ekmSolutionsBuilder_ == null) { + return ekmSolutions_.size(); + } else { + return ekmSolutionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata getEkmSolutions(int index) { + if (ekmSolutionsBuilder_ == null) { + return ekmSolutions_.get(index); + } else { + return ekmSolutionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder setEkmSolutions( + int index, com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata value) { + if (ekmSolutionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmSolutionsIsMutable(); + ekmSolutions_.set(index, value); + onChanged(); + } else { + ekmSolutionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder setEkmSolutions( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder builderForValue) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.set(index, builderForValue.build()); + onChanged(); + } else { + ekmSolutionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder addEkmSolutions(com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata value) { + if (ekmSolutionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(value); + onChanged(); + } else { + ekmSolutionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder addEkmSolutions( + int index, com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata value) { + if (ekmSolutionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(index, value); + onChanged(); + } else { + ekmSolutionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder addEkmSolutions( + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder builderForValue) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(builderForValue.build()); + onChanged(); + } else { + ekmSolutionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder addEkmSolutions( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder builderForValue) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.add(index, builderForValue.build()); + onChanged(); + } else { + ekmSolutionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder addAllEkmSolutions( + java.lang.Iterable + values) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ekmSolutions_); + onChanged(); + } else { + ekmSolutionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder clearEkmSolutions() { + if (ekmSolutionsBuilder_ == null) { + ekmSolutions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + ekmSolutionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public Builder removeEkmSolutions(int index) { + if (ekmSolutionsBuilder_ == null) { + ensureEkmSolutionsIsMutable(); + ekmSolutions_.remove(index); + onChanged(); + } else { + ekmSolutionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder getEkmSolutionsBuilder( + int index) { + return getEkmSolutionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadataOrBuilder + getEkmSolutionsOrBuilder(int index) { + if (ekmSolutionsBuilder_ == null) { + return ekmSolutions_.get(index); + } else { + return ekmSolutionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadataOrBuilder> + getEkmSolutionsOrBuilderList() { + if (ekmSolutionsBuilder_ != null) { + return ekmSolutionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(ekmSolutions_); + } + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder + addEkmSolutionsBuilder() { + return getEkmSolutionsFieldBuilder() + .addBuilder( + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.getDefaultInstance()); + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder addEkmSolutionsBuilder( + int index) { + return getEkmSolutionsFieldBuilder() + .addBuilder( + index, com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.getDefaultInstance()); + } + /** + * + * + *
+     * List of Google Cloud supported EKM partners supported by the partner
+     * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + * + */ + public java.util.List + getEkmSolutionsBuilderList() { + return getEkmSolutionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadataOrBuilder> + getEkmSolutionsFieldBuilder() { + if (ekmSolutionsBuilder_ == null) { + ekmSolutionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadataOrBuilder>( + ekmSolutions_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + ekmSolutions_ = null; + } + return ekmSolutionsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList operatedCloudRegions_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureOperatedCloudRegionsIsMutable() { + if (!operatedCloudRegions_.isModifiable()) { + operatedCloudRegions_ = new com.google.protobuf.LazyStringArrayList(operatedCloudRegions_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return A list containing the operatedCloudRegions. + */ + public com.google.protobuf.ProtocolStringList getOperatedCloudRegionsList() { + operatedCloudRegions_.makeImmutable(); + return operatedCloudRegions_; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return The count of operatedCloudRegions. + */ + public int getOperatedCloudRegionsCount() { + return operatedCloudRegions_.size(); + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the element to return. + * @return The operatedCloudRegions at the given index. + */ + public java.lang.String getOperatedCloudRegions(int index) { + return operatedCloudRegions_.get(index); + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the value to return. + * @return The bytes of the operatedCloudRegions at the given index. + */ + public com.google.protobuf.ByteString getOperatedCloudRegionsBytes(int index) { + return operatedCloudRegions_.getByteString(index); + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index to set the value at. + * @param value The operatedCloudRegions to set. + * @return This builder for chaining. + */ + public Builder setOperatedCloudRegions(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param value The operatedCloudRegions to add. + * @return This builder for chaining. + */ + public Builder addOperatedCloudRegions(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param values The operatedCloudRegions to add. + * @return This builder for chaining. + */ + public Builder addAllOperatedCloudRegions(java.lang.Iterable values) { + ensureOperatedCloudRegionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, operatedCloudRegions_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return This builder for chaining. + */ + public Builder clearOperatedCloudRegions() { + operatedCloudRegions_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * List of Google Cloud regions that the partner sells services to customers.
+     * Valid Google Cloud regions found here:
+     * https://cloud.google.com/compute/docs/regions-zones
+     * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param value The bytes of the operatedCloudRegions to add. + * @return This builder for chaining. + */ + public Builder addOperatedCloudRegionsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureOperatedCloudRegionsIsMutable(); + operatedCloudRegions_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object partnerProjectId_ = ""; + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @return The partnerProjectId. + */ + public java.lang.String getPartnerProjectId() { + java.lang.Object ref = partnerProjectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + partnerProjectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @return The bytes for partnerProjectId. + */ + public com.google.protobuf.ByteString getPartnerProjectIdBytes() { + java.lang.Object ref = partnerProjectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + partnerProjectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @param value The partnerProjectId to set. + * @return This builder for chaining. + */ + public Builder setPartnerProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + partnerProjectId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearPartnerProjectId() { + partnerProjectId_ = getDefaultInstance().getPartnerProjectId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud project ID in the partner's Google Cloud organization for
+     * receiving enhanced Logs for Partners.
+     * 
+ * + * string partner_project_id = 7; + * + * @param value The bytes for partnerProjectId to set. + * @return This builder for chaining. + */ + public Builder setPartnerProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + partnerProjectId_ = value; + bitField0_ |= 0x00000010; + 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. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. Time the resource was created
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.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. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000040); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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. The last time the resource was updated
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.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_; + } + + @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.cloud.cloudcontrolspartner.v1beta.Partner) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Partner) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Partner DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.Partner(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Partner getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Partner 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.cloud.cloudcontrolspartner.v1beta.Partner getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerName.java new file mode 100644 index 000000000000..3da8acae4093 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerName.java @@ -0,0 +1,193 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PartnerName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/partner"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + + @Deprecated + protected PartnerName() { + organization = null; + location = null; + } + + private PartnerName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PartnerName of(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build(); + } + + public static String format(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build().toString(); + } + + public static PartnerName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION.validatedMatch( + formattedString, "PartnerName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location")); + } + + 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 (PartnerName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION.instantiate("organization", organization, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PartnerName that = ((PartnerName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}/partner. */ + public static class Builder { + private String organization; + private String location; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(PartnerName partnerName) { + this.organization = partnerName.organization; + this.location = partnerName.location; + } + + public PartnerName build() { + return new PartnerName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerOrBuilder.java new file mode 100644 index 000000000000..28f813f90a19 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerOrBuilder.java @@ -0,0 +1,322 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface PartnerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Partner) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The resource name of the partner.
+   * Format: organizations/{organization}/locations/{location}/partner
+   * Example: "organizations/123456/locations/us-central1/partner"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The resource name of the partner.
+   * Format: organizations/{organization}/locations/{location}/partner
+   * Example: "organizations/123456/locations/us-central1/partner"
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + java.util.List getSkusList(); + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + com.google.cloud.cloudcontrolspartner.v1beta.Sku getSkus(int index); + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + int getSkusCount(); + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + java.util.List + getSkusOrBuilderList(); + /** + * + * + *
+   * List of SKUs the partner is offering
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.Sku skus = 3; + */ + com.google.cloud.cloudcontrolspartner.v1beta.SkuOrBuilder getSkusOrBuilder(int index); + + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + java.util.List getEkmSolutionsList(); + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadata getEkmSolutions(int index); + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + int getEkmSolutionsCount(); + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + java.util.List + getEkmSolutionsOrBuilderList(); + /** + * + * + *
+   * List of Google Cloud supported EKM partners supported by the partner
+   * 
+ * + * repeated .google.cloud.cloudcontrolspartner.v1beta.EkmMetadata ekm_solutions = 4; + */ + com.google.cloud.cloudcontrolspartner.v1beta.EkmMetadataOrBuilder getEkmSolutionsOrBuilder( + int index); + + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return A list containing the operatedCloudRegions. + */ + java.util.List getOperatedCloudRegionsList(); + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @return The count of operatedCloudRegions. + */ + int getOperatedCloudRegionsCount(); + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the element to return. + * @return The operatedCloudRegions at the given index. + */ + java.lang.String getOperatedCloudRegions(int index); + /** + * + * + *
+   * List of Google Cloud regions that the partner sells services to customers.
+   * Valid Google Cloud regions found here:
+   * https://cloud.google.com/compute/docs/regions-zones
+   * 
+ * + * repeated string operated_cloud_regions = 5; + * + * @param index The index of the value to return. + * @return The bytes of the operatedCloudRegions at the given index. + */ + com.google.protobuf.ByteString getOperatedCloudRegionsBytes(int index); + + /** + * + * + *
+   * Google Cloud project ID in the partner's Google Cloud organization for
+   * receiving enhanced Logs for Partners.
+   * 
+ * + * string partner_project_id = 7; + * + * @return The partnerProjectId. + */ + java.lang.String getPartnerProjectId(); + /** + * + * + *
+   * Google Cloud project ID in the partner's Google Cloud organization for
+   * receiving enhanced Logs for Partners.
+   * 
+ * + * string partner_project_id = 7; + * + * @return The bytes for partnerProjectId. + */ + com.google.protobuf.ByteString getPartnerProjectIdBytes(); + + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time the resource was created
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last time the resource was updated
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissions.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissions.java new file mode 100644 index 000000000000..3eaed109b9eb --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissions.java @@ -0,0 +1,1280 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * The permissions granted to the partner for a workload
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions} + */ +public final class PartnerPermissions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions) + PartnerPermissionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use PartnerPermissions.newBuilder() to construct. + private PartnerPermissions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PartnerPermissions() { + name_ = ""; + partnerPermissions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PartnerPermissions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.class, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Builder.class); + } + + /** + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission} + */ + public enum Permission implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified partner permission
+     * 
+ * + * PERMISSION_UNSPECIFIED = 0; + */ + PERMISSION_UNSPECIFIED(0), + /** + * + * + *
+     * Permission for Access Transparency and emergency logs
+     * 
+ * + * ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS = 1; + */ + ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS(1), + /** + * + * + *
+     * Permission for Assured Workloads monitoring violations
+     * 
+ * + * ASSURED_WORKLOADS_MONITORING = 2; + */ + ASSURED_WORKLOADS_MONITORING(2), + /** + * + * + *
+     * Permission for Access Approval requests
+     * 
+ * + * ACCESS_APPROVAL_REQUESTS = 3; + */ + ACCESS_APPROVAL_REQUESTS(3), + /** + * + * + *
+     * Permission for External Key Manager connection status
+     * 
+ * + * ASSURED_WORKLOADS_EKM_CONNECTION_STATUS = 4; + */ + ASSURED_WORKLOADS_EKM_CONNECTION_STATUS(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified partner permission
+     * 
+ * + * PERMISSION_UNSPECIFIED = 0; + */ + public static final int PERMISSION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Permission for Access Transparency and emergency logs
+     * 
+ * + * ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS = 1; + */ + public static final int ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS_VALUE = 1; + /** + * + * + *
+     * Permission for Assured Workloads monitoring violations
+     * 
+ * + * ASSURED_WORKLOADS_MONITORING = 2; + */ + public static final int ASSURED_WORKLOADS_MONITORING_VALUE = 2; + /** + * + * + *
+     * Permission for Access Approval requests
+     * 
+ * + * ACCESS_APPROVAL_REQUESTS = 3; + */ + public static final int ACCESS_APPROVAL_REQUESTS_VALUE = 3; + /** + * + * + *
+     * Permission for External Key Manager connection status
+     * 
+ * + * ASSURED_WORKLOADS_EKM_CONNECTION_STATUS = 4; + */ + public static final int ASSURED_WORKLOADS_EKM_CONNECTION_STATUS_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Permission 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 Permission forNumber(int value) { + switch (value) { + case 0: + return PERMISSION_UNSPECIFIED; + case 1: + return ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS; + case 2: + return ASSURED_WORKLOADS_MONITORING; + case 3: + return ACCESS_APPROVAL_REQUESTS; + case 4: + return ASSURED_WORKLOADS_EKM_CONNECTION_STATUS; + 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 Permission findValueByNumber(int number) { + return Permission.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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Permission[] VALUES = values(); + + public static Permission 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 Permission(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTNER_PERMISSIONS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List partnerPermissions_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission> + partnerPermissions_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission>() { + public com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission + convert(java.lang.Integer from) { + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission result = + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission + .forNumber(from); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission + .UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the partnerPermissions. + */ + @java.lang.Override + public java.util.List + getPartnerPermissionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission>( + partnerPermissions_, partnerPermissions_converter_); + } + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return The count of partnerPermissions. + */ + @java.lang.Override + public int getPartnerPermissionsCount() { + return partnerPermissions_.size(); + } + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the element to return. + * @return The partnerPermissions at the given index. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission + getPartnerPermissions(int index) { + return partnerPermissions_converter_.convert(partnerPermissions_.get(index)); + } + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the enum numeric values on the wire for partnerPermissions. + */ + @java.lang.Override + public java.util.List getPartnerPermissionsValueList() { + return partnerPermissions_; + } + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of partnerPermissions at the given index. + */ + @java.lang.Override + public int getPartnerPermissionsValue(int index) { + return partnerPermissions_.get(index); + } + + private int partnerPermissionsMemoizedSerializedSize; + + 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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (getPartnerPermissionsList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(partnerPermissionsMemoizedSerializedSize); + } + for (int i = 0; i < partnerPermissions_.size(); i++) { + output.writeEnumNoTag(partnerPermissions_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < partnerPermissions_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(partnerPermissions_.get(i)); + } + size += dataSize; + if (!getPartnerPermissionsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + partnerPermissionsMemoizedSerializedSize = 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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions other = + (com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions) obj; + + if (!getName().equals(other.getName())) return false; + if (!partnerPermissions_.equals(other.partnerPermissions_)) 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 (getPartnerPermissionsCount() > 0) { + hash = (37 * hash) + PARTNER_PERMISSIONS_FIELD_NUMBER; + hash = (53 * hash) + partnerPermissions_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions 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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions 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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions 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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions 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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions 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 permissions granted to the partner for a workload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions) + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.class, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + partnerPermissions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions build() { + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions result = + new com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions result) { + if (((bitField0_ & 0x00000002) != 0)) { + partnerPermissions_ = java.util.Collections.unmodifiableList(partnerPermissions_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.partnerPermissions_ = partnerPermissions_; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions 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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.partnerPermissions_.isEmpty()) { + if (partnerPermissions_.isEmpty()) { + partnerPermissions_ = other.partnerPermissions_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.addAll(other.partnerPermissions_); + } + 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 16: + { + int tmpRaw = input.readEnum(); + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.add(tmpRaw); + break; + } // case 16 + case 18: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List partnerPermissions_ = + java.util.Collections.emptyList(); + + private void ensurePartnerPermissionsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + partnerPermissions_ = new java.util.ArrayList(partnerPermissions_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the partnerPermissions. + */ + public java.util.List< + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission> + getPartnerPermissionsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission>( + partnerPermissions_, partnerPermissions_converter_); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return The count of partnerPermissions. + */ + public int getPartnerPermissionsCount() { + return partnerPermissions_.size(); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the element to return. + * @return The partnerPermissions at the given index. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission + getPartnerPermissions(int index) { + return partnerPermissions_converter_.convert(partnerPermissions_.get(index)); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index to set the value at. + * @param value The partnerPermissions to set. + * @return This builder for chaining. + */ + public Builder setPartnerPermissions( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param value The partnerPermissions to add. + * @return This builder for chaining. + */ + public Builder addPartnerPermissions( + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param values The partnerPermissions to add. + * @return This builder for chaining. + */ + public Builder addAllPartnerPermissions( + java.lang.Iterable< + ? extends + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission> + values) { + ensurePartnerPermissionsIsMutable(); + for (com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission value : + values) { + partnerPermissions_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return This builder for chaining. + */ + public Builder clearPartnerPermissions() { + partnerPermissions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the enum numeric values on the wire for partnerPermissions. + */ + public java.util.List getPartnerPermissionsValueList() { + return java.util.Collections.unmodifiableList(partnerPermissions_); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of partnerPermissions at the given index. + */ + public int getPartnerPermissionsValue(int index) { + return partnerPermissions_.get(index); + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for partnerPermissions to set. + * @return This builder for chaining. + */ + public Builder setPartnerPermissionsValue(int index, int value) { + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param value The enum numeric value on the wire for partnerPermissions to add. + * @return This builder for chaining. + */ + public Builder addPartnerPermissionsValue(int value) { + ensurePartnerPermissionsIsMutable(); + partnerPermissions_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The partner permissions granted for the workload
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param values The enum numeric values on the wire for partnerPermissions to add. + * @return This builder for chaining. + */ + public Builder addAllPartnerPermissionsValue(java.lang.Iterable values) { + ensurePartnerPermissionsIsMutable(); + for (int value : values) { + partnerPermissions_.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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions) + private static final com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartnerPermissions 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.cloud.cloudcontrolspartner.v1beta.PartnerPermissions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsName.java new file mode 100644 index 000000000000..ae1817636649 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PartnerPermissionsName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + + @Deprecated + protected PartnerPermissionsName() { + organization = null; + location = null; + customer = null; + workload = null; + } + + private PartnerPermissionsName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PartnerPermissionsName of( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build(); + } + + public static String format( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build() + .toString(); + } + + public static PartnerPermissionsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.validatedMatch( + formattedString, "PartnerPermissionsName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload")); + } + + 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 (PartnerPermissionsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PartnerPermissionsName that = ((PartnerPermissionsName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + private Builder(PartnerPermissionsName partnerPermissionsName) { + this.organization = partnerPermissionsName.organization; + this.location = partnerPermissionsName.location; + this.customer = partnerPermissionsName.customer; + this.workload = partnerPermissionsName.workload; + } + + public PartnerPermissionsName build() { + return new PartnerPermissionsName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsOrBuilder.java new file mode 100644 index 000000000000..47008c12e4c9 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface PartnerPermissionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the partnerPermissions. + */ + java.util.List + getPartnerPermissionsList(); + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return The count of partnerPermissions. + */ + int getPartnerPermissionsCount(); + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the element to return. + * @return The partnerPermissions at the given index. + */ + com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission getPartnerPermissions( + int index); + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @return A list containing the enum numeric values on the wire for partnerPermissions. + */ + java.util.List getPartnerPermissionsValueList(); + /** + * + * + *
+   * The partner permissions granted for the workload
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions.Permission partner_permissions = 2; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of partnerPermissions at the given index. + */ + int getPartnerPermissionsValue(int index); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsProto.java new file mode 100644 index 000000000000..f51bc5f2739d --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnerPermissionsProto.java @@ -0,0 +1,112 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class PartnerPermissionsProto { + private PartnerPermissionsProto() {} + + 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_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nBgoogle/cloud/cloudcontrolspartner/v1be" + + "ta/partner_permissions.proto\022(google.clo" + + "ud.cloudcontrolspartner.v1beta\032\037google/a" + + "pi/field_behavior.proto\032\031google/api/reso" + + "urce.proto\"\207\004\n\022PartnerPermissions\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\010\022d\n\023partner_permissions\030\002 \003(" + + "\0162G.google.cloud.cloudcontrolspartner.v1" + + "beta.PartnerPermissions.Permission\"\310\001\n\nP" + + "ermission\022\032\n\026PERMISSION_UNSPECIFIED\020\000\0221\n" + + "-ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCES" + + "S_LOGS\020\001\022 \n\034ASSURED_WORKLOADS_MONITORING" + + "\020\002\022\034\n\030ACCESS_APPROVAL_REQUESTS\020\003\022+\n\'ASSU" + + "RED_WORKLOADS_EKM_CONNECTION_STATUS\020\004:\254\001" + + "\352A\250\001\n6cloudcontrolspartner.googleapis.co" + + "m/PartnerPermissions\022norganizations/{org" + + "anization}/locations/{location}/customer" + + "s/{customer}/workloads/{workload}/partne" + + "rPermissions\"l\n\034GetPartnerPermissionsReq" + + "uest\022L\n\004name\030\001 \001(\tB>\340A\002\372A8\n6cloudcontrol" + + "spartner.googleapis.com/PartnerPermissio" + + "nsB\257\002\n,com.google.cloud.cloudcontrolspar" + + "tner.v1betaB\027PartnerPermissionsProtoP\001Z`" + + "cloud.google.com/go/cloudcontrolspartner" + + "/apiv1beta/cloudcontrolspartnerpb;cloudc" + + "ontrolspartnerpb\252\002(Google.Cloud.CloudCon" + + "trolsPartner.V1Beta\312\002(Google\\Cloud\\Cloud" + + "ControlsPartner\\V1beta\352\002+Google::Cloud::" + + "CloudControlsPartner::V1betab\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(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_PartnerPermissions_descriptor, + new java.lang.String[] { + "Name", "PartnerPermissions", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerPermissionsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnersProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnersProto.java new file mode 100644 index 000000000000..a3da06819c26 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/PartnersProto.java @@ -0,0 +1,149 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class PartnersProto { + private PartnersProto() {} + + 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_cloud_cloudcontrolspartner_v1beta_Partner_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n7google/cloud/cloudcontrolspartner/v1be" + + "ta/partners.proto\022(google.cloud.cloudcon" + + "trolspartner.v1beta\032\037google/api/field_be" + + "havior.proto\032\031google/api/resource.proto\032" + + "\037google/protobuf/timestamp.proto\"\305\003\n\007Par" + + "tner\022\021\n\004name\030\001 \001(\tB\003\340A\010\022;\n\004skus\030\003 \003(\0132-." + + "google.cloud.cloudcontrolspartner.v1beta" + + ".Sku\022L\n\rekm_solutions\030\004 \003(\01325.google.clo" + + "ud.cloudcontrolspartner.v1beta.EkmMetada" + + "ta\022\036\n\026operated_cloud_regions\030\005 \003(\t\022\032\n\022pa" + + "rtner_project_id\030\007 \001(\t\0224\n\013create_time\030\t " + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n\013" + + "update_time\030\n \001(\0132\032.google.protobuf.Time" + + "stampB\003\340A\003:t\352Aq\n+cloudcontrolspartner.go" + + "ogleapis.com/Partner\0229organizations/{org" + + "anization}/locations/{location}/partner2" + + "\007partner\"V\n\021GetPartnerRequest\022A\n\004name\030\001 " + + "\001(\tB3\340A\002\372A-\n+cloudcontrolspartner.google" + + "apis.com/Partner\"\'\n\003Sku\022\n\n\002id\030\001 \001(\t\022\024\n\014d" + + "isplay_name\030\002 \001(\t\"\340\001\n\013EkmMetadata\022W\n\014ekm" + + "_solution\030\001 \001(\0162A.google.cloud.cloudcont" + + "rolspartner.v1beta.EkmMetadata.EkmSoluti" + + "on\022\030\n\020ekm_endpoint_uri\030\002 \001(\t\"^\n\013EkmSolut" + + "ion\022\034\n\030EKM_SOLUTION_UNSPECIFIED\020\000\022\014\n\010FOR" + + "TANIX\020\001\022\013\n\007FUTUREX\020\002\022\n\n\006THALES\020\003\022\n\n\006VIRT" + + "RU\020\004B\245\002\n,com.google.cloud.cloudcontrolsp" + + "artner.v1betaB\rPartnersProtoP\001Z`cloud.go" + + "ogle.com/go/cloudcontrolspartner/apiv1be" + + "ta/cloudcontrolspartnerpb;cloudcontrolsp" + + "artnerpb\252\002(Google.Cloud.CloudControlsPar" + + "tner.V1Beta\312\002(Google\\Cloud\\CloudControls" + + "Partner\\V1beta\352\002+Google::Cloud::CloudCon" + + "trolsPartner::V1betab\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(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Partner_descriptor, + new java.lang.String[] { + "Name", + "Skus", + "EkmSolutions", + "OperatedCloudRegions", + "PartnerProjectId", + "CreateTime", + "UpdateTime", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetPartnerRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_descriptor, + new java.lang.String[] { + "Id", "DisplayName", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_EkmMetadata_descriptor, + new java.lang.String[] { + "EkmSolution", "EkmEndpointUri", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Sku.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Sku.java new file mode 100644 index 000000000000..4cd5b2c91628 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Sku.java @@ -0,0 +1,835 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Represents the SKU a partner owns inside Google Cloud to sell to customers.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Sku} + */ +public final class Sku extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Sku) + SkuOrBuilder { + private static final long serialVersionUID = 0L; + // Use Sku.newBuilder() to construct. + private Sku(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Sku() { + id_ = ""; + displayName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Sku(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Sku.class, + com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+   * Argentum product SKU, that is associated with the partner offerings to
+   * customers used by Syntro for billing purposes. SKUs can represent resold
+   * Google products or support services.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * Argentum product SKU, that is associated with the partner offerings to
+   * customers used by Syntro for billing purposes. SKUs can represent resold
+   * Google products or support services.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * Display name of the product identified by the SKU. A partner may want to
+   * show partner branded names for their offerings such as local sovereign
+   * cloud solutions.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Display name of the product identified by the SKU. A partner may want to
+   * show partner branded names for their offerings such as local sovereign
+   * cloud solutions.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = 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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + 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(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + 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.cloud.cloudcontrolspartner.v1beta.Sku)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Sku other = + (com.google.cloud.cloudcontrolspartner.v1beta.Sku) obj; + + if (!getId().equals(other.getId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku 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.cloud.cloudcontrolspartner.v1beta.Sku parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku 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.cloud.cloudcontrolspartner.v1beta.Sku parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku 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.cloud.cloudcontrolspartner.v1beta.Sku parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku 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.cloud.cloudcontrolspartner.v1beta.Sku 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; + } + /** + * + * + *
+   * Represents the SKU a partner owns inside Google Cloud to sell to customers.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Sku} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Sku) + com.google.cloud.cloudcontrolspartner.v1beta.SkuOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Sku.class, + com.google.cloud.cloudcontrolspartner.v1beta.Sku.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.Sku.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + displayName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.PartnersProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Sku_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Sku getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Sku.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Sku build() { + com.google.cloud.cloudcontrolspartner.v1beta.Sku result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Sku buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Sku result = + new com.google.cloud.cloudcontrolspartner.v1beta.Sku(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.Sku result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + } + + @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.cloud.cloudcontrolspartner.v1beta.Sku) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.Sku) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.Sku other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.Sku.getDefaultInstance()) + return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + 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: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + displayName_ = 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.lang.Object id_ = ""; + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Argentum product SKU, that is associated with the partner offerings to
+     * customers used by Syntro for billing purposes. SKUs can represent resold
+     * Google products or support services.
+     * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Display name of the product identified by the SKU. A partner may want to
+     * show partner branded names for their offerings such as local sovereign
+     * cloud solutions.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = 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.cloud.cloudcontrolspartner.v1beta.Sku) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Sku) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Sku DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.Sku(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Sku getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Sku 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.cloud.cloudcontrolspartner.v1beta.Sku getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/SkuOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/SkuOrBuilder.java new file mode 100644 index 000000000000..54de2d10b30c --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/SkuOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/partners.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface SkuOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Sku) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Argentum product SKU, that is associated with the partner offerings to
+   * customers used by Syntro for billing purposes. SKUs can represent resold
+   * Google products or support services.
+   * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Argentum product SKU, that is associated with the partner offerings to
+   * customers used by Syntro for billing purposes. SKUs can represent resold
+   * Google products or support services.
+   * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Display name of the product identified by the SKU. A partner may want to
+   * show partner branded names for their offerings such as local sovereign
+   * cloud solutions.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Display name of the product identified by the SKU. A partner may want to
+   * show partner branded names for their offerings such as local sovereign
+   * cloud solutions.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Violation.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Violation.java new file mode 100644 index 000000000000..ada77fc2f598 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Violation.java @@ -0,0 +1,8695 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Details of resource Violation
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Violation} + */ +public final class Violation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Violation) + ViolationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Violation.newBuilder() to construct. + private Violation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Violation() { + name_ = ""; + description_ = ""; + category_ = ""; + state_ = 0; + nonCompliantOrgPolicy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Violation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder.class); + } + + /** + * + * + *
+   * Violation State Values
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.Violation.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Violation is resolved.
+     * 
+ * + * RESOLVED = 1; + */ + RESOLVED(1), + /** + * + * + *
+     * Violation is Unresolved
+     * 
+ * + * UNRESOLVED = 2; + */ + UNRESOLVED(2), + /** + * + * + *
+     * Violation is Exception
+     * 
+ * + * EXCEPTION = 3; + */ + EXCEPTION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Violation is resolved.
+     * 
+ * + * RESOLVED = 1; + */ + public static final int RESOLVED_VALUE = 1; + /** + * + * + *
+     * Violation is Unresolved
+     * 
+ * + * UNRESOLVED = 2; + */ + public static final int UNRESOLVED_VALUE = 2; + /** + * + * + *
+     * Violation is Exception
+     * 
+ * + * EXCEPTION = 3; + */ + public static final int EXCEPTION_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 State 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 State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return RESOLVED; + case 2: + return UNRESOLVED; + case 3: + return EXCEPTION; + 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 State findValueByNumber(int number) { + return State.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.cloud.cloudcontrolspartner.v1beta.Violation.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State 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 State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.Violation.State) + } + + public interface RemediationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + boolean hasInstructions(); + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + getInstructions(); + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.InstructionsOrBuilder + getInstructionsOrBuilder(); + + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + java.util.List getCompliantValuesList(); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + int getCompliantValuesCount(); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + java.lang.String getCompliantValues(int index); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + com.google.protobuf.ByteString getCompliantValuesBytes(int index); + + /** + * + * + *
+     * Output only. Remediation type based on the type of org policy values
+     * violated
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + int getRemediationTypeValue(); + /** + * + * + *
+     * Output only. Remediation type based on the type of org policy values
+     * violated
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + getRemediationType(); + } + /** + * + * + *
+   * Represents remediation guidance to resolve compliance violation for
+   * AssuredWorkload
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation} + */ + public static final class Remediation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation) + RemediationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Remediation.newBuilder() to construct. + private Remediation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Remediation() { + compliantValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + remediationType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Remediation(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Builder.class); + } + + /** + * + * + *
+     * Classifying remediation into various types based on the kind of
+     * violation. For example, violations caused due to changes in boolean org
+     * policy requires different remediation instructions compared to violation
+     * caused due to changes in allowed values of list org policy.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType} + */ + public enum RemediationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unspecified remediation type
+       * 
+ * + * REMEDIATION_TYPE_UNSPECIFIED = 0; + */ + REMEDIATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+       * Remediation type for boolean org policy
+       * 
+ * + * REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + */ + REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION(1), + /** + * + * + *
+       * Remediation type for list org policy which have allowed values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + */ + REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION(2), + /** + * + * + *
+       * Remediation type for list org policy which have denied values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + */ + REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION(3), + /** + * + * + *
+       * Remediation type for gcp.restrictCmekCryptoKeyProjects
+       * 
+ * + * REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + */ + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION(4), + /** + * + * + *
+       * Remediation type for resource violation.
+       * 
+ * + * REMEDIATION_RESOURCE_VIOLATION = 5; + */ + REMEDIATION_RESOURCE_VIOLATION(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unspecified remediation type
+       * 
+ * + * REMEDIATION_TYPE_UNSPECIFIED = 0; + */ + public static final int REMEDIATION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Remediation type for boolean org policy
+       * 
+ * + * REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + */ + public static final int REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION_VALUE = 1; + /** + * + * + *
+       * Remediation type for list org policy which have allowed values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + */ + public static final int REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION_VALUE = 2; + /** + * + * + *
+       * Remediation type for list org policy which have denied values in the
+       * monitoring rule
+       * 
+ * + * REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + */ + public static final int REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION_VALUE = 3; + /** + * + * + *
+       * Remediation type for gcp.restrictCmekCryptoKeyProjects
+       * 
+ * + * REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + */ + public static final int + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION_VALUE = 4; + /** + * + * + *
+       * Remediation type for resource violation.
+       * 
+ * + * REMEDIATION_RESOURCE_VIOLATION = 5; + */ + public static final int REMEDIATION_RESOURCE_VIOLATION_VALUE = 5; + + 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 RemediationType 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 RemediationType forNumber(int value) { + switch (value) { + case 0: + return REMEDIATION_TYPE_UNSPECIFIED; + case 1: + return REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION; + case 2: + return REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION; + case 3: + return REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION; + case 4: + return REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION; + case 5: + return REMEDIATION_RESOURCE_VIOLATION; + 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 RemediationType findValueByNumber(int number) { + return RemediationType.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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RemediationType[] VALUES = values(); + + public static RemediationType 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 RemediationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType) + } + + public interface InstructionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + boolean hasGcloudInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + getGcloudInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .GcloudOrBuilder + getGcloudInstructionsOrBuilder(); + + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + boolean hasConsoleInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + getConsoleInstructions(); + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .ConsoleOrBuilder + getConsoleInstructionsOrBuilder(); + } + /** + * + * + *
+     * Instructions to remediate violation
+     * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions} + */ + public static final class Instructions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions) + InstructionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instructions.newBuilder() to construct. + private Instructions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instructions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instructions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Builder.class); + } + + public interface GcloudOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + java.util.List getGcloudCommandsList(); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + int getGcloudCommandsCount(); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + java.lang.String getGcloudCommands(int index); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + com.google.protobuf.ByteString getGcloudCommandsBytes(int index); + + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + java.util.List getStepsList(); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + int getStepsCount(); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + java.lang.String getSteps(int index); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + com.google.protobuf.ByteString getStepsBytes(int index); + + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + java.util.List getAdditionalLinksList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + int getAdditionalLinksCount(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + java.lang.String getAdditionalLinks(int index); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + com.google.protobuf.ByteString getAdditionalLinksBytes(int index); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud} + */ + public static final class Gcloud extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud) + GcloudOrBuilder { + private static final long serialVersionUID = 0L; + // Use Gcloud.newBuilder() to construct. + private Gcloud(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Gcloud() { + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.emptyList(); + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Gcloud(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.Builder.class); + } + + public static final int GCLOUD_COMMANDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList gcloudCommands_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + public com.google.protobuf.ProtocolStringList getGcloudCommandsList() { + return gcloudCommands_; + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + public int getGcloudCommandsCount() { + return gcloudCommands_.size(); + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + public java.lang.String getGcloudCommands(int index) { + return gcloudCommands_.get(index); + } + /** + * + * + *
+         * Gcloud command to resolve violation
+         * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + public com.google.protobuf.ByteString getGcloudCommandsBytes(int index) { + return gcloudCommands_.getByteString(index); + } + + public static final int STEPS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList steps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + return steps_; + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+         * Steps to resolve violation via gcloud cli
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + + public static final int ADDITIONAL_LINKS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + return additionalLinks_; + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.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 < gcloudCommands_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, gcloudCommands_.getRaw(i)); + } + for (int i = 0; i < steps_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, steps_.getRaw(i)); + } + for (int i = 0; i < additionalLinks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, additionalLinks_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < gcloudCommands_.size(); i++) { + dataSize += computeStringSizeNoTag(gcloudCommands_.getRaw(i)); + } + size += dataSize; + size += 1 * getGcloudCommandsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < steps_.size(); i++) { + dataSize += computeStringSizeNoTag(steps_.getRaw(i)); + } + size += dataSize; + size += 1 * getStepsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < additionalLinks_.size(); i++) { + dataSize += computeStringSizeNoTag(additionalLinks_.getRaw(i)); + } + size += dataSize; + size += 1 * getAdditionalLinksList().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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + other = + (com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud) + obj; + + if (!getGcloudCommandsList().equals(other.getGcloudCommandsList())) return false; + if (!getStepsList().equals(other.getStepsList())) return false; + if (!getAdditionalLinksList().equals(other.getAdditionalLinksList())) 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 (getGcloudCommandsCount() > 0) { + hash = (37 * hash) + GCLOUD_COMMANDS_FIELD_NUMBER; + hash = (53 * hash) + getGcloudCommandsList().hashCode(); + } + if (getStepsCount() > 0) { + hash = (37 * hash) + STEPS_FIELD_NUMBER; + hash = (53 * hash) + getStepsList().hashCode(); + } + if (getAdditionalLinksCount() > 0) { + hash = (37 * hash) + ADDITIONAL_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalLinksList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + 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; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud) + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .GcloudOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.emptyList(); + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud + build() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + result = + new com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + gcloudCommands_.makeImmutable(); + result.gcloudCommands_ = gcloudCommands_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + steps_.makeImmutable(); + result.steps_ = steps_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + additionalLinks_.makeImmutable(); + result.additionalLinks_ = additionalLinks_; + } + } + + @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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.getDefaultInstance()) return this; + if (!other.gcloudCommands_.isEmpty()) { + if (gcloudCommands_.isEmpty()) { + gcloudCommands_ = other.gcloudCommands_; + bitField0_ |= 0x00000001; + } else { + ensureGcloudCommandsIsMutable(); + gcloudCommands_.addAll(other.gcloudCommands_); + } + onChanged(); + } + if (!other.steps_.isEmpty()) { + if (steps_.isEmpty()) { + steps_ = other.steps_; + bitField0_ |= 0x00000002; + } else { + ensureStepsIsMutable(); + steps_.addAll(other.steps_); + } + onChanged(); + } + if (!other.additionalLinks_.isEmpty()) { + if (additionalLinks_.isEmpty()) { + additionalLinks_ = other.additionalLinks_; + bitField0_ |= 0x00000004; + } else { + ensureAdditionalLinksIsMutable(); + additionalLinks_.addAll(other.additionalLinks_); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStepsIsMutable(); + steps_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAdditionalLinksIsMutable(); + additionalLinks_.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.LazyStringArrayList gcloudCommands_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureGcloudCommandsIsMutable() { + if (!gcloudCommands_.isModifiable()) { + gcloudCommands_ = new com.google.protobuf.LazyStringArrayList(gcloudCommands_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return A list containing the gcloudCommands. + */ + public com.google.protobuf.ProtocolStringList getGcloudCommandsList() { + gcloudCommands_.makeImmutable(); + return gcloudCommands_; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return The count of gcloudCommands. + */ + public int getGcloudCommandsCount() { + return gcloudCommands_.size(); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the element to return. + * @return The gcloudCommands at the given index. + */ + public java.lang.String getGcloudCommands(int index) { + return gcloudCommands_.get(index); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index of the value to return. + * @return The bytes of the gcloudCommands at the given index. + */ + public com.google.protobuf.ByteString getGcloudCommandsBytes(int index) { + return gcloudCommands_.getByteString(index); + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param index The index to set the value at. + * @param value The gcloudCommands to set. + * @return This builder for chaining. + */ + public Builder setGcloudCommands(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGcloudCommandsIsMutable(); + gcloudCommands_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param value The gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addGcloudCommands(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param values The gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addAllGcloudCommands(java.lang.Iterable values) { + ensureGcloudCommandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, gcloudCommands_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @return This builder for chaining. + */ + public Builder clearGcloudCommands() { + gcloudCommands_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Gcloud command to resolve violation
+           * 
+ * + * repeated string gcloud_commands = 1; + * + * @param value The bytes of the gcloudCommands to add. + * @return This builder for chaining. + */ + public Builder addGcloudCommandsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureGcloudCommandsIsMutable(); + gcloudCommands_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList steps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureStepsIsMutable() { + if (!steps_.isModifiable()) { + steps_ = new com.google.protobuf.LazyStringArrayList(steps_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + steps_.makeImmutable(); + return steps_; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index to set the value at. + * @param value The steps to set. + * @return This builder for chaining. + */ + public Builder setSteps(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param value The steps to add. + * @return This builder for chaining. + */ + public Builder addSteps(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param values The steps to add. + * @return This builder for chaining. + */ + public Builder addAllSteps(java.lang.Iterable values) { + ensureStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, steps_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @return This builder for chaining. + */ + public Builder clearSteps() { + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via gcloud cli
+           * 
+ * + * repeated string steps = 2; + * + * @param value The bytes of the steps to add. + * @return This builder for chaining. + */ + public Builder addStepsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStepsIsMutable(); + steps_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAdditionalLinksIsMutable() { + if (!additionalLinks_.isModifiable()) { + additionalLinks_ = new com.google.protobuf.LazyStringArrayList(additionalLinks_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + additionalLinks_.makeImmutable(); + return additionalLinks_; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.getByteString(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index to set the value at. + * @param value The additionalLinks to set. + * @return This builder for chaining. + */ + public Builder setAdditionalLinks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param values The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalLinks(java.lang.Iterable values) { + ensureAdditionalLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalLinks_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return This builder for chaining. + */ + public Builder clearAdditionalLinks() { + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The bytes of the additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAdditionalLinksIsMutable(); + additionalLinks_.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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Gcloud 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConsoleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + java.util.List getConsoleUrisList(); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + int getConsoleUrisCount(); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + java.lang.String getConsoleUris(int index); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + com.google.protobuf.ByteString getConsoleUrisBytes(int index); + + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + java.util.List getStepsList(); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + int getStepsCount(); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + java.lang.String getSteps(int index); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + com.google.protobuf.ByteString getStepsBytes(int index); + + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + java.util.List getAdditionalLinksList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + int getAdditionalLinksCount(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + java.lang.String getAdditionalLinks(int index); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + com.google.protobuf.ByteString getAdditionalLinksBytes(int index); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console} + */ + public static final class Console extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console) + ConsoleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Console.newBuilder() to construct. + private Console(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Console() { + consoleUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Console(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.Builder.class); + } + + public static final int CONSOLE_URIS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList consoleUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + public com.google.protobuf.ProtocolStringList getConsoleUrisList() { + return consoleUris_; + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + public int getConsoleUrisCount() { + return consoleUris_.size(); + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + public java.lang.String getConsoleUris(int index) { + return consoleUris_.get(index); + } + /** + * + * + *
+         * Link to console page where violations can be resolved
+         * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + public com.google.protobuf.ByteString getConsoleUrisBytes(int index) { + return consoleUris_.getByteString(index); + } + + public static final int STEPS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList steps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + return steps_; + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+         * Steps to resolve violation via cloud console
+         * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + + public static final int ADDITIONAL_LINKS_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + return additionalLinks_; + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+         * Additional urls for more information about steps
+         * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.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 < consoleUris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, consoleUris_.getRaw(i)); + } + for (int i = 0; i < steps_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, steps_.getRaw(i)); + } + for (int i = 0; i < additionalLinks_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, additionalLinks_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < consoleUris_.size(); i++) { + dataSize += computeStringSizeNoTag(consoleUris_.getRaw(i)); + } + size += dataSize; + size += 1 * getConsoleUrisList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < steps_.size(); i++) { + dataSize += computeStringSizeNoTag(steps_.getRaw(i)); + } + size += dataSize; + size += 1 * getStepsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < additionalLinks_.size(); i++) { + dataSize += computeStringSizeNoTag(additionalLinks_.getRaw(i)); + } + size += dataSize; + size += 1 * getAdditionalLinksList().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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + other = + (com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console) + obj; + + if (!getConsoleUrisList().equals(other.getConsoleUrisList())) return false; + if (!getStepsList().equals(other.getStepsList())) return false; + if (!getAdditionalLinksList().equals(other.getAdditionalLinksList())) 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 (getConsoleUrisCount() > 0) { + hash = (37 * hash) + CONSOLE_URIS_FIELD_NUMBER; + hash = (53 * hash) + getConsoleUrisList().hashCode(); + } + if (getStepsCount() > 0) { + hash = (37 * hash) + STEPS_FIELD_NUMBER; + hash = (53 * hash) + getStepsList().hashCode(); + } + if (getAdditionalLinksCount() > 0) { + hash = (37 * hash) + ADDITIONAL_LINKS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalLinksList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + 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; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console) + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .ConsoleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + consoleUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + build() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + result = + new com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + consoleUris_.makeImmutable(); + result.consoleUris_ = consoleUris_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + steps_.makeImmutable(); + result.steps_ = steps_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + additionalLinks_.makeImmutable(); + result.additionalLinks_ = additionalLinks_; + } + } + + @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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.getDefaultInstance()) return this; + if (!other.consoleUris_.isEmpty()) { + if (consoleUris_.isEmpty()) { + consoleUris_ = other.consoleUris_; + bitField0_ |= 0x00000001; + } else { + ensureConsoleUrisIsMutable(); + consoleUris_.addAll(other.consoleUris_); + } + onChanged(); + } + if (!other.steps_.isEmpty()) { + if (steps_.isEmpty()) { + steps_ = other.steps_; + bitField0_ |= 0x00000002; + } else { + ensureStepsIsMutable(); + steps_.addAll(other.steps_); + } + onChanged(); + } + if (!other.additionalLinks_.isEmpty()) { + if (additionalLinks_.isEmpty()) { + additionalLinks_ = other.additionalLinks_; + bitField0_ |= 0x00000004; + } else { + ensureAdditionalLinksIsMutable(); + additionalLinks_.addAll(other.additionalLinks_); + } + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureConsoleUrisIsMutable(); + consoleUris_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureStepsIsMutable(); + steps_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureAdditionalLinksIsMutable(); + additionalLinks_.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.LazyStringArrayList consoleUris_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureConsoleUrisIsMutable() { + if (!consoleUris_.isModifiable()) { + consoleUris_ = new com.google.protobuf.LazyStringArrayList(consoleUris_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return A list containing the consoleUris. + */ + public com.google.protobuf.ProtocolStringList getConsoleUrisList() { + consoleUris_.makeImmutable(); + return consoleUris_; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return The count of consoleUris. + */ + public int getConsoleUrisCount() { + return consoleUris_.size(); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the element to return. + * @return The consoleUris at the given index. + */ + public java.lang.String getConsoleUris(int index) { + return consoleUris_.get(index); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the consoleUris at the given index. + */ + public com.google.protobuf.ByteString getConsoleUrisBytes(int index) { + return consoleUris_.getByteString(index); + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param index The index to set the value at. + * @param value The consoleUris to set. + * @return This builder for chaining. + */ + public Builder setConsoleUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConsoleUrisIsMutable(); + consoleUris_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param value The consoleUris to add. + * @return This builder for chaining. + */ + public Builder addConsoleUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureConsoleUrisIsMutable(); + consoleUris_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param values The consoleUris to add. + * @return This builder for chaining. + */ + public Builder addAllConsoleUris(java.lang.Iterable values) { + ensureConsoleUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, consoleUris_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @return This builder for chaining. + */ + public Builder clearConsoleUris() { + consoleUris_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Link to console page where violations can be resolved
+           * 
+ * + * repeated string console_uris = 1; + * + * @param value The bytes of the consoleUris to add. + * @return This builder for chaining. + */ + public Builder addConsoleUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureConsoleUrisIsMutable(); + consoleUris_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList steps_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureStepsIsMutable() { + if (!steps_.isModifiable()) { + steps_ = new com.google.protobuf.LazyStringArrayList(steps_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return A list containing the steps. + */ + public com.google.protobuf.ProtocolStringList getStepsList() { + steps_.makeImmutable(); + return steps_; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return The count of steps. + */ + public int getStepsCount() { + return steps_.size(); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the element to return. + * @return The steps at the given index. + */ + public java.lang.String getSteps(int index) { + return steps_.get(index); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index of the value to return. + * @return The bytes of the steps at the given index. + */ + public com.google.protobuf.ByteString getStepsBytes(int index) { + return steps_.getByteString(index); + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param index The index to set the value at. + * @param value The steps to set. + * @return This builder for chaining. + */ + public Builder setSteps(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param value The steps to add. + * @return This builder for chaining. + */ + public Builder addSteps(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStepsIsMutable(); + steps_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param values The steps to add. + * @return This builder for chaining. + */ + public Builder addAllSteps(java.lang.Iterable values) { + ensureStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, steps_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @return This builder for chaining. + */ + public Builder clearSteps() { + steps_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Steps to resolve violation via cloud console
+           * 
+ * + * repeated string steps = 2; + * + * @param value The bytes of the steps to add. + * @return This builder for chaining. + */ + public Builder addStepsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStepsIsMutable(); + steps_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList additionalLinks_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAdditionalLinksIsMutable() { + if (!additionalLinks_.isModifiable()) { + additionalLinks_ = new com.google.protobuf.LazyStringArrayList(additionalLinks_); + } + bitField0_ |= 0x00000004; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return A list containing the additionalLinks. + */ + public com.google.protobuf.ProtocolStringList getAdditionalLinksList() { + additionalLinks_.makeImmutable(); + return additionalLinks_; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return The count of additionalLinks. + */ + public int getAdditionalLinksCount() { + return additionalLinks_.size(); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the element to return. + * @return The additionalLinks at the given index. + */ + public java.lang.String getAdditionalLinks(int index) { + return additionalLinks_.get(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index of the value to return. + * @return The bytes of the additionalLinks at the given index. + */ + public com.google.protobuf.ByteString getAdditionalLinksBytes(int index) { + return additionalLinks_.getByteString(index); + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param index The index to set the value at. + * @param value The additionalLinks to set. + * @return This builder for chaining. + */ + public Builder setAdditionalLinks(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinks(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalLinksIsMutable(); + additionalLinks_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param values The additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAllAdditionalLinks(java.lang.Iterable values) { + ensureAdditionalLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, additionalLinks_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @return This builder for chaining. + */ + public Builder clearAdditionalLinks() { + additionalLinks_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+           * Additional urls for more information about steps
+           * 
+ * + * repeated string additional_links = 3; + * + * @param value The bytes of the additionalLinks to add. + * @return This builder for chaining. + */ + public Builder addAdditionalLinksBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAdditionalLinksIsMutable(); + additionalLinks_.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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Console 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int GCLOUD_INSTRUCTIONS_FIELD_NUMBER = 1; + private com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + gcloudInstructions_; + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + @java.lang.Override + public boolean hasGcloudInstructions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + getGcloudInstructions() { + return gcloudInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } + /** + * + * + *
+       * Remediation instructions to resolve violation via gcloud cli
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .GcloudOrBuilder + getGcloudInstructionsOrBuilder() { + return gcloudInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + .getDefaultInstance() + : gcloudInstructions_; + } + + public static final int CONSOLE_INSTRUCTIONS_FIELD_NUMBER = 2; + private com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + consoleInstructions_; + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + @java.lang.Override + public boolean hasConsoleInstructions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + getConsoleInstructions() { + return consoleInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.getDefaultInstance() + : consoleInstructions_; + } + /** + * + * + *
+       * Remediation instructions to resolve violation via cloud console
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .ConsoleOrBuilder + getConsoleInstructionsOrBuilder() { + return consoleInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.getDefaultInstance() + : consoleInstructions_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getGcloudInstructions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getConsoleInstructions()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcloudInstructions()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getConsoleInstructions()); + } + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions other = + (com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions) obj; + + if (hasGcloudInstructions() != other.hasGcloudInstructions()) return false; + if (hasGcloudInstructions()) { + if (!getGcloudInstructions().equals(other.getGcloudInstructions())) return false; + } + if (hasConsoleInstructions() != other.hasConsoleInstructions()) return false; + if (hasConsoleInstructions()) { + if (!getConsoleInstructions().equals(other.getConsoleInstructions())) 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 (hasGcloudInstructions()) { + hash = (37 * hash) + GCLOUD_INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getGcloudInstructions().hashCode(); + } + if (hasConsoleInstructions()) { + hash = (37 * hash) + CONSOLE_INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConsoleInstructions().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + 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; + } + /** + * + * + *
+       * Instructions to remediate violation
+       * 
+ * + * Protobuf type {@code + * google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions) + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.InstructionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGcloudInstructionsFieldBuilder(); + getConsoleInstructionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + gcloudInstructions_ = null; + if (gcloudInstructionsBuilder_ != null) { + gcloudInstructionsBuilder_.dispose(); + gcloudInstructionsBuilder_ = null; + } + consoleInstructions_ = null; + if (consoleInstructionsBuilder_ != null) { + consoleInstructionsBuilder_.dispose(); + consoleInstructionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + build() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions result = + new com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gcloudInstructions_ = + gcloudInstructionsBuilder_ == null + ? gcloudInstructions_ + : gcloudInstructionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.consoleInstructions_ = + consoleInstructionsBuilder_ == null + ? consoleInstructions_ + : consoleInstructionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .getDefaultInstance()) return this; + if (other.hasGcloudInstructions()) { + mergeGcloudInstructions(other.getGcloudInstructions()); + } + if (other.hasConsoleInstructions()) { + mergeConsoleInstructions(other.getConsoleInstructions()); + } + 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( + getGcloudInstructionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getConsoleInstructionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud + gcloudInstructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .GcloudOrBuilder> + gcloudInstructionsBuilder_; + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return Whether the gcloudInstructions field is set. + */ + public boolean hasGcloudInstructions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + * + * @return The gcloudInstructions. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud + getGcloudInstructions() { + if (gcloudInstructionsBuilder_ == null) { + return gcloudInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.getDefaultInstance() + : gcloudInstructions_; + } else { + return gcloudInstructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder setGcloudInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + value) { + if (gcloudInstructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + gcloudInstructions_ = value; + } else { + gcloudInstructionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder setGcloudInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + .Builder + builderForValue) { + if (gcloudInstructionsBuilder_ == null) { + gcloudInstructions_ = builderForValue.build(); + } else { + gcloudInstructionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder mergeGcloudInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud + value) { + if (gcloudInstructionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && gcloudInstructions_ != null + && gcloudInstructions_ + != com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Gcloud.getDefaultInstance()) { + getGcloudInstructionsBuilder().mergeFrom(value); + } else { + gcloudInstructions_ = value; + } + } else { + gcloudInstructionsBuilder_.mergeFrom(value); + } + if (gcloudInstructions_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public Builder clearGcloudInstructions() { + bitField0_ = (bitField0_ & ~0x00000001); + gcloudInstructions_ = null; + if (gcloudInstructionsBuilder_ != null) { + gcloudInstructionsBuilder_.dispose(); + gcloudInstructionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.Builder + getGcloudInstructionsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getGcloudInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .GcloudOrBuilder + getGcloudInstructionsOrBuilder() { + if (gcloudInstructionsBuilder_ != null) { + return gcloudInstructionsBuilder_.getMessageOrBuilder(); + } else { + return gcloudInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.getDefaultInstance() + : gcloudInstructions_; + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via gcloud cli
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Gcloud gcloud_instructions = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .GcloudOrBuilder> + getGcloudInstructionsFieldBuilder() { + if (gcloudInstructionsBuilder_ == null) { + gcloudInstructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Gcloud.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .GcloudOrBuilder>( + getGcloudInstructions(), getParentForChildren(), isClean()); + gcloudInstructions_ = null; + } + return gcloudInstructionsBuilder_; + } + + private com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + consoleInstructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .ConsoleOrBuilder> + consoleInstructionsBuilder_; + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return Whether the consoleInstructions field is set. + */ + public boolean hasConsoleInstructions() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + * + * @return The consoleInstructions. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console + getConsoleInstructions() { + if (consoleInstructionsBuilder_ == null) { + return consoleInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.getDefaultInstance() + : consoleInstructions_; + } else { + return consoleInstructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder setConsoleInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + value) { + if (consoleInstructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + consoleInstructions_ = value; + } else { + consoleInstructionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder setConsoleInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + .Builder + builderForValue) { + if (consoleInstructionsBuilder_ == null) { + consoleInstructions_ = builderForValue.build(); + } else { + consoleInstructionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder mergeConsoleInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console + value) { + if (consoleInstructionsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && consoleInstructions_ != null + && consoleInstructions_ + != com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions.Console.getDefaultInstance()) { + getConsoleInstructionsBuilder().mergeFrom(value); + } else { + consoleInstructions_ = value; + } + } else { + consoleInstructionsBuilder_.mergeFrom(value); + } + if (consoleInstructions_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public Builder clearConsoleInstructions() { + bitField0_ = (bitField0_ & ~0x00000002); + consoleInstructions_ = null; + if (consoleInstructionsBuilder_ != null) { + consoleInstructionsBuilder_.dispose(); + consoleInstructionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.Builder + getConsoleInstructionsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getConsoleInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .ConsoleOrBuilder + getConsoleInstructionsOrBuilder() { + if (consoleInstructionsBuilder_ != null) { + return consoleInstructionsBuilder_.getMessageOrBuilder(); + } else { + return consoleInstructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.getDefaultInstance() + : consoleInstructions_; + } + } + /** + * + * + *
+         * Remediation instructions to resolve violation via cloud console
+         * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Console console_instructions = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .ConsoleOrBuilder> + getConsoleInstructionsFieldBuilder() { + if (consoleInstructionsBuilder_ == null) { + consoleInstructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Console.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .ConsoleOrBuilder>( + getConsoleInstructions(), getParentForChildren(), isClean()); + consoleInstructions_ = null; + } + return consoleInstructionsBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .Instructions + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instructions 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int INSTRUCTIONS_FIELD_NUMBER = 1; + private com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + instructions_; + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + @java.lang.Override + public boolean hasInstructions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + getInstructions() { + return instructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } + /** + * + * + *
+     * Required. Remediation instructions to resolve violations
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.InstructionsOrBuilder + getInstructionsOrBuilder() { + return instructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } + + public static final int COMPLIANT_VALUES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList compliantValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + public com.google.protobuf.ProtocolStringList getCompliantValuesList() { + return compliantValues_; + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + public int getCompliantValuesCount() { + return compliantValues_.size(); + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + public java.lang.String getCompliantValues(int index) { + return compliantValues_.get(index); + } + /** + * + * + *
+     * Values that can resolve the violation
+     * For example: for list org policy violations, this will either be the list
+     * of allowed or denied values
+     * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + public com.google.protobuf.ByteString getCompliantValuesBytes(int index) { + return compliantValues_.getByteString(index); + } + + public static final int REMEDIATION_TYPE_FIELD_NUMBER = 3; + private int remediationType_ = 0; + /** + * + * + *
+     * Output only. Remediation type based on the type of org policy values
+     * violated
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + @java.lang.Override + public int getRemediationTypeValue() { + return remediationType_; + } + /** + * + * + *
+     * Output only. Remediation type based on the type of org policy values
+     * violated
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + getRemediationType() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType result = + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + .forNumber(remediationType_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + .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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getInstructions()); + } + for (int i = 0; i < compliantValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, compliantValues_.getRaw(i)); + } + if (remediationType_ + != com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + .REMEDIATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, remediationType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInstructions()); + } + { + int dataSize = 0; + for (int i = 0; i < compliantValues_.size(); i++) { + dataSize += computeStringSizeNoTag(compliantValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getCompliantValuesList().size(); + } + if (remediationType_ + != com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + .REMEDIATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, remediationType_); + } + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation other = + (com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation) obj; + + if (hasInstructions() != other.hasInstructions()) return false; + if (hasInstructions()) { + if (!getInstructions().equals(other.getInstructions())) return false; + } + if (!getCompliantValuesList().equals(other.getCompliantValuesList())) return false; + if (remediationType_ != other.remediationType_) 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 (hasInstructions()) { + hash = (37 * hash) + INSTRUCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getInstructions().hashCode(); + } + if (getCompliantValuesCount() > 0) { + hash = (37 * hash) + COMPLIANT_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getCompliantValuesList().hashCode(); + } + hash = (37 * hash) + REMEDIATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + remediationType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation 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; + } + /** + * + * + *
+     * Represents remediation guidance to resolve compliance violation for
+     * AssuredWorkload
+     * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation) + com.google.cloud.cloudcontrolspartner.v1beta.Violation.RemediationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstructionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instructions_ = null; + if (instructionsBuilder_ != null) { + instructionsBuilder_.dispose(); + instructionsBuilder_ = null; + } + compliantValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + remediationType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation build() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation result = + new com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instructions_ = + instructionsBuilder_ == null ? instructions_ : instructionsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + compliantValues_.makeImmutable(); + result.compliantValues_ = compliantValues_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.remediationType_ = remediationType_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .getDefaultInstance()) return this; + if (other.hasInstructions()) { + mergeInstructions(other.getInstructions()); + } + if (!other.compliantValues_.isEmpty()) { + if (compliantValues_.isEmpty()) { + compliantValues_ = other.compliantValues_; + bitField0_ |= 0x00000002; + } else { + ensureCompliantValuesIsMutable(); + compliantValues_.addAll(other.compliantValues_); + } + onChanged(); + } + if (other.remediationType_ != 0) { + setRemediationTypeValue(other.getRemediationTypeValue()); + } + 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(getInstructionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCompliantValuesIsMutable(); + compliantValues_.add(s); + break; + } // case 18 + case 24: + { + remediationType_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + instructions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .InstructionsOrBuilder> + instructionsBuilder_; + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instructions field is set. + */ + public boolean hasInstructions() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instructions. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + getInstructions() { + if (instructionsBuilder_ == null) { + return instructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } else { + return instructionsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions value) { + if (instructionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instructions_ = value; + } else { + instructionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Builder + builderForValue) { + if (instructionsBuilder_ == null) { + instructions_ = builderForValue.build(); + } else { + instructionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstructions( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions value) { + if (instructionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && instructions_ != null + && instructions_ + != com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .getDefaultInstance()) { + getInstructionsBuilder().mergeFrom(value); + } else { + instructions_ = value; + } + } else { + instructionsBuilder_.mergeFrom(value); + } + if (instructions_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstructions() { + bitField0_ = (bitField0_ & ~0x00000001); + instructions_ = null; + if (instructionsBuilder_ != null) { + instructionsBuilder_.dispose(); + instructionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions.Builder + getInstructionsBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getInstructionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .InstructionsOrBuilder + getInstructionsOrBuilder() { + if (instructionsBuilder_ != null) { + return instructionsBuilder_.getMessageOrBuilder(); + } else { + return instructions_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .getDefaultInstance() + : instructions_; + } + } + /** + * + * + *
+       * Required. Remediation instructions to resolve violations
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions instructions = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .InstructionsOrBuilder> + getInstructionsFieldBuilder() { + if (instructionsBuilder_ == null) { + instructionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Instructions + .Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .InstructionsOrBuilder>(getInstructions(), getParentForChildren(), isClean()); + instructions_ = null; + } + return instructionsBuilder_; + } + + private com.google.protobuf.LazyStringArrayList compliantValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCompliantValuesIsMutable() { + if (!compliantValues_.isModifiable()) { + compliantValues_ = new com.google.protobuf.LazyStringArrayList(compliantValues_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return A list containing the compliantValues. + */ + public com.google.protobuf.ProtocolStringList getCompliantValuesList() { + compliantValues_.makeImmutable(); + return compliantValues_; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return The count of compliantValues. + */ + public int getCompliantValuesCount() { + return compliantValues_.size(); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the element to return. + * @return The compliantValues at the given index. + */ + public java.lang.String getCompliantValues(int index) { + return compliantValues_.get(index); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the compliantValues at the given index. + */ + public com.google.protobuf.ByteString getCompliantValuesBytes(int index) { + return compliantValues_.getByteString(index); + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param index The index to set the value at. + * @param value The compliantValues to set. + * @return This builder for chaining. + */ + public Builder setCompliantValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompliantValuesIsMutable(); + compliantValues_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param value The compliantValues to add. + * @return This builder for chaining. + */ + public Builder addCompliantValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCompliantValuesIsMutable(); + compliantValues_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param values The compliantValues to add. + * @return This builder for chaining. + */ + public Builder addAllCompliantValues(java.lang.Iterable values) { + ensureCompliantValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, compliantValues_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @return This builder for chaining. + */ + public Builder clearCompliantValues() { + compliantValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * Values that can resolve the violation
+       * For example: for list org policy violations, this will either be the list
+       * of allowed or denied values
+       * 
+ * + * repeated string compliant_values = 2; + * + * @param value The bytes of the compliantValues to add. + * @return This builder for chaining. + */ + public Builder addCompliantValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCompliantValuesIsMutable(); + compliantValues_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int remediationType_ = 0; + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for remediationType. + */ + @java.lang.Override + public int getRemediationTypeValue() { + return remediationType_; + } + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for remediationType to set. + * @return This builder for chaining. + */ + public Builder setRemediationTypeValue(int value) { + remediationType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediationType. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + getRemediationType() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType result = + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + .forNumber(remediationType_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The remediationType to set. + * @return This builder for chaining. + */ + public Builder setRemediationType( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType + value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + remediationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Remediation type based on the type of org policy values
+       * violated
+       * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.RemediationType remediation_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRemediationType() { + bitField0_ = (bitField0_ & ~0x00000004); + remediationType_ = 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Remediation 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.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BEGIN_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp beginTime_; + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + @java.lang.Override + public boolean hasBeginTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getBeginTime() { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder() { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.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 RESOLVE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp resolveTime_; + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + @java.lang.Override + public boolean hasResolveTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getResolveTime() { + return resolveTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : resolveTime_; + } + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder() { + return resolveTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : resolveTime_; + } + + public static final int CATEGORY_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object category_ = ""; + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + @java.lang.Override + public java.lang.String getCategory() { + java.lang.Object ref = category_; + 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(); + category_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 7; + private int state_ = 0; + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.State getState() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.State result = + com.google.cloud.cloudcontrolspartner.v1beta.Violation.State.forNumber(state_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.State.UNRECOGNIZED + : result; + } + + public static final int NON_COMPLIANT_ORG_POLICY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object nonCompliantOrgPolicy_ = ""; + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with
+   * non-compliant change and resulted this violation. Format:
+   *  projects/{project_number}/policies/{constraint_name}
+   *  folders/{folder_id}/policies/{constraint_name}
+   *  organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + @java.lang.Override + public java.lang.String getNonCompliantOrgPolicy() { + java.lang.Object ref = nonCompliantOrgPolicy_; + 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(); + nonCompliantOrgPolicy_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with
+   * non-compliant change and resulted this violation. Format:
+   *  projects/{project_number}/policies/{constraint_name}
+   *  folders/{folder_id}/policies/{constraint_name}
+   *  organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonCompliantOrgPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOLDER_ID_FIELD_NUMBER = 9; + private long folderId_ = 0L; + /** + * + * + *
+   * The folder_id of the violation
+   * 
+ * + * int64 folder_id = 9; + * + * @return The folderId. + */ + @java.lang.Override + public long getFolderId() { + return folderId_; + } + + public static final int REMEDIATION_FIELD_NUMBER = 13; + private com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation_; + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + @java.lang.Override + public boolean hasRemediation() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation getRemediation() { + return remediation_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.getDefaultInstance() + : remediation_; + } + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.RemediationOrBuilder + getRemediationOrBuilder() { + return remediation_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.getDefaultInstance() + : remediation_; + } + + 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(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBeginTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getResolveTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(category_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, category_); + } + if (state_ + != com.google.cloud.cloudcontrolspartner.v1beta.Violation.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonCompliantOrgPolicy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, nonCompliantOrgPolicy_); + } + if (folderId_ != 0L) { + output.writeInt64(9, folderId_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(13, getRemediation()); + } + 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(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBeginTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getResolveTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(category_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, category_); + } + if (state_ + != com.google.cloud.cloudcontrolspartner.v1beta.Violation.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nonCompliantOrgPolicy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, nonCompliantOrgPolicy_); + } + if (folderId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, folderId_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getRemediation()); + } + 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.cloud.cloudcontrolspartner.v1beta.Violation)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Violation other = + (com.google.cloud.cloudcontrolspartner.v1beta.Violation) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasBeginTime() != other.hasBeginTime()) return false; + if (hasBeginTime()) { + if (!getBeginTime().equals(other.getBeginTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasResolveTime() != other.hasResolveTime()) return false; + if (hasResolveTime()) { + if (!getResolveTime().equals(other.getResolveTime())) return false; + } + if (!getCategory().equals(other.getCategory())) return false; + if (state_ != other.state_) return false; + if (!getNonCompliantOrgPolicy().equals(other.getNonCompliantOrgPolicy())) return false; + if (getFolderId() != other.getFolderId()) return false; + if (hasRemediation() != other.hasRemediation()) return false; + if (hasRemediation()) { + if (!getRemediation().equals(other.getRemediation())) 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasBeginTime()) { + hash = (37 * hash) + BEGIN_TIME_FIELD_NUMBER; + hash = (53 * hash) + getBeginTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasResolveTime()) { + hash = (37 * hash) + RESOLVE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResolveTime().hashCode(); + } + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getCategory().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + NON_COMPLIANT_ORG_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getNonCompliantOrgPolicy().hashCode(); + hash = (37 * hash) + FOLDER_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFolderId()); + if (hasRemediation()) { + hash = (37 * hash) + REMEDIATION_FIELD_NUMBER; + hash = (53 * hash) + getRemediation().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation 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.cloud.cloudcontrolspartner.v1beta.Violation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation 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.cloud.cloudcontrolspartner.v1beta.Violation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation 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.cloud.cloudcontrolspartner.v1beta.Violation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation 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.cloud.cloudcontrolspartner.v1beta.Violation 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; + } + /** + * + * + *
+   * Details of resource Violation
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Violation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Violation) + com.google.cloud.cloudcontrolspartner.v1beta.ViolationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.class, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.Violation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBeginTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getResolveTimeFieldBuilder(); + getRemediationFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + beginTime_ = null; + if (beginTimeBuilder_ != null) { + beginTimeBuilder_.dispose(); + beginTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + resolveTime_ = null; + if (resolveTimeBuilder_ != null) { + resolveTimeBuilder_.dispose(); + resolveTimeBuilder_ = null; + } + category_ = ""; + state_ = 0; + nonCompliantOrgPolicy_ = ""; + folderId_ = 0L; + remediation_ = null; + if (remediationBuilder_ != null) { + remediationBuilder_.dispose(); + remediationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.ViolationsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Violation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation build() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation result = + new com.google.cloud.cloudcontrolspartner.v1beta.Violation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.Violation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.beginTime_ = beginTimeBuilder_ == null ? beginTime_ : beginTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.resolveTime_ = + resolveTimeBuilder_ == null ? resolveTime_ : resolveTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.category_ = category_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.nonCompliantOrgPolicy_ = nonCompliantOrgPolicy_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.folderId_ = folderId_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.remediation_ = + remediationBuilder_ == null ? remediation_ : remediationBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.Violation) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.Violation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.Violation other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.Violation.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBeginTime()) { + mergeBeginTime(other.getBeginTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasResolveTime()) { + mergeResolveTime(other.getResolveTime()); + } + if (!other.getCategory().isEmpty()) { + category_ = other.category_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getNonCompliantOrgPolicy().isEmpty()) { + nonCompliantOrgPolicy_ = other.nonCompliantOrgPolicy_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getFolderId() != 0L) { + setFolderId(other.getFolderId()); + } + if (other.hasRemediation()) { + mergeRemediation(other.getRemediation()); + } + 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: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getBeginTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getResolveTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + category_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 66: + { + nonCompliantOrgPolicy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + folderId_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 106: + { + input.readMessage(getRemediationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description for the Violation.
+     * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp beginTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + beginTimeBuilder_; + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + public boolean hasBeginTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + public com.google.protobuf.Timestamp getBeginTime() { + if (beginTimeBuilder_ == null) { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } else { + return beginTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBeginTime(com.google.protobuf.Timestamp value) { + if (beginTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + beginTime_ = value; + } else { + beginTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setBeginTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (beginTimeBuilder_ == null) { + beginTime_ = builderForValue.build(); + } else { + beginTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeBeginTime(com.google.protobuf.Timestamp value) { + if (beginTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && beginTime_ != null + && beginTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getBeginTimeBuilder().mergeFrom(value); + } else { + beginTime_ = value; + } + } else { + beginTimeBuilder_.mergeFrom(value); + } + if (beginTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearBeginTime() { + bitField0_ = (bitField0_ & ~0x00000004); + beginTime_ = null; + if (beginTimeBuilder_ != null) { + beginTimeBuilder_.dispose(); + beginTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getBeginTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBeginTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder() { + if (beginTimeBuilder_ != null) { + return beginTimeBuilder_.getMessageOrBuilder(); + } else { + return beginTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : beginTime_; + } + } + /** + * + * + *
+     * Output only. Time of the event which triggered the Violation.
+     * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getBeginTimeFieldBuilder() { + if (beginTimeBuilder_ == null) { + beginTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getBeginTime(), getParentForChildren(), isClean()); + beginTime_ = null; + } + return beginTimeBuilder_; + } + + 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. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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. The last time when the Violation record was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.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 com.google.protobuf.Timestamp resolveTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + resolveTimeBuilder_; + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + public boolean hasResolveTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + public com.google.protobuf.Timestamp getResolveTime() { + if (resolveTimeBuilder_ == null) { + return resolveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : resolveTime_; + } else { + return resolveTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResolveTime(com.google.protobuf.Timestamp value) { + if (resolveTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolveTime_ = value; + } else { + resolveTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setResolveTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (resolveTimeBuilder_ == null) { + resolveTime_ = builderForValue.build(); + } else { + resolveTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeResolveTime(com.google.protobuf.Timestamp value) { + if (resolveTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && resolveTime_ != null + && resolveTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getResolveTimeBuilder().mergeFrom(value); + } else { + resolveTime_ = value; + } + } else { + resolveTimeBuilder_.mergeFrom(value); + } + if (resolveTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearResolveTime() { + bitField0_ = (bitField0_ & ~0x00000010); + resolveTime_ = null; + if (resolveTimeBuilder_ != null) { + resolveTimeBuilder_.dispose(); + resolveTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getResolveTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getResolveTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder() { + if (resolveTimeBuilder_ != null) { + return resolveTimeBuilder_.getMessageOrBuilder(); + } else { + return resolveTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : resolveTime_; + } + } + /** + * + * + *
+     * Output only. Time of the event which fixed the Violation.
+     * If the violation is ACTIVE this will be empty.
+     * 
+ * + * + * .google.protobuf.Timestamp resolve_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> + getResolveTimeFieldBuilder() { + if (resolveTimeBuilder_ == null) { + resolveTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getResolveTime(), getParentForChildren(), isClean()); + resolveTime_ = null; + } + return resolveTimeBuilder_; + } + + private java.lang.Object category_ = ""; + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + category_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + category_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearCategory() { + category_ = getDefaultInstance().getCategory(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Category under which this violation is mapped.
+     * e.g. Location, Service Usage, Access, Encryption, etc.
+     * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + category_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.State getState() { + com.google.cloud.cloudcontrolspartner.v1beta.Violation.State result = + com.google.cloud.cloudcontrolspartner.v1beta.Violation.State.forNumber(state_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.cloudcontrolspartner.v1beta.Violation.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the violation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000040); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object nonCompliantOrgPolicy_ = ""; + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + public java.lang.String getNonCompliantOrgPolicy() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nonCompliantOrgPolicy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + public com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes() { + java.lang.Object ref = nonCompliantOrgPolicy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nonCompliantOrgPolicy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The nonCompliantOrgPolicy to set. + * @return This builder for chaining. + */ + public Builder setNonCompliantOrgPolicy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nonCompliantOrgPolicy_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearNonCompliantOrgPolicy() { + nonCompliantOrgPolicy_ = getDefaultInstance().getNonCompliantOrgPolicy(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. Name of the OrgPolicy which was modified with
+     * non-compliant change and resulted this violation. Format:
+     *  projects/{project_number}/policies/{constraint_name}
+     *  folders/{folder_id}/policies/{constraint_name}
+     *  organizations/{organization_id}/policies/{constraint_name}
+     * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for nonCompliantOrgPolicy to set. + * @return This builder for chaining. + */ + public Builder setNonCompliantOrgPolicyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nonCompliantOrgPolicy_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private long folderId_; + /** + * + * + *
+     * The folder_id of the violation
+     * 
+ * + * int64 folder_id = 9; + * + * @return The folderId. + */ + @java.lang.Override + public long getFolderId() { + return folderId_; + } + /** + * + * + *
+     * The folder_id of the violation
+     * 
+ * + * int64 folder_id = 9; + * + * @param value The folderId to set. + * @return This builder for chaining. + */ + public Builder setFolderId(long value) { + + folderId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The folder_id of the violation
+     * 
+ * + * int64 folder_id = 9; + * + * @return This builder for chaining. + */ + public Builder clearFolderId() { + bitField0_ = (bitField0_ & ~0x00000100); + folderId_ = 0L; + onChanged(); + return this; + } + + private com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.RemediationOrBuilder> + remediationBuilder_; + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + public boolean hasRemediation() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation getRemediation() { + if (remediationBuilder_ == null) { + return remediation_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .getDefaultInstance() + : remediation_; + } else { + return remediationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRemediation( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation value) { + if (remediationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + remediation_ = value; + } else { + remediationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRemediation( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Builder + builderForValue) { + if (remediationBuilder_ == null) { + remediation_ = builderForValue.build(); + } else { + remediationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeRemediation( + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation value) { + if (remediationBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && remediation_ != null + && remediation_ + != com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .getDefaultInstance()) { + getRemediationBuilder().mergeFrom(value); + } else { + remediation_ = value; + } + } else { + remediationBuilder_.mergeFrom(value); + } + if (remediation_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearRemediation() { + bitField0_ = (bitField0_ & ~0x00000200); + remediation_ = null; + if (remediationBuilder_ != null) { + remediationBuilder_.dispose(); + remediationBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Builder + getRemediationBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getRemediationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.Violation.RemediationOrBuilder + getRemediationOrBuilder() { + if (remediationBuilder_ != null) { + return remediationBuilder_.getMessageOrBuilder(); + } else { + return remediation_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation + .getDefaultInstance() + : remediation_; + } + } + /** + * + * + *
+     * Output only. Compliance violation remediation
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.RemediationOrBuilder> + getRemediationFieldBuilder() { + if (remediationBuilder_ == null) { + remediationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.Violation.RemediationOrBuilder>( + getRemediation(), getParentForChildren(), isClean()); + remediation_ = null; + } + return remediationBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1beta.Violation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Violation) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Violation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.Violation(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Violation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Violation 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.cloud.cloudcontrolspartner.v1beta.Violation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationName.java new file mode 100644 index 000000000000..29fde88dd8a9 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationName.java @@ -0,0 +1,298 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ViolationName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_VIOLATION = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + private final String violation; + + @Deprecated + protected ViolationName() { + organization = null; + location = null; + customer = null; + workload = null; + violation = null; + } + + private ViolationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + violation = Preconditions.checkNotNull(builder.getViolation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public String getViolation() { + return violation; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ViolationName of( + String organization, String location, String customer, String workload, String violation) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .setViolation(violation) + .build(); + } + + public static String format( + String organization, String location, String customer, String workload, String violation) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .setViolation(violation) + .build() + .toString(); + } + + public static ViolationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_VIOLATION.validatedMatch( + formattedString, "ViolationName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload"), + matchMap.get("violation")); + } + + 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 (ViolationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_VIOLATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + if (violation != null) { + fieldMapBuilder.put("violation", violation); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD_VIOLATION.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload, + "violation", + violation); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ViolationName that = ((ViolationName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload) + && Objects.equals(this.violation, that.violation); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + h *= 1000003; + h ^= Objects.hashCode(violation); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + private String violation; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public String getViolation() { + return violation; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + public Builder setViolation(String violation) { + this.violation = violation; + return this; + } + + private Builder(ViolationName violationName) { + this.organization = violationName.organization; + this.location = violationName.location; + this.customer = violationName.customer; + this.workload = violationName.workload; + this.violation = violationName.violation; + } + + public ViolationName build() { + return new ViolationName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationOrBuilder.java new file mode 100644 index 000000000000..afb86fa3ebf7 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationOrBuilder.java @@ -0,0 +1,345 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface ViolationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Violation) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Description for the Violation.
+   * e.g. OrgPolicy gcp.resourceLocations has non compliant value.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the beginTime field is set. + */ + boolean hasBeginTime(); + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The beginTime. + */ + com.google.protobuf.Timestamp getBeginTime(); + /** + * + * + *
+   * Output only. Time of the event which triggered the Violation.
+   * 
+ * + * .google.protobuf.Timestamp begin_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getBeginTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last time when the Violation record was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the resolveTime field is set. + */ + boolean hasResolveTime(); + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The resolveTime. + */ + com.google.protobuf.Timestamp getResolveTime(); + /** + * + * + *
+   * Output only. Time of the event which fixed the Violation.
+   * If the violation is ACTIVE this will be empty.
+   * 
+ * + * .google.protobuf.Timestamp resolve_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getResolveTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The category. + */ + java.lang.String getCategory(); + /** + * + * + *
+   * Output only. Category under which this violation is mapped.
+   * e.g. Location, Service Usage, Access, Encryption, etc.
+   * 
+ * + * string category = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for category. + */ + com.google.protobuf.ByteString getCategoryBytes(); + + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the violation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.State getState(); + + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with
+   * non-compliant change and resulted this violation. Format:
+   *  projects/{project_number}/policies/{constraint_name}
+   *  folders/{folder_id}/policies/{constraint_name}
+   *  organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nonCompliantOrgPolicy. + */ + java.lang.String getNonCompliantOrgPolicy(); + /** + * + * + *
+   * Output only. Immutable. Name of the OrgPolicy which was modified with
+   * non-compliant change and resulted this violation. Format:
+   *  projects/{project_number}/policies/{constraint_name}
+   *  folders/{folder_id}/policies/{constraint_name}
+   *  organizations/{organization_id}/policies/{constraint_name}
+   * 
+ * + * + * string non_compliant_org_policy = 8 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for nonCompliantOrgPolicy. + */ + com.google.protobuf.ByteString getNonCompliantOrgPolicyBytes(); + + /** + * + * + *
+   * The folder_id of the violation
+   * 
+ * + * int64 folder_id = 9; + * + * @return The folderId. + */ + long getFolderId(); + + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the remediation field is set. + */ + boolean hasRemediation(); + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The remediation. + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation getRemediation(); + /** + * + * + *
+   * Output only. Compliance violation remediation
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.Violation.Remediation remediation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.Violation.RemediationOrBuilder + getRemediationOrBuilder(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationsProto.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationsProto.java new file mode 100644 index 000000000000..380ae224b817 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/ViolationsProto.java @@ -0,0 +1,246 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/violations.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public final class ViolationsProto { + private ViolationsProto() {} + + 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_cloud_cloudcontrolspartner_v1beta_Violation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9google/cloud/cloudcontrolspartner/v1be" + + "ta/violations.proto\022(google.cloud.cloudc" + + "ontrolspartner.v1beta\032\037google/api/field_" + + "behavior.proto\032\031google/api/resource.prot" + + "o\032\037google/protobuf/timestamp.proto\032\032goog" + + "le/type/interval.proto\"\271\r\n\tViolation\022\021\n\004" + + "name\030\001 \001(\tB\003\340A\010\022\030\n\013description\030\002 \001(\tB\003\340A" + + "\003\0223\n\nbegin_time\030\003 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\0224\n\013update_time\030\004 \001(\0132\032.go" + + "ogle.protobuf.TimestampB\003\340A\003\0225\n\014resolve_" + + "time\030\005 \001(\0132\032.google.protobuf.TimestampB\003" + + "\340A\003\022\025\n\010category\030\006 \001(\tB\003\340A\003\022M\n\005state\030\007 \001(" + + "\01629.google.cloud.cloudcontrolspartner.v1" + + "beta.Violation.StateB\003\340A\003\022(\n\030non_complia" + + "nt_org_policy\030\010 \001(\tB\006\340A\003\340A\005\022\021\n\tfolder_id" + + "\030\t \001(\003\022Y\n\013remediation\030\r \001(\0132?.google.clo" + + "ud.cloudcontrolspartner.v1beta.Violation" + + ".RemediationB\003\340A\003\032\320\007\n\013Remediation\022g\n\014ins" + + "tructions\030\001 \001(\0132L.google.cloud.cloudcont" + + "rolspartner.v1beta.Violation.Remediation" + + ".InstructionsB\003\340A\002\022\030\n\020compliant_values\030\002" + + " \003(\t\022n\n\020remediation_type\030\003 \001(\0162O.google." + + "cloud.cloudcontrolspartner.v1beta.Violat" + + "ion.Remediation.RemediationTypeB\003\340A\003\032\212\003\n" + + "\014Instructions\022p\n\023gcloud_instructions\030\001 \001" + + "(\0132S.google.cloud.cloudcontrolspartner.v" + + "1beta.Violation.Remediation.Instructions" + + ".Gcloud\022r\n\024console_instructions\030\002 \001(\0132T." + + "google.cloud.cloudcontrolspartner.v1beta" + + ".Violation.Remediation.Instructions.Cons" + + "ole\032J\n\006Gcloud\022\027\n\017gcloud_commands\030\001 \003(\t\022\r" + + "\n\005steps\030\002 \003(\t\022\030\n\020additional_links\030\003 \003(\t\032" + + "H\n\007Console\022\024\n\014console_uris\030\001 \003(\t\022\r\n\005step" + + "s\030\002 \003(\t\022\030\n\020additional_links\030\003 \003(\t\"\300\002\n\017Re" + + "mediationType\022 \n\034REMEDIATION_TYPE_UNSPEC" + + "IFIED\020\000\022,\n(REMEDIATION_BOOLEAN_ORG_POLIC" + + "Y_VIOLATION\020\001\0228\n4REMEDIATION_LIST_ALLOWE" + + "D_VALUES_ORG_POLICY_VIOLATION\020\002\0227\n3REMED" + + "IATION_LIST_DENIED_VALUES_ORG_POLICY_VIO" + + "LATION\020\003\022F\nBREMEDIATION_RESTRICT_CMEK_CR" + + "YPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION\020\004" + + "\022\"\n\036REMEDIATION_RESOURCE_VIOLATION\020\005\"K\n\005" + + "State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010RESOLVED" + + "\020\001\022\016\n\nUNRESOLVED\020\002\022\r\n\tEXCEPTION\020\003:\276\001\352A\272\001" + + "\n-cloudcontrolspartner.googleapis.com/Vi" + + "olation\022rorganizations/{organization}/lo" + + "cations/{location}/customers/{customer}/" + + "workloads/{workload}/violations/{violati" + + "on}*\nviolations2\tviolation\"\351\001\n\025ListViola" + + "tionsRequest\022E\n\006parent\030\001 \001(\tB5\340A\002\372A/\022-cl" + + "oudcontrolspartner.googleapis.com/Violat" + + "ion\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_toke" + + "n\030\003 \001(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010ord" + + "er_by\030\005 \001(\tB\003\340A\001\022,\n\010interval\030\006 \001(\0132\025.goo" + + "gle.type.IntervalB\003\340A\001\"\217\001\n\026ListViolation" + + "sResponse\022G\n\nviolations\030\001 \003(\01323.google.c" + + "loud.cloudcontrolspartner.v1beta.Violati" + + "on\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachab" + + "le\030\003 \003(\t\"Z\n\023GetViolationRequest\022C\n\004name\030" + + "\001 \001(\tB5\340A\002\372A/\n-cloudcontrolspartner.goog" + + "leapis.com/ViolationB\247\002\n,com.google.clou" + + "d.cloudcontrolspartner.v1betaB\017Violation" + + "sProtoP\001Z`cloud.google.com/go/cloudcontr" + + "olspartner/apiv1beta/cloudcontrolspartne" + + "rpb;cloudcontrolspartnerpb\252\002(Google.Clou" + + "d.CloudControlsPartner.V1Beta\312\002(Google\\C" + + "loud\\CloudControlsPartner\\V1beta\352\002+Googl" + + "e::Cloud::CloudControlsPartner::V1betab\006" + + "proto3" + }; + 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.type.IntervalProto.getDescriptor(), + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_descriptor, + new java.lang.String[] { + "Name", + "Description", + "BeginTime", + "UpdateTime", + "ResolveTime", + "Category", + "State", + "NonCompliantOrgPolicy", + "FolderId", + "Remediation", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_descriptor, + new java.lang.String[] { + "Instructions", "CompliantValues", "RemediationType", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_descriptor, + new java.lang.String[] { + "GcloudInstructions", "ConsoleInstructions", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Gcloud_descriptor, + new java.lang.String[] { + "GcloudCommands", "Steps", "AdditionalLinks", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_descriptor = + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_Violation_Remediation_Instructions_Console_descriptor, + new java.lang.String[] { + "ConsoleUris", "Steps", "AdditionalLinks", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", "Interval", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_ListViolationsResponse_descriptor, + new java.lang.String[] { + "Violations", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_cloudcontrolspartner_v1beta_GetViolationRequest_descriptor, + new java.lang.String[] { + "Name", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.IntervalProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Workload.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Workload.java new file mode 100644 index 000000000000..5be8cc0eec34 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/Workload.java @@ -0,0 +1,2382 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Contains metadata around the [Workload
+ * resource](https://cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/Workload)
+ * in the Assured Workloads API.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Workload} + */ +public final class Workload extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.Workload) + WorkloadOrBuilder { + private static final long serialVersionUID = 0L; + // Use Workload.newBuilder() to construct. + private Workload(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Workload() { + name_ = ""; + folder_ = ""; + keyManagementProjectId_ = ""; + location_ = ""; + partner_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Workload(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Workload.class, + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder.class); + } + + /** + * + * + *
+   * Supported Assured Workloads Partners.
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.Workload.Partner} + */ + public enum Partner implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown Partner.
+     * 
+ * + * PARTNER_UNSPECIFIED = 0; + */ + PARTNER_UNSPECIFIED(0), + /** + * + * + *
+     * Enum representing S3NS (Thales) partner.
+     * 
+ * + * PARTNER_LOCAL_CONTROLS_BY_S3NS = 1; + */ + PARTNER_LOCAL_CONTROLS_BY_S3NS(1), + /** + * + * + *
+     * Enum representing T_SYSTEM (TSI) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS = 2; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS(2), + /** + * + * + *
+     * Enum representing SIA_MINSAIT (Indra) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT = 3; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT(3), + /** + * + * + *
+     * Enum representing PSN (TIM) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_PSN = 4; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_PSN(4), + /** + * + * + *
+     * Enum representing CNTXT (Kingdom of Saudi Arabia) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT = 6; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT(6), + /** + * + * + *
+     * Enum representing CNXT (Kingdom of Saudi Arabia) partner offering without
+     * EKM provisioning.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM = 7; + */ + PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown Partner.
+     * 
+ * + * PARTNER_UNSPECIFIED = 0; + */ + public static final int PARTNER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Enum representing S3NS (Thales) partner.
+     * 
+ * + * PARTNER_LOCAL_CONTROLS_BY_S3NS = 1; + */ + public static final int PARTNER_LOCAL_CONTROLS_BY_S3NS_VALUE = 1; + /** + * + * + *
+     * Enum representing T_SYSTEM (TSI) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS = 2; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS_VALUE = 2; + /** + * + * + *
+     * Enum representing SIA_MINSAIT (Indra) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT = 3; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT_VALUE = 3; + /** + * + * + *
+     * Enum representing PSN (TIM) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_PSN = 4; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_PSN_VALUE = 4; + /** + * + * + *
+     * Enum representing CNTXT (Kingdom of Saudi Arabia) partner.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT = 6; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_VALUE = 6; + /** + * + * + *
+     * Enum representing CNXT (Kingdom of Saudi Arabia) partner offering without
+     * EKM provisioning.
+     * 
+ * + * PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM = 7; + */ + public static final int PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM_VALUE = 7; + + 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 Partner 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 Partner forNumber(int value) { + switch (value) { + case 0: + return PARTNER_UNSPECIFIED; + case 1: + return PARTNER_LOCAL_CONTROLS_BY_S3NS; + case 2: + return PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS; + case 3: + return PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT; + case 4: + return PARTNER_SOVEREIGN_CONTROLS_BY_PSN; + case 6: + return PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT; + case 7: + return PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM; + 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 Partner findValueByNumber(int number) { + return Partner.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.cloud.cloudcontrolspartner.v1beta.Workload.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Partner[] VALUES = values(); + + public static Partner 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 Partner(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.Workload.Partner) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOLDER_ID_FIELD_NUMBER = 2; + private long folderId_ = 0L; + /** + * + * + *
+   * Output only. Folder id this workload is associated with
+   * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folderId. + */ + @java.lang.Override + public long getFolderId() { + return folderId_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 FOLDER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object folder_ = ""; + /** + * + * + *
+   * Output only. The name of container folder of the assured workload
+   * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folder. + */ + @java.lang.Override + public java.lang.String getFolder() { + java.lang.Object ref = folder_; + 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(); + folder_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of container folder of the assured workload
+   * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for folder. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFolderBytes() { + java.lang.Object ref = folder_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKLOAD_ONBOARDING_STATE_FIELD_NUMBER = 5; + private com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + workloadOnboardingState_; + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return Whether the workloadOnboardingState field is set. + */ + @java.lang.Override + public boolean hasWorkloadOnboardingState() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return The workloadOnboardingState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + getWorkloadOnboardingState() { + return workloadOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.getDefaultInstance() + : workloadOnboardingState_; + } + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStateOrBuilder + getWorkloadOnboardingStateOrBuilder() { + return workloadOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.getDefaultInstance() + : workloadOnboardingState_; + } + + public static final int IS_ONBOARDED_FIELD_NUMBER = 6; + private boolean isOnboarded_ = false; + /** + * + * + *
+   * Indicates whether a workload is fully onboarded.
+   * 
+ * + * bool is_onboarded = 6; + * + * @return The isOnboarded. + */ + @java.lang.Override + public boolean getIsOnboarded() { + return isOnboarded_; + } + + public static final int KEY_MANAGEMENT_PROJECT_ID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object keyManagementProjectId_ = ""; + /** + * + * + *
+   * The project id of the key management project for the workload
+   * 
+ * + * string key_management_project_id = 7; + * + * @return The keyManagementProjectId. + */ + @java.lang.Override + public java.lang.String getKeyManagementProjectId() { + java.lang.Object ref = keyManagementProjectId_; + 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(); + keyManagementProjectId_ = s; + return s; + } + } + /** + * + * + *
+   * The project id of the key management project for the workload
+   * 
+ * + * string key_management_project_id = 7; + * + * @return The bytes for keyManagementProjectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyManagementProjectIdBytes() { + java.lang.Object ref = keyManagementProjectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyManagementProjectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+   * The Google Cloud location of the workload
+   * 
+ * + * string location = 8; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * The Google Cloud location of the workload
+   * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARTNER_FIELD_NUMBER = 9; + private int partner_ = 0; + /** + * + * + *
+   * Partner associated with this workload.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @return The enum numeric value on the wire for partner. + */ + @java.lang.Override + public int getPartnerValue() { + return partner_; + } + /** + * + * + *
+   * Partner associated with this workload.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @return The partner. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner getPartner() { + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner result = + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner.forNumber(partner_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (folderId_ != 0L) { + output.writeInt64(2, folderId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folder_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, folder_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getWorkloadOnboardingState()); + } + if (isOnboarded_ != false) { + output.writeBool(6, isOnboarded_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyManagementProjectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, keyManagementProjectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, location_); + } + if (partner_ + != com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner.PARTNER_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, partner_); + } + 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 (folderId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, folderId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folder_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, folder_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getWorkloadOnboardingState()); + } + if (isOnboarded_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, isOnboarded_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyManagementProjectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, keyManagementProjectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, location_); + } + if (partner_ + != com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner.PARTNER_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, partner_); + } + 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.cloud.cloudcontrolspartner.v1beta.Workload)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.Workload other = + (com.google.cloud.cloudcontrolspartner.v1beta.Workload) obj; + + if (!getName().equals(other.getName())) return false; + if (getFolderId() != other.getFolderId()) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getFolder().equals(other.getFolder())) return false; + if (hasWorkloadOnboardingState() != other.hasWorkloadOnboardingState()) return false; + if (hasWorkloadOnboardingState()) { + if (!getWorkloadOnboardingState().equals(other.getWorkloadOnboardingState())) return false; + } + if (getIsOnboarded() != other.getIsOnboarded()) return false; + if (!getKeyManagementProjectId().equals(other.getKeyManagementProjectId())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (partner_ != other.partner_) 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) + FOLDER_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFolderId()); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + FOLDER_FIELD_NUMBER; + hash = (53 * hash) + getFolder().hashCode(); + if (hasWorkloadOnboardingState()) { + hash = (37 * hash) + WORKLOAD_ONBOARDING_STATE_FIELD_NUMBER; + hash = (53 * hash) + getWorkloadOnboardingState().hashCode(); + } + hash = (37 * hash) + IS_ONBOARDED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsOnboarded()); + hash = (37 * hash) + KEY_MANAGEMENT_PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getKeyManagementProjectId().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + PARTNER_FIELD_NUMBER; + hash = (53 * hash) + partner_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload 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.cloud.cloudcontrolspartner.v1beta.Workload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload 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.cloud.cloudcontrolspartner.v1beta.Workload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload 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.cloud.cloudcontrolspartner.v1beta.Workload parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload 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.cloud.cloudcontrolspartner.v1beta.Workload 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; + } + /** + * + * + *
+   * Contains metadata around the [Workload
+   * resource](https://cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/Workload)
+   * in the Assured Workloads API.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.Workload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.Workload) + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.Workload.class, + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Builder.class); + } + + // Construct using com.google.cloud.cloudcontrolspartner.v1beta.Workload.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getWorkloadOnboardingStateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + folderId_ = 0L; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + folder_ = ""; + workloadOnboardingState_ = null; + if (workloadOnboardingStateBuilder_ != null) { + workloadOnboardingStateBuilder_.dispose(); + workloadOnboardingStateBuilder_ = null; + } + isOnboarded_ = false; + keyManagementProjectId_ = ""; + location_ = ""; + partner_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_Workload_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Workload getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.Workload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Workload build() { + com.google.cloud.cloudcontrolspartner.v1beta.Workload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Workload buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.Workload result = + new com.google.cloud.cloudcontrolspartner.v1beta.Workload(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.cloudcontrolspartner.v1beta.Workload result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.folderId_ = folderId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.folder_ = folder_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.workloadOnboardingState_ = + workloadOnboardingStateBuilder_ == null + ? workloadOnboardingState_ + : workloadOnboardingStateBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.isOnboarded_ = isOnboarded_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.keyManagementProjectId_ = keyManagementProjectId_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.partner_ = partner_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.Workload) { + return mergeFrom((com.google.cloud.cloudcontrolspartner.v1beta.Workload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.cloudcontrolspartner.v1beta.Workload other) { + if (other == com.google.cloud.cloudcontrolspartner.v1beta.Workload.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFolderId() != 0L) { + setFolderId(other.getFolderId()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getFolder().isEmpty()) { + folder_ = other.folder_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasWorkloadOnboardingState()) { + mergeWorkloadOnboardingState(other.getWorkloadOnboardingState()); + } + if (other.getIsOnboarded() != false) { + setIsOnboarded(other.getIsOnboarded()); + } + if (!other.getKeyManagementProjectId().isEmpty()) { + keyManagementProjectId_ = other.keyManagementProjectId_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.partner_ != 0) { + setPartnerValue(other.getPartnerValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + folderId_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + folder_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + getWorkloadOnboardingStateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + isOnboarded_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + keyManagementProjectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + partner_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Format:
+     * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long folderId_; + /** + * + * + *
+     * Output only. Folder id this workload is associated with
+     * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folderId. + */ + @java.lang.Override + public long getFolderId() { + return folderId_; + } + /** + * + * + *
+     * Output only. Folder id this workload is associated with
+     * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The folderId to set. + * @return This builder for chaining. + */ + public Builder setFolderId(long value) { + + folderId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Folder id this workload is associated with
+     * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFolderId() { + bitField0_ = (bitField0_ & ~0x00000002); + folderId_ = 0L; + 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. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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. Time the resource was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 java.lang.Object folder_ = ""; + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folder. + */ + public java.lang.String getFolder() { + java.lang.Object ref = folder_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + folder_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for folder. + */ + public com.google.protobuf.ByteString getFolderBytes() { + java.lang.Object ref = folder_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folder_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The folder to set. + * @return This builder for chaining. + */ + public Builder setFolder(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + folder_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFolder() { + folder_ = getDefaultInstance().getFolder(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of container folder of the assured workload
+     * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for folder to set. + * @return This builder for chaining. + */ + public Builder setFolderBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + folder_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + workloadOnboardingState_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStateOrBuilder> + workloadOnboardingStateBuilder_; + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return Whether the workloadOnboardingState field is set. + */ + public boolean hasWorkloadOnboardingState() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return The workloadOnboardingState. + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + getWorkloadOnboardingState() { + if (workloadOnboardingStateBuilder_ == null) { + return workloadOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + .getDefaultInstance() + : workloadOnboardingState_; + } else { + return workloadOnboardingStateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public Builder setWorkloadOnboardingState( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState value) { + if (workloadOnboardingStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workloadOnboardingState_ = value; + } else { + workloadOnboardingStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public Builder setWorkloadOnboardingState( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.Builder + builderForValue) { + if (workloadOnboardingStateBuilder_ == null) { + workloadOnboardingState_ = builderForValue.build(); + } else { + workloadOnboardingStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public Builder mergeWorkloadOnboardingState( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState value) { + if (workloadOnboardingStateBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && workloadOnboardingState_ != null + && workloadOnboardingState_ + != com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + .getDefaultInstance()) { + getWorkloadOnboardingStateBuilder().mergeFrom(value); + } else { + workloadOnboardingState_ = value; + } + } else { + workloadOnboardingStateBuilder_.mergeFrom(value); + } + if (workloadOnboardingState_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public Builder clearWorkloadOnboardingState() { + bitField0_ = (bitField0_ & ~0x00000010); + workloadOnboardingState_ = null; + if (workloadOnboardingStateBuilder_ != null) { + workloadOnboardingStateBuilder_.dispose(); + workloadOnboardingStateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.Builder + getWorkloadOnboardingStateBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getWorkloadOnboardingStateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStateOrBuilder + getWorkloadOnboardingStateOrBuilder() { + if (workloadOnboardingStateBuilder_ != null) { + return workloadOnboardingStateBuilder_.getMessageOrBuilder(); + } else { + return workloadOnboardingState_ == null + ? com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + .getDefaultInstance() + : workloadOnboardingState_; + } + } + /** + * + * + *
+     * Container for workload onboarding steps.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStateOrBuilder> + getWorkloadOnboardingStateFieldBuilder() { + if (workloadOnboardingStateBuilder_ == null) { + workloadOnboardingStateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStateOrBuilder>( + getWorkloadOnboardingState(), getParentForChildren(), isClean()); + workloadOnboardingState_ = null; + } + return workloadOnboardingStateBuilder_; + } + + private boolean isOnboarded_; + /** + * + * + *
+     * Indicates whether a workload is fully onboarded.
+     * 
+ * + * bool is_onboarded = 6; + * + * @return The isOnboarded. + */ + @java.lang.Override + public boolean getIsOnboarded() { + return isOnboarded_; + } + /** + * + * + *
+     * Indicates whether a workload is fully onboarded.
+     * 
+ * + * bool is_onboarded = 6; + * + * @param value The isOnboarded to set. + * @return This builder for chaining. + */ + public Builder setIsOnboarded(boolean value) { + + isOnboarded_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Indicates whether a workload is fully onboarded.
+     * 
+ * + * bool is_onboarded = 6; + * + * @return This builder for chaining. + */ + public Builder clearIsOnboarded() { + bitField0_ = (bitField0_ & ~0x00000020); + isOnboarded_ = false; + onChanged(); + return this; + } + + private java.lang.Object keyManagementProjectId_ = ""; + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @return The keyManagementProjectId. + */ + public java.lang.String getKeyManagementProjectId() { + java.lang.Object ref = keyManagementProjectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyManagementProjectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @return The bytes for keyManagementProjectId. + */ + public com.google.protobuf.ByteString getKeyManagementProjectIdBytes() { + java.lang.Object ref = keyManagementProjectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keyManagementProjectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @param value The keyManagementProjectId to set. + * @return This builder for chaining. + */ + public Builder setKeyManagementProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + keyManagementProjectId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @return This builder for chaining. + */ + public Builder clearKeyManagementProjectId() { + keyManagementProjectId_ = getDefaultInstance().getKeyManagementProjectId(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * The project id of the key management project for the workload
+     * 
+ * + * string key_management_project_id = 7; + * + * @param value The bytes for keyManagementProjectId to set. + * @return This builder for chaining. + */ + public Builder setKeyManagementProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + keyManagementProjectId_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * The Google Cloud location of the workload
+     * 
+ * + * string location = 8; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + location_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private int partner_ = 0; + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @return The enum numeric value on the wire for partner. + */ + @java.lang.Override + public int getPartnerValue() { + return partner_; + } + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @param value The enum numeric value on the wire for partner to set. + * @return This builder for chaining. + */ + public Builder setPartnerValue(int value) { + partner_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @return The partner. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner getPartner() { + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner result = + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner.forNumber(partner_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @param value The partner to set. + * @return This builder for chaining. + */ + public Builder setPartner(com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + partner_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Partner associated with this workload.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @return This builder for chaining. + */ + public Builder clearPartner() { + bitField0_ = (bitField0_ & ~0x00000100); + partner_ = 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.cloud.cloudcontrolspartner.v1beta.Workload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.Workload) + private static final com.google.cloud.cloudcontrolspartner.v1beta.Workload DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.Workload(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.Workload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Workload 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.cloud.cloudcontrolspartner.v1beta.Workload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadName.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadName.java new file mode 100644 index 000000000000..8dce1354c8ee --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class WorkloadName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String customer; + private final String workload; + + @Deprecated + protected WorkloadName() { + organization = null; + location = null; + customer = null; + workload = null; + } + + private WorkloadName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + customer = Preconditions.checkNotNull(builder.getCustomer()); + workload = Preconditions.checkNotNull(builder.getWorkload()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static WorkloadName of( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build(); + } + + public static String format( + String organization, String location, String customer, String workload) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setCustomer(customer) + .setWorkload(workload) + .build() + .toString(); + } + + public static WorkloadName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.validatedMatch( + formattedString, "WorkloadName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("customer"), + matchMap.get("workload")); + } + + 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 (WorkloadName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customer != null) { + fieldMapBuilder.put("customer", customer); + } + if (workload != null) { + fieldMapBuilder.put("workload", workload); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_CUSTOMER_WORKLOAD.instantiate( + "organization", + organization, + "location", + location, + "customer", + customer, + "workload", + workload); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + WorkloadName that = ((WorkloadName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customer, that.customer) + && Objects.equals(this.workload, that.workload); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customer); + h *= 1000003; + h ^= Objects.hashCode(workload); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}. + */ + public static class Builder { + private String organization; + private String location; + private String customer; + private String workload; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getCustomer() { + return customer; + } + + public String getWorkload() { + return workload; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + public Builder setWorkload(String workload) { + this.workload = workload; + return this; + } + + private Builder(WorkloadName workloadName) { + this.organization = workloadName.organization; + this.location = workloadName.location; + this.customer = workloadName.customer; + this.workload = workloadName.workload; + } + + public WorkloadName build() { + return new WorkloadName(this); + } + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingState.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingState.java new file mode 100644 index 000000000000..d81d45869b11 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingState.java @@ -0,0 +1,1031 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Container for workload onboarding steps.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState} + */ +public final class WorkloadOnboardingState extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState) + WorkloadOnboardingStateOrBuilder { + private static final long serialVersionUID = 0L; + // Use WorkloadOnboardingState.newBuilder() to construct. + private WorkloadOnboardingState(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WorkloadOnboardingState() { + onboardingSteps_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WorkloadOnboardingState(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.class, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.Builder.class); + } + + public static final int ONBOARDING_STEPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + onboardingSteps_; + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public java.util.List + getOnboardingStepsList() { + return onboardingSteps_; + } + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList() { + return onboardingSteps_; + } + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public int getOnboardingStepsCount() { + return onboardingSteps_.size(); + } + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep getOnboardingSteps( + int index) { + return onboardingSteps_.get(index); + } + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index) { + return onboardingSteps_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < onboardingSteps_.size(); i++) { + output.writeMessage(1, onboardingSteps_.get(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 < onboardingSteps_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, onboardingSteps_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState other = + (com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState) obj; + + if (!getOnboardingStepsList().equals(other.getOnboardingStepsList())) 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 (getOnboardingStepsCount() > 0) { + hash = (37 * hash) + ONBOARDING_STEPS_FIELD_NUMBER; + hash = (53 * hash) + getOnboardingStepsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState 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; + } + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState) + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.class, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (onboardingStepsBuilder_ == null) { + onboardingSteps_ = java.util.Collections.emptyList(); + } else { + onboardingSteps_ = null; + onboardingStepsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingState_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState build() { + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState result = + new com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState result) { + if (onboardingStepsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + onboardingSteps_ = java.util.Collections.unmodifiableList(onboardingSteps_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.onboardingSteps_ = onboardingSteps_; + } else { + result.onboardingSteps_ = onboardingStepsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + .getDefaultInstance()) return this; + if (onboardingStepsBuilder_ == null) { + if (!other.onboardingSteps_.isEmpty()) { + if (onboardingSteps_.isEmpty()) { + onboardingSteps_ = other.onboardingSteps_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.addAll(other.onboardingSteps_); + } + onChanged(); + } + } else { + if (!other.onboardingSteps_.isEmpty()) { + if (onboardingStepsBuilder_.isEmpty()) { + onboardingStepsBuilder_.dispose(); + onboardingStepsBuilder_ = null; + onboardingSteps_ = other.onboardingSteps_; + bitField0_ = (bitField0_ & ~0x00000001); + onboardingStepsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOnboardingStepsFieldBuilder() + : null; + } else { + onboardingStepsBuilder_.addAllMessages(other.onboardingSteps_); + } + } + } + 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep m = + input.readMessage( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + .parser(), + extensionRegistry); + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(m); + } else { + onboardingStepsBuilder_.addMessage(m); + } + 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.util.List + onboardingSteps_ = java.util.Collections.emptyList(); + + private void ensureOnboardingStepsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + onboardingSteps_ = + new java.util.ArrayList< + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep>( + onboardingSteps_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder> + onboardingStepsBuilder_; + + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List + getOnboardingStepsList() { + if (onboardingStepsBuilder_ == null) { + return java.util.Collections.unmodifiableList(onboardingSteps_); + } else { + return onboardingStepsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public int getOnboardingStepsCount() { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.size(); + } else { + return onboardingStepsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep getOnboardingSteps( + int index) { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.get(index); + } else { + return onboardingStepsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder setOnboardingSteps( + int index, com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.set(index, value); + onChanged(); + } else { + onboardingStepsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder setOnboardingSteps( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder + builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.set(index, builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(value); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + int index, com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep value) { + if (onboardingStepsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(index, value); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder + builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addOnboardingSteps( + int index, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder + builderForValue) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.add(index, builderForValue.build()); + onChanged(); + } else { + onboardingStepsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder addAllOnboardingSteps( + java.lang.Iterable< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep> + values) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, onboardingSteps_); + onChanged(); + } else { + onboardingStepsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder clearOnboardingSteps() { + if (onboardingStepsBuilder_ == null) { + onboardingSteps_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + onboardingStepsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public Builder removeOnboardingSteps(int index) { + if (onboardingStepsBuilder_ == null) { + ensureOnboardingStepsIsMutable(); + onboardingSteps_.remove(index); + onChanged(); + } else { + onboardingStepsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder + getOnboardingStepsBuilder(int index) { + return getOnboardingStepsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index) { + if (onboardingStepsBuilder_ == null) { + return onboardingSteps_.get(index); + } else { + return onboardingStepsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList() { + if (onboardingStepsBuilder_ != null) { + return onboardingStepsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(onboardingSteps_); + } + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder + addOnboardingStepsBuilder() { + return getOnboardingStepsFieldBuilder() + .addBuilder( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + .getDefaultInstance()); + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder + addOnboardingStepsBuilder(int index) { + return getOnboardingStepsFieldBuilder() + .addBuilder( + index, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + .getDefaultInstance()); + } + /** + * + * + *
+     * List of workload onboarding steps.
+     * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + public java.util.List< + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder> + getOnboardingStepsBuilderList() { + return getOnboardingStepsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder> + getOnboardingStepsFieldBuilder() { + if (onboardingStepsBuilder_ == null) { + onboardingStepsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder>( + onboardingSteps_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + onboardingSteps_ = null; + } + return onboardingStepsBuilder_; + } + + @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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState) + private static final com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WorkloadOnboardingState 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStateOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStateOrBuilder.java new file mode 100644 index 000000000000..3038adb94eac --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStateOrBuilder.java @@ -0,0 +1,91 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface WorkloadOnboardingStateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + java.util.List + getOnboardingStepsList(); + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep getOnboardingSteps(int index); + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + int getOnboardingStepsCount(); + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + java.util.List< + ? extends com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder> + getOnboardingStepsOrBuilderList(); + /** + * + * + *
+   * List of workload onboarding steps.
+   * 
+ * + * + * repeated .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep onboarding_steps = 1; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder + getOnboardingStepsOrBuilder(int index); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStep.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStep.java new file mode 100644 index 000000000000..1e581a13f068 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStep.java @@ -0,0 +1,1482 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +/** + * + * + *
+ * Container for workload onboarding information.
+ * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep} + */ +public final class WorkloadOnboardingStep extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep) + WorkloadOnboardingStepOrBuilder { + private static final long serialVersionUID = 0L; + // Use WorkloadOnboardingStep.newBuilder() to construct. + private WorkloadOnboardingStep(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WorkloadOnboardingStep() { + step_ = 0; + completionState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WorkloadOnboardingStep(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.class, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder.class); + } + + /** + * + * + *
+   * Enum for possible onboarding steps.
+   * 
+ * + * Protobuf enum {@code google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step} + */ + public enum Step implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified step.
+     * 
+ * + * STEP_UNSPECIFIED = 0; + */ + STEP_UNSPECIFIED(0), + /** + * + * + *
+     * EKM Provisioned step.
+     * 
+ * + * EKM_PROVISIONED = 1; + */ + EKM_PROVISIONED(1), + /** + * + * + *
+     * Signed Access Approval step.
+     * 
+ * + * SIGNED_ACCESS_APPROVAL_CONFIGURED = 2; + */ + SIGNED_ACCESS_APPROVAL_CONFIGURED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified step.
+     * 
+ * + * STEP_UNSPECIFIED = 0; + */ + public static final int STEP_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * EKM Provisioned step.
+     * 
+ * + * EKM_PROVISIONED = 1; + */ + public static final int EKM_PROVISIONED_VALUE = 1; + /** + * + * + *
+     * Signed Access Approval step.
+     * 
+ * + * SIGNED_ACCESS_APPROVAL_CONFIGURED = 2; + */ + public static final int SIGNED_ACCESS_APPROVAL_CONFIGURED_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 Step 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 Step forNumber(int value) { + switch (value) { + case 0: + return STEP_UNSPECIFIED; + case 1: + return EKM_PROVISIONED; + case 2: + return SIGNED_ACCESS_APPROVAL_CONFIGURED; + 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 Step findValueByNumber(int number) { + return Step.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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Step[] VALUES = values(); + + public static Step 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 Step(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step) + } + + private int bitField0_; + public static final int STEP_FIELD_NUMBER = 1; + private int step_ = 0; + /** + * + * + *
+   * The onboarding step.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+   * The onboarding step.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step getStep() { + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step result = + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step.forNumber(step_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step.UNRECOGNIZED + : result; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int COMPLETION_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp completionTime_; + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + @java.lang.Override + public boolean hasCompletionTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCompletionTime() { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder() { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + + public static final int COMPLETION_STATE_FIELD_NUMBER = 4; + private int completionState_ = 0; + /** + * + * + *
+   * Output only. The completion state of the onboarding step.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + @java.lang.Override + public int getCompletionStateValue() { + return completionState_; + } + /** + * + * + *
+   * Output only. The completion state of the onboarding step.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CompletionState getCompletionState() { + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState result = + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.forNumber(completionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.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 (step_ + != com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step.STEP_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, step_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getCompletionTime()); + } + if (completionState_ + != com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.COMPLETION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, completionState_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (step_ + != com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step.STEP_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, step_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCompletionTime()); + } + if (completionState_ + != com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.COMPLETION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, completionState_); + } + 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep)) { + return super.equals(obj); + } + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep other = + (com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep) obj; + + if (step_ != other.step_) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasCompletionTime() != other.hasCompletionTime()) return false; + if (hasCompletionTime()) { + if (!getCompletionTime().equals(other.getCompletionTime())) return false; + } + if (completionState_ != other.completionState_) 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) + STEP_FIELD_NUMBER; + hash = (53 * hash) + step_; + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasCompletionTime()) { + hash = (37 * hash) + COMPLETION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCompletionTime().hashCode(); + } + hash = (37 * hash) + COMPLETION_STATE_FIELD_NUMBER; + hash = (53 * hash) + completionState_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep 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; + } + /** + * + * + *
+   * Container for workload onboarding information.
+   * 
+ * + * Protobuf type {@code google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep) + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStepOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.class, + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Builder.class); + } + + // Construct using + // com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getCompletionTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + step_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + completionTime_ = null; + if (completionTimeBuilder_ != null) { + completionTimeBuilder_.dispose(); + completionTimeBuilder_ = null; + } + completionState_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.CustomerWorkloadsProto + .internal_static_google_cloud_cloudcontrolspartner_v1beta_WorkloadOnboardingStep_descriptor; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + getDefaultInstanceForType() { + return com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep build() { + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep buildPartial() { + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep result = + new com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.step_ = step_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.completionTime_ = + completionTimeBuilder_ == null ? completionTime_ : completionTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.completionState_ = completionState_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep) { + return mergeFrom( + (com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep other) { + if (other + == com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + .getDefaultInstance()) return this; + if (other.step_ != 0) { + setStepValue(other.getStepValue()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasCompletionTime()) { + mergeCompletionTime(other.getCompletionTime()); + } + if (other.completionState_ != 0) { + setCompletionStateValue(other.getCompletionStateValue()); + } + 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: + { + step_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCompletionTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + completionState_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + 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 int step_ = 0; + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + @java.lang.Override + public int getStepValue() { + return step_; + } + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @param value The enum numeric value on the wire for step to set. + * @return This builder for chaining. + */ + public Builder setStepValue(int value) { + step_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @return The step. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step getStep() { + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step result = + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step.forNumber(step_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @param value The step to set. + * @return This builder for chaining. + */ + public Builder setStep( + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + step_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The onboarding step.
+     * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @return This builder for chaining. + */ + public Builder clearStep() { + bitField0_ = (bitField0_ & ~0x00000001); + step_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * The starting time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp completionTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + completionTimeBuilder_; + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + public boolean hasCompletionTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + public com.google.protobuf.Timestamp getCompletionTime() { + if (completionTimeBuilder_ == null) { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } else { + return completionTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder setCompletionTime(com.google.protobuf.Timestamp value) { + if (completionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + completionTime_ = value; + } else { + completionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder setCompletionTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (completionTimeBuilder_ == null) { + completionTime_ = builderForValue.build(); + } else { + completionTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder mergeCompletionTime(com.google.protobuf.Timestamp value) { + if (completionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && completionTime_ != null + && completionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCompletionTimeBuilder().mergeFrom(value); + } else { + completionTime_ = value; + } + } else { + completionTimeBuilder_.mergeFrom(value); + } + if (completionTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public Builder clearCompletionTime() { + bitField0_ = (bitField0_ & ~0x00000004); + completionTime_ = null; + if (completionTimeBuilder_ != null) { + completionTimeBuilder_.dispose(); + completionTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCompletionTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCompletionTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder() { + if (completionTimeBuilder_ != null) { + return completionTimeBuilder_.getMessageOrBuilder(); + } else { + return completionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : completionTime_; + } + } + /** + * + * + *
+     * The completion time of the onboarding step.
+     * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCompletionTimeFieldBuilder() { + if (completionTimeBuilder_ == null) { + completionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCompletionTime(), getParentForChildren(), isClean()); + completionTime_ = null; + } + return completionTimeBuilder_; + } + + private int completionState_ = 0; + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + @java.lang.Override + public int getCompletionStateValue() { + return completionState_; + } + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for completionState to set. + * @return This builder for chaining. + */ + public Builder setCompletionStateValue(int value) { + completionState_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + @java.lang.Override + public com.google.cloud.cloudcontrolspartner.v1beta.CompletionState getCompletionState() { + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState result = + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.forNumber(completionState_); + return result == null + ? com.google.cloud.cloudcontrolspartner.v1beta.CompletionState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The completionState to set. + * @return This builder for chaining. + */ + public Builder setCompletionState( + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + completionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The completion state of the onboarding step.
+     * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearCompletionState() { + bitField0_ = (bitField0_ & ~0x00000008); + completionState_ = 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep) + } + + // @@protoc_insertion_point(class_scope:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep) + private static final com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep(); + } + + public static com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WorkloadOnboardingStep 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.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStepOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStepOrBuilder.java new file mode 100644 index 000000000000..fae3b6d96b94 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOnboardingStepOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface WorkloadOnboardingStepOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The onboarding step.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @return The enum numeric value on the wire for step. + */ + int getStepValue(); + /** + * + * + *
+   * The onboarding step.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step step = 1; + * + * @return The step. + */ + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStep.Step getStep(); + + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * The starting time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return Whether the completionTime field is set. + */ + boolean hasCompletionTime(); + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + * + * @return The completionTime. + */ + com.google.protobuf.Timestamp getCompletionTime(); + /** + * + * + *
+   * The completion time of the onboarding step.
+   * 
+ * + * .google.protobuf.Timestamp completion_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCompletionTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The completion state of the onboarding step.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for completionState. + */ + int getCompletionStateValue(); + /** + * + * + *
+   * Output only. The completion state of the onboarding step.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.CompletionState completion_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The completionState. + */ + com.google.cloud.cloudcontrolspartner.v1beta.CompletionState getCompletionState(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOrBuilder.java b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOrBuilder.java new file mode 100644 index 000000000000..f63205cf3e33 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/java/com/google/cloud/cloudcontrolspartner/v1beta/WorkloadOrBuilder.java @@ -0,0 +1,259 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.cloudcontrolspartner.v1beta; + +public interface WorkloadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.cloudcontrolspartner.v1beta.Workload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Format:
+   * organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Folder id this workload is associated with
+   * 
+ * + * int64 folder_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folderId. + */ + long getFolderId(); + + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Time the resource was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The name of container folder of the assured workload
+   * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The folder. + */ + java.lang.String getFolder(); + /** + * + * + *
+   * Output only. The name of container folder of the assured workload
+   * 
+ * + * string folder = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for folder. + */ + com.google.protobuf.ByteString getFolderBytes(); + + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return Whether the workloadOnboardingState field is set. + */ + boolean hasWorkloadOnboardingState(); + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + * + * @return The workloadOnboardingState. + */ + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState getWorkloadOnboardingState(); + /** + * + * + *
+   * Container for workload onboarding steps.
+   * 
+ * + * + * .google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingState workload_onboarding_state = 5; + * + */ + com.google.cloud.cloudcontrolspartner.v1beta.WorkloadOnboardingStateOrBuilder + getWorkloadOnboardingStateOrBuilder(); + + /** + * + * + *
+   * Indicates whether a workload is fully onboarded.
+   * 
+ * + * bool is_onboarded = 6; + * + * @return The isOnboarded. + */ + boolean getIsOnboarded(); + + /** + * + * + *
+   * The project id of the key management project for the workload
+   * 
+ * + * string key_management_project_id = 7; + * + * @return The keyManagementProjectId. + */ + java.lang.String getKeyManagementProjectId(); + /** + * + * + *
+   * The project id of the key management project for the workload
+   * 
+ * + * string key_management_project_id = 7; + * + * @return The bytes for keyManagementProjectId. + */ + com.google.protobuf.ByteString getKeyManagementProjectIdBytes(); + + /** + * + * + *
+   * The Google Cloud location of the workload
+   * 
+ * + * string location = 8; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * The Google Cloud location of the workload
+   * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Partner associated with this workload.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @return The enum numeric value on the wire for partner. + */ + int getPartnerValue(); + /** + * + * + *
+   * Partner associated with this workload.
+   * 
+ * + * .google.cloud.cloudcontrolspartner.v1beta.Workload.Partner partner = 9; + * + * @return The partner. + */ + com.google.cloud.cloudcontrolspartner.v1beta.Workload.Partner getPartner(); +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto new file mode 100644 index 000000000000..1a7d9ccf383b --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto @@ -0,0 +1,146 @@ +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessApprovalRequestsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// Details about the Access request. +message AccessApprovalRequest { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/AccessApprovalRequest" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}" + plural: "accessApprovalRequests" + singular: "accessApprovalRequest" + }; + + // Identifier. Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/accessApprovalRequests/{access_approval_request}. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The time at which approval was requested. + google.protobuf.Timestamp request_time = 2; + + // The justification for which approval is being requested. + AccessReason requested_reason = 3; + + // The requested expiration for the approval. If the request is approved, + // access will be granted from the time of approval until the expiration time. + google.protobuf.Timestamp requested_expiration_time = 4; +} + +// Request for getting the access requests associated with a workload. +message ListAccessApprovalRequestsRequest { + // Required. Parent resource + // Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/AccessApprovalRequest" + } + ]; + + // Optional. The maximum number of access requests to return. The service may + // return fewer than this value. If unspecified, at most 500 access requests + // will be returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListAccessApprovalRequests` call. Provide this to retrieve the subsequent + // page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for list access requests. +message ListAccessApprovalRequestsResponse { + // List of access approval requests + repeated AccessApprovalRequest access_approval_requests = 1; + + // A token that 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; +} + +// Reason for the access. +message AccessReason { + // Type of access justification. + enum Type { + // Default value for proto, shouldn't be used. + TYPE_UNSPECIFIED = 0; + + // Customer made a request or raised an issue that required the principal to + // access customer data. `detail` is of the form ("#####" is the issue ID): + // + // - "Feedback Report: #####" + // - "Case Number: #####" + // - "Case ID: #####" + // - "E-PIN Reference: #####" + // - "Google-#####" + // - "T-#####" + CUSTOMER_INITIATED_SUPPORT = 1; + + // The principal accessed customer data in order to diagnose or resolve a + // suspected issue in services. Often this access is used to confirm that + // customers are not affected by a suspected service issue or to remediate a + // reversible system issue. + GOOGLE_INITIATED_SERVICE = 2; + + // Google initiated service for security, fraud, abuse, or compliance + // purposes. + GOOGLE_INITIATED_REVIEW = 3; + + // The principal was compelled to access customer data in order to respond + // to a legal third party data request or process, including legal processes + // from customers themselves. + THIRD_PARTY_DATA_REQUEST = 4; + + // The principal accessed customer data in order to diagnose or resolve a + // suspected issue in services or a known outage. + GOOGLE_RESPONSE_TO_PRODUCTION_ALERT = 5; + + // Similar to 'GOOGLE_INITIATED_SERVICE' or 'GOOGLE_INITIATED_REVIEW', but + // with universe agnostic naming. The principal accessed customer data in + // order to diagnose or resolve a suspected issue in services or a known + // outage, or for security, fraud, abuse, or compliance review purposes. + CLOUD_INITIATED_ACCESS = 6; + } + + // Type of access justification. + Type type = 1; + + // More detail about certain reason types. See comments for each type above. + string detail = 2; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/completion_state.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/completion_state.proto new file mode 100644 index 000000000000..8c3782f6123c --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/completion_state.proto @@ -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 +// +// 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.cloud.cloudcontrolspartner.v1beta; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "CompletionStateProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// Enum for possible completion states. +enum CompletionState { + // Unspecified completion state. + COMPLETION_STATE_UNSPECIFIED = 0; + + // Task started (has start date) but not yet completed. + PENDING = 1; + + // Succeeded state. + SUCCEEDED = 2; + + // Failed state. + FAILED = 3; + + // Not applicable state. + NOT_APPLICABLE = 4; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/core.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/core.proto new file mode 100644 index 000000000000..18ef86f564b9 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/core.proto @@ -0,0 +1,144 @@ +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/customers.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/partners.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "CoreProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; +option (google.api.resource_definition) = { + type: "cloudcontrolspartner.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Service describing handlers for resources +service CloudControlsPartnerCore { + option (google.api.default_host) = "cloudcontrolspartner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets details of a single workload + rpc GetWorkload(GetWorkloadRequest) returns (Workload) { + option (google.api.http) = { + get: "/v1beta/{name=organizations/*/locations/*/customers/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists customer workloads for a given customer org id + rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=organizations/*/locations/*/customers/*}/workloads" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single customer + rpc GetCustomer(GetCustomerRequest) returns (Customer) { + option (google.api.http) = { + get: "/v1beta/{name=organizations/*/locations/*/customers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists customers of a partner identified by its Google Cloud organization ID + rpc ListCustomers(ListCustomersRequest) returns (ListCustomersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=organizations/*/locations/*}/customers" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the EKM connections associated with a workload + rpc GetEkmConnections(GetEkmConnectionsRequest) returns (EkmConnections) { + option (google.api.http) = { + get: "/v1beta/{name=organizations/*/locations/*/customers/*/workloads/*/ekmConnections}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets the partner permissions granted for a workload + rpc GetPartnerPermissions(GetPartnerPermissionsRequest) + returns (PartnerPermissions) { + option (google.api.http) = { + get: "/v1beta/{name=organizations/*/locations/*/customers/*/workloads/*/partnerPermissions}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists access requests associated with a workload + rpc ListAccessApprovalRequests(ListAccessApprovalRequestsRequest) + returns (ListAccessApprovalRequestsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=organizations/*/locations/*/customers/*/workloads/*}/accessApprovalRequests" + }; + option (google.api.method_signature) = "parent"; + } + + // Get details of a Partner. + rpc GetPartner(GetPartnerRequest) returns (Partner) { + option (google.api.http) = { + get: "/v1beta/{name=organizations/*/locations/*/partner}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have been cancelled successfully + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto new file mode 100644 index 000000000000..90675b7c2638 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.proto @@ -0,0 +1,182 @@ +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/completion_state.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "CustomerWorkloadsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// Contains metadata around the [Workload +// resource](https://cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/Workload) +// in the Assured Workloads API. +message Workload { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/Workload" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}" + plural: "workloads" + singular: "workload" + }; + + // Supported Assured Workloads Partners. + enum Partner { + // Unknown Partner. + PARTNER_UNSPECIFIED = 0; + + // Enum representing S3NS (Thales) partner. + PARTNER_LOCAL_CONTROLS_BY_S3NS = 1; + + // Enum representing T_SYSTEM (TSI) partner. + PARTNER_SOVEREIGN_CONTROLS_BY_T_SYSTEMS = 2; + + // Enum representing SIA_MINSAIT (Indra) partner. + PARTNER_SOVEREIGN_CONTROLS_BY_SIA_MINSAIT = 3; + + // Enum representing PSN (TIM) partner. + PARTNER_SOVEREIGN_CONTROLS_BY_PSN = 4; + + // Enum representing CNTXT (Kingdom of Saudi Arabia) partner. + PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT = 6; + + // Enum representing CNXT (Kingdom of Saudi Arabia) partner offering without + // EKM provisioning. + PARTNER_SOVEREIGN_CONTROLS_BY_CNTXT_NO_EKM = 7; + } + + // Identifier. Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Folder id this workload is associated with + int64 folder_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time the resource was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of container folder of the assured workload + string folder = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Container for workload onboarding steps. + WorkloadOnboardingState workload_onboarding_state = 5; + + // Indicates whether a workload is fully onboarded. + bool is_onboarded = 6; + + // The project id of the key management project for the workload + string key_management_project_id = 7; + + // The Google Cloud location of the workload + string location = 8; + + // Partner associated with this workload. + Partner partner = 9; +} + +// Request to list customer workloads. +message ListWorkloadsRequest { + // Required. Parent resource + // Format: + // organizations/{organization}/locations/{location}/customers/{customer} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/Workload" + } + ]; + + // The maximum number of workloads to return. The service may return fewer + // than this value. If unspecified, at most 500 workloads will be returned. + int32 page_size = 2; + + // A page token, received from a previous `ListWorkloads` call. + // Provide this to retrieve the subsequent page. + string page_token = 3; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for list customer workloads requests. +message ListWorkloadsResponse { + // List of customer workloads + repeated Workload workloads = 1; + + // A token that 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 customer workload. +message GetWorkloadRequest { + // Required. Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Workload" + } + ]; +} + +// Container for workload onboarding steps. +message WorkloadOnboardingState { + // List of workload onboarding steps. + repeated WorkloadOnboardingStep onboarding_steps = 1; +} + +// Container for workload onboarding information. +message WorkloadOnboardingStep { + // Enum for possible onboarding steps. + enum Step { + // Unspecified step. + STEP_UNSPECIFIED = 0; + + // EKM Provisioned step. + EKM_PROVISIONED = 1; + + // Signed Access Approval step. + SIGNED_ACCESS_APPROVAL_CONFIGURED = 2; + } + + // The onboarding step. + Step step = 1; + + // The starting time of the onboarding step. + google.protobuf.Timestamp start_time = 2; + + // The completion time of the onboarding step. + google.protobuf.Timestamp completion_time = 3; + + // Output only. The completion state of the onboarding step. + CompletionState completion_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/customers.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/customers.proto new file mode 100644 index 000000000000..2d1127504f45 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/customers.proto @@ -0,0 +1,138 @@ +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/completion_state.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "CustomersProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// Contains metadata around a Cloud Controls Partner Customer +message Customer { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/Customer" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}" + plural: "customers" + singular: "customer" + }; + + // Identifier. Format: + // organizations/{organization}/locations/{location}/customers/{customer} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The customer organization's display name. E.g. "google.com". + string display_name = 2; + + // Container for customer onboarding steps + CustomerOnboardingState customer_onboarding_state = 3; + + // Indicates whether a customer is fully onboarded + bool is_onboarded = 4; +} + +// Request to list customers +message ListCustomersRequest { + // Required. Parent resource + // Format: organizations/{organization}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/Customer" + } + ]; + + // The maximum number of Customers to return. The service may return fewer + // than this value. If unspecified, at most 500 Customers will be returned. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomers` call. + // Provide this to retrieve the subsequent page. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for list customer Customers requests +message ListCustomersResponse { + // List of customers + repeated Customer customers = 1; + + // A token that 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 customer +message GetCustomerRequest { + // Required. Format: + // organizations/{organization}/locations/{location}/customers/{customer} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Customer" + } + ]; +} + +// Container for customer onboarding steps +message CustomerOnboardingState { + // List of customer onboarding steps + repeated CustomerOnboardingStep onboarding_steps = 1; +} + +// Container for customer onboarding information +message CustomerOnboardingStep { + // Enum for possible onboarding steps + enum Step { + // Unspecified step + STEP_UNSPECIFIED = 0; + + // KAJ Enrollment + KAJ_ENROLLMENT = 1; + + // Customer Environment + CUSTOMER_ENVIRONMENT = 2; + } + + // The onboarding step + Step step = 1; + + // The starting time of the onboarding step + google.protobuf.Timestamp start_time = 2; + + // The completion time of the onboarding step + google.protobuf.Timestamp completion_time = 3; + + // Output only. Current state of the step + CompletionState completion_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto new file mode 100644 index 000000000000..efefa4844bdb --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto @@ -0,0 +1,97 @@ +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "EkmConnectionsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// The EKM connections associated with a workload +message EkmConnections { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/EkmConnections" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections" + }; + + // Identifier. Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The EKM connections associated with the workload + repeated EkmConnection ekm_connections = 2; +} + +// Request for getting the EKM connections associated with a workload +message GetEkmConnectionsRequest { + // Required. Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/ekmConnections + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/EkmConnections" + } + ]; +} + +// Details about the EKM connection +message EkmConnection { + // Information around the error that occurred if the connection state is + // anything other than available or unspecified + message ConnectionError { + // The error domain for the error + string error_domain = 1; + + // The error message for the error + string error_message = 2; + } + + // The EKM connection state. + enum ConnectionState { + // Unspecified EKM connection state + CONNECTION_STATE_UNSPECIFIED = 0; + + // Available EKM connection state + AVAILABLE = 1; + + // Not available EKM connection state + NOT_AVAILABLE = 2; + + // Error EKM connection state + ERROR = 3; + + // Permission denied EKM connection state + PERMISSION_DENIED = 4; + } + + // Resource name of the EKM connection in the format: + // projects/{project}/locations/{location}/ekmConnections/{ekm_connection} + string connection_name = 1; + + // Output only. The connection state + ConnectionState connection_state = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The connection error that occurred if any + ConnectionError connection_error = 3; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/monitoring.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/monitoring.proto new file mode 100644 index 000000000000..1e433f62afe8 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/monitoring.proto @@ -0,0 +1,58 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/cloudcontrolspartner/v1beta/violations.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "MonitoringProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// Service describing handlers for resources +service CloudControlsPartnerMonitoring { + option (google.api.default_host) = "cloudcontrolspartner.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Violations for a workload + // Callers may also choose to read across multiple Customers or for a single + // customer as per + // [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash + // character) as a wildcard character instead of {customer} & {workload}. + // Format: + // `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}` + rpc ListViolations(ListViolationsRequest) returns (ListViolationsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=organizations/*/locations/*/customers/*/workloads/*}/violations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Violation. + rpc GetViolation(GetViolationRequest) returns (Violation) { + option (google.api.http) = { + get: "/v1beta/{name=organizations/*/locations/*/customers/*/workloads/*/violations/*}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto new file mode 100644 index 000000000000..6011b0221bd0 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto @@ -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 +// +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "PartnerPermissionsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// The permissions granted to the partner for a workload +message PartnerPermissions { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/PartnerPermissions" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions" + }; + + enum Permission { + // Unspecified partner permission + PERMISSION_UNSPECIFIED = 0; + + // Permission for Access Transparency and emergency logs + ACCESS_TRANSPARENCY_AND_EMERGENCY_ACCESS_LOGS = 1; + + // Permission for Assured Workloads monitoring violations + ASSURED_WORKLOADS_MONITORING = 2; + + // Permission for Access Approval requests + ACCESS_APPROVAL_REQUESTS = 3; + + // Permission for External Key Manager connection status + ASSURED_WORKLOADS_EKM_CONNECTION_STATUS = 4; + } + + // Identifier. Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The partner permissions granted for the workload + repeated Permission partner_permissions = 2; +} + +// Request for getting the partner permissions granted for a workload +message GetPartnerPermissionsRequest { + // Required. Name of the resource to get in the format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/partnerPermissions + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/PartnerPermissions" + } + ]; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/partners.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/partners.proto new file mode 100644 index 000000000000..6527d9afedc2 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/partners.proto @@ -0,0 +1,120 @@ +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "PartnersProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// Message describing Partner resource +message Partner { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/Partner" + pattern: "organizations/{organization}/locations/{location}/partner" + singular: "partner" + }; + + // Identifier. The resource name of the partner. + // Format: organizations/{organization}/locations/{location}/partner + // Example: "organizations/123456/locations/us-central1/partner" + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // List of SKUs the partner is offering + repeated Sku skus = 3; + + // List of Google Cloud supported EKM partners supported by the partner + repeated EkmMetadata ekm_solutions = 4; + + // List of Google Cloud regions that the partner sells services to customers. + // Valid Google Cloud regions found here: + // https://cloud.google.com/compute/docs/regions-zones + repeated string operated_cloud_regions = 5; + + // Google Cloud project ID in the partner's Google Cloud organization for + // receiving enhanced Logs for Partners. + string partner_project_id = 7; + + // Output only. Time the resource was created + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time the resource was updated + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for getting a Partner +message GetPartnerRequest { + // Required. Format: organizations/{organization}/locations/{location}/partner + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Partner" + } + ]; +} + +// Represents the SKU a partner owns inside Google Cloud to sell to customers. +message Sku { + // Argentum product SKU, that is associated with the partner offerings to + // customers used by Syntro for billing purposes. SKUs can represent resold + // Google products or support services. + string id = 1; + + // Display name of the product identified by the SKU. A partner may want to + // show partner branded names for their offerings such as local sovereign + // cloud solutions. + string display_name = 2; +} + +// Holds information needed by Mudbray to use partner EKMs for workloads. +message EkmMetadata { + // Represents Google Cloud supported external key management partners + // [Google Cloud EKM partners + // docs](https://cloud.google.com/kms/docs/ekm#supported_partners). + enum EkmSolution { + // Unspecified EKM solution + EKM_SOLUTION_UNSPECIFIED = 0; + + // EKM Partner Fortanix + FORTANIX = 1; + + // EKM Partner FutureX + FUTUREX = 2; + + // EKM Partner Thales + THALES = 3; + + // EKM Partner Virtu + VIRTRU = 4; + } + + // The Cloud EKM partner. + EkmSolution ekm_solution = 1; + + // Endpoint for sending requests to the EKM for key provisioning during + // Assured Workload creation. + string ekm_endpoint_uri = 2; +} diff --git a/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/violations.proto b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/violations.proto new file mode 100644 index 000000000000..ea2531cd9df9 --- /dev/null +++ b/java-cloudcontrolspartner/proto-google-cloud-cloudcontrolspartner-v1beta/src/main/proto/google/cloud/cloudcontrolspartner/v1beta/violations.proto @@ -0,0 +1,233 @@ +// 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.cloud.cloudcontrolspartner.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; +option go_package = "cloud.google.com/go/cloudcontrolspartner/apiv1beta/cloudcontrolspartnerpb;cloudcontrolspartnerpb"; +option java_multiple_files = true; +option java_outer_classname = "ViolationsProto"; +option java_package = "com.google.cloud.cloudcontrolspartner.v1beta"; +option php_namespace = "Google\\Cloud\\CloudControlsPartner\\V1beta"; +option ruby_package = "Google::Cloud::CloudControlsPartner::V1beta"; + +// Details of resource Violation +message Violation { + option (google.api.resource) = { + type: "cloudcontrolspartner.googleapis.com/Violation" + pattern: "organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}" + plural: "violations" + singular: "violation" + }; + + // Represents remediation guidance to resolve compliance violation for + // AssuredWorkload + message Remediation { + // Instructions to remediate violation + message Instructions { + // Remediation instructions to resolve violation via gcloud cli + message Gcloud { + // Gcloud command to resolve violation + repeated string gcloud_commands = 1; + + // Steps to resolve violation via gcloud cli + repeated string steps = 2; + + // Additional urls for more information about steps + repeated string additional_links = 3; + } + + // Remediation instructions to resolve violation via cloud console + message Console { + // Link to console page where violations can be resolved + repeated string console_uris = 1; + + // Steps to resolve violation via cloud console + repeated string steps = 2; + + // Additional urls for more information about steps + repeated string additional_links = 3; + } + + // Remediation instructions to resolve violation via gcloud cli + Gcloud gcloud_instructions = 1; + + // Remediation instructions to resolve violation via cloud console + Console console_instructions = 2; + } + + // Classifying remediation into various types based on the kind of + // violation. For example, violations caused due to changes in boolean org + // policy requires different remediation instructions compared to violation + // caused due to changes in allowed values of list org policy. + enum RemediationType { + // Unspecified remediation type + REMEDIATION_TYPE_UNSPECIFIED = 0; + + // Remediation type for boolean org policy + REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + + // Remediation type for list org policy which have allowed values in the + // monitoring rule + REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + + // Remediation type for list org policy which have denied values in the + // monitoring rule + REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + + // Remediation type for gcp.restrictCmekCryptoKeyProjects + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + + // Remediation type for resource violation. + REMEDIATION_RESOURCE_VIOLATION = 5; + } + + // Required. Remediation instructions to resolve violations + Instructions instructions = 1 [(google.api.field_behavior) = REQUIRED]; + + // Values that can resolve the violation + // For example: for list org policy violations, this will either be the list + // of allowed or denied values + repeated string compliant_values = 2; + + // Output only. Remediation type based on the type of org policy values + // violated + RemediationType remediation_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Violation State Values + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Violation is resolved. + RESOLVED = 1; + + // Violation is Unresolved + UNRESOLVED = 2; + + // Violation is Exception + EXCEPTION = 3; + } + + // Identifier. Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Description for the Violation. + // e.g. OrgPolicy gcp.resourceLocations has non compliant value. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time of the event which triggered the Violation. + google.protobuf.Timestamp begin_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time when the Violation record was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time of the event which fixed the Violation. + // If the violation is ACTIVE this will be empty. + google.protobuf.Timestamp resolve_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Category under which this violation is mapped. + // e.g. Location, Service Usage, Access, Encryption, etc. + string category = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the violation + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Immutable. Name of the OrgPolicy which was modified with + // non-compliant change and resulted this violation. Format: + // projects/{project_number}/policies/{constraint_name} + // folders/{folder_id}/policies/{constraint_name} + // organizations/{organization_id}/policies/{constraint_name} + string non_compliant_org_policy = 8 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // The folder_id of the violation + int64 folder_id = 9; + + // Output only. Compliance violation remediation + Remediation remediation = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for requesting list of Violations +message ListViolationsRequest { + // Required. Parent resource + // Format + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/Violation" + } + ]; + + // Optional. The maximum number of customers row to return. The service may + // return fewer than this value. If unspecified, at most 10 customers will be + // returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListViolations` call. + // Provide this to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the interval for retrieving violations. + // if unspecified, all violations will be returned. + google.type.Interval interval = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for list customer violation requests +message ListViolationsResponse { + // List of violation + repeated Violation violations = 1; + + // A token that 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; + + // Workloads that could not be reached due to permission errors or any other + // error. Ref: https://google.aip.dev/217 + repeated string unreachable = 3; +} + +// Message for getting a Violation +message GetViolationRequest { + // Required. Format: + // organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Violation" + } + ]; +} diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..164451bcf711 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreSettings; +import com.google.cloud.cloudcontrolspartner.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings = + CloudControlsPartnerCoreSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_Create_SetCredentialsProvider_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider1.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..cec74492350d --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_Create_SetCredentialsProvider1_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreSettings; + +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 + CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings = + CloudControlsPartnerCoreSettings.newHttpJsonBuilder().build(); + CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_Create_SetCredentialsProvider1_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetEndpoint.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a404ec8fac6f --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_Create_SetEndpoint_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreSettings; +import com.google.cloud.cloudcontrolspartner.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 + CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings = + CloudControlsPartnerCoreSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_Create_SetEndpoint_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/AsyncGetCustomer.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/AsyncGetCustomer.java new file mode 100644 index 000000000000..5e05a10b293f --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/AsyncGetCustomer.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetCustomer_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest; + +public class AsyncGetCustomer { + + public static void main(String[] args) throws Exception { + asyncGetCustomer(); + } + + public static void asyncGetCustomer() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetCustomerRequest request = + GetCustomerRequest.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getCustomerCallable().futureCall(request); + // Do something. + Customer response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetCustomer_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomer.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomer.java new file mode 100644 index 000000000000..fe2156c94c0c --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomer.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetCustomer_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1.GetCustomerRequest; + +public class SyncGetCustomer { + + public static void main(String[] args) throws Exception { + syncGetCustomer(); + } + + public static void syncGetCustomer() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetCustomerRequest request = + GetCustomerRequest.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .build(); + Customer response = cloudControlsPartnerCoreClient.getCustomer(request); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetCustomer_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomerCustomername.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomerCustomername.java new file mode 100644 index 000000000000..5f66638ff35c --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomerCustomername.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetCustomer_Customername_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; + +public class SyncGetCustomerCustomername { + + public static void main(String[] args) throws Exception { + syncGetCustomerCustomername(); + } + + public static void syncGetCustomerCustomername() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + Customer response = cloudControlsPartnerCoreClient.getCustomer(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetCustomer_Customername_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomerString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomerString.java new file mode 100644 index 000000000000..5fc5244458d3 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getcustomer/SyncGetCustomerString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetCustomer_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; + +public class SyncGetCustomerString { + + public static void main(String[] args) throws Exception { + syncGetCustomerString(); + } + + public static void syncGetCustomerString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString(); + Customer response = cloudControlsPartnerCoreClient.getCustomer(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetCustomer_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/AsyncGetEkmConnections.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/AsyncGetEkmConnections.java new file mode 100644 index 000000000000..3a7f19019ecf --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/AsyncGetEkmConnections.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetEkmConnections_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsName; +import com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest; + +public class AsyncGetEkmConnections { + + public static void main(String[] args) throws Exception { + asyncGetEkmConnections(); + } + + public static void asyncGetEkmConnections() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetEkmConnectionsRequest request = + GetEkmConnectionsRequest.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getEkmConnectionsCallable().futureCall(request); + // Do something. + EkmConnections response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetEkmConnections_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnections.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnections.java new file mode 100644 index 000000000000..949b3ad02d5f --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnections.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetEkmConnections_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsName; +import com.google.cloud.cloudcontrolspartner.v1.GetEkmConnectionsRequest; + +public class SyncGetEkmConnections { + + public static void main(String[] args) throws Exception { + syncGetEkmConnections(); + } + + public static void syncGetEkmConnections() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetEkmConnectionsRequest request = + GetEkmConnectionsRequest.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(request); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetEkmConnections_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsEkmconnectionsname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsEkmconnectionsname.java new file mode 100644 index 000000000000..3807e41b3a14 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsEkmconnectionsname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetEkmConnections_Ekmconnectionsname_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsName; + +public class SyncGetEkmConnectionsEkmconnectionsname { + + public static void main(String[] args) throws Exception { + syncGetEkmConnectionsEkmconnectionsname(); + } + + public static void syncGetEkmConnectionsEkmconnectionsname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetEkmConnections_Ekmconnectionsname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsString.java new file mode 100644 index 000000000000..b8e64c442a9c --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetEkmConnections_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1.EkmConnectionsName; + +public class SyncGetEkmConnectionsString { + + public static void main(String[] args) throws Exception { + syncGetEkmConnectionsString(); + } + + public static void syncGetEkmConnectionsString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString(); + EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetEkmConnections_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/AsyncGetPartner.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/AsyncGetPartner.java new file mode 100644 index 000000000000..6483523801da --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/AsyncGetPartner.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartner_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1.Partner; +import com.google.cloud.cloudcontrolspartner.v1.PartnerName; + +public class AsyncGetPartner { + + public static void main(String[] args) throws Exception { + asyncGetPartner(); + } + + public static void asyncGetPartner() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetPartnerRequest request = + GetPartnerRequest.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getPartnerCallable().futureCall(request); + // Do something. + Partner response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartner_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartner.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartner.java new file mode 100644 index 000000000000..2005f2fc4687 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartner.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartner_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1.Partner; +import com.google.cloud.cloudcontrolspartner.v1.PartnerName; + +public class SyncGetPartner { + + public static void main(String[] args) throws Exception { + syncGetPartner(); + } + + public static void syncGetPartner() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetPartnerRequest request = + GetPartnerRequest.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .build(); + Partner response = cloudControlsPartnerCoreClient.getPartner(request); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartner_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartnerPartnername.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartnerPartnername.java new file mode 100644 index 000000000000..278103bbae3d --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartnerPartnername.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartner_Partnername_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Partner; +import com.google.cloud.cloudcontrolspartner.v1.PartnerName; + +public class SyncGetPartnerPartnername { + + public static void main(String[] args) throws Exception { + syncGetPartnerPartnername(); + } + + public static void syncGetPartnerPartnername() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + Partner response = cloudControlsPartnerCoreClient.getPartner(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartner_Partnername_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartnerString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartnerString.java new file mode 100644 index 000000000000..8b25af9aaa94 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartner/SyncGetPartnerString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartner_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Partner; +import com.google.cloud.cloudcontrolspartner.v1.PartnerName; + +public class SyncGetPartnerString { + + public static void main(String[] args) throws Exception { + syncGetPartnerString(); + } + + public static void syncGetPartnerString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString(); + Partner response = cloudControlsPartnerCoreClient.getPartner(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartner_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/AsyncGetPartnerPermissions.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/AsyncGetPartnerPermissions.java new file mode 100644 index 000000000000..f7a4b68ce806 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/AsyncGetPartnerPermissions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartnerPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsName; + +public class AsyncGetPartnerPermissions { + + public static void main(String[] args) throws Exception { + asyncGetPartnerPermissions(); + } + + public static void asyncGetPartnerPermissions() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetPartnerPermissionsRequest request = + GetPartnerPermissionsRequest.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getPartnerPermissionsCallable().futureCall(request); + // Do something. + PartnerPermissions response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartnerPermissions_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissions.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissions.java new file mode 100644 index 000000000000..62c5dca8dba9 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissions.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartnerPermissions_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsName; + +public class SyncGetPartnerPermissions { + + public static void main(String[] args) throws Exception { + syncGetPartnerPermissions(); + } + + public static void syncGetPartnerPermissions() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetPartnerPermissionsRequest request = + GetPartnerPermissionsRequest.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(request); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartnerPermissions_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsPartnerpermissionsname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsPartnerpermissionsname.java new file mode 100644 index 000000000000..768484101000 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsPartnerpermissionsname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartnerPermissions_Partnerpermissionsname_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsName; + +public class SyncGetPartnerPermissionsPartnerpermissionsname { + + public static void main(String[] args) throws Exception { + syncGetPartnerPermissionsPartnerpermissionsname(); + } + + public static void syncGetPartnerPermissionsPartnerpermissionsname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartnerPermissions_Partnerpermissionsname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsString.java new file mode 100644 index 000000000000..8078963b043a --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartnerPermissions_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1.PartnerPermissionsName; + +public class SyncGetPartnerPermissionsString { + + public static void main(String[] args) throws Exception { + syncGetPartnerPermissionsString(); + } + + public static void syncGetPartnerPermissionsString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString(); + PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetPartnerPermissions_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/AsyncGetWorkload.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/AsyncGetWorkload.java new file mode 100644 index 000000000000..5d75fbd8d96e --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/AsyncGetWorkload.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetWorkload_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class AsyncGetWorkload { + + public static void main(String[] args) throws Exception { + asyncGetWorkload(); + } + + public static void asyncGetWorkload() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetWorkloadRequest request = + GetWorkloadRequest.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getWorkloadCallable().futureCall(request); + // Do something. + Workload response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetWorkload_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkload.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkload.java new file mode 100644 index 000000000000..7b11aef81eba --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkload.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetWorkload_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class SyncGetWorkload { + + public static void main(String[] args) throws Exception { + syncGetWorkload(); + } + + public static void syncGetWorkload() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetWorkloadRequest request = + GetWorkloadRequest.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + Workload response = cloudControlsPartnerCoreClient.getWorkload(request); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetWorkload_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkloadString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkloadString.java new file mode 100644 index 000000000000..fb4119e1b9c9 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkloadString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetWorkload_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class SyncGetWorkloadString { + + public static void main(String[] args) throws Exception { + syncGetWorkloadString(); + } + + public static void syncGetWorkloadString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString(); + Workload response = cloudControlsPartnerCoreClient.getWorkload(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetWorkload_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkloadWorkloadname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkloadWorkloadname.java new file mode 100644 index 000000000000..1dee4dfab868 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/getworkload/SyncGetWorkloadWorkloadname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetWorkload_Workloadname_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class SyncGetWorkloadWorkloadname { + + public static void main(String[] args) throws Exception { + syncGetWorkloadWorkloadname(); + } + + public static void syncGetWorkloadWorkloadname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + WorkloadName name = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + Workload response = cloudControlsPartnerCoreClient.getWorkload(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_GetWorkload_Workloadname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequests.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequests.java new file mode 100644 index 000000000000..781a7172cb58 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequests.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class AsyncListAccessApprovalRequests { + + public static void main(String[] args) throws Exception { + asyncListAccessApprovalRequests(); + } + + public static void asyncListAccessApprovalRequests() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient + .listAccessApprovalRequestsPagedCallable() + .futureCall(request); + // Do something. + for (AccessApprovalRequest element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequestsPaged.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequestsPaged.java new file mode 100644 index 000000000000..765afbea7553 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequestsPaged.java @@ -0,0 +1,67 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_Paged_async] +import com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; +import com.google.common.base.Strings; + +public class AsyncListAccessApprovalRequestsPaged { + + public static void main(String[] args) throws Exception { + asyncListAccessApprovalRequestsPaged(); + } + + public static void asyncListAccessApprovalRequestsPaged() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListAccessApprovalRequestsResponse response = + cloudControlsPartnerCoreClient.listAccessApprovalRequestsCallable().call(request); + for (AccessApprovalRequest element : response.getAccessApprovalRequestsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_Paged_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequests.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequests.java new file mode 100644 index 000000000000..517197b36983 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequests.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_sync] +import com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class SyncListAccessApprovalRequests { + + public static void main(String[] args) throws Exception { + syncListAccessApprovalRequests(); + } + + public static void syncListAccessApprovalRequests() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (AccessApprovalRequest element : + cloudControlsPartnerCoreClient.listAccessApprovalRequests(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsString.java new file mode 100644 index 000000000000..d15ea3dd7628 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class SyncListAccessApprovalRequestsString { + + public static void main(String[] args) throws Exception { + syncListAccessApprovalRequestsString(); + } + + public static void syncListAccessApprovalRequestsString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString(); + for (AccessApprovalRequest element : + cloudControlsPartnerCoreClient.listAccessApprovalRequests(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsWorkloadname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsWorkloadname.java new file mode 100644 index 000000000000..592733f6c9e1 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsWorkloadname.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_Workloadname_sync] +import com.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class SyncListAccessApprovalRequestsWorkloadname { + + public static void main(String[] args) throws Exception { + syncListAccessApprovalRequestsWorkloadname(); + } + + public static void syncListAccessApprovalRequestsWorkloadname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + for (AccessApprovalRequest element : + cloudControlsPartnerCoreClient.listAccessApprovalRequests(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_Workloadname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/AsyncListCustomers.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/AsyncListCustomers.java new file mode 100644 index 000000000000..2ec4d4861f3e --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/AsyncListCustomers.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1.OrganizationLocationName; + +public class AsyncListCustomers { + + public static void main(String[] args) throws Exception { + asyncListCustomers(); + } + + public static void asyncListCustomers() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListCustomersRequest request = + ListCustomersRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.listCustomersPagedCallable().futureCall(request); + // Do something. + for (Customer element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/AsyncListCustomersPaged.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/AsyncListCustomersPaged.java new file mode 100644 index 000000000000..e7b0164d807f --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/AsyncListCustomersPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_Paged_async] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1.OrganizationLocationName; +import com.google.common.base.Strings; + +public class AsyncListCustomersPaged { + + public static void main(String[] args) throws Exception { + asyncListCustomersPaged(); + } + + public static void asyncListCustomersPaged() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListCustomersRequest request = + ListCustomersRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListCustomersResponse response = + cloudControlsPartnerCoreClient.listCustomersCallable().call(request); + for (Customer element : response.getCustomersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_Paged_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomers.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomers.java new file mode 100644 index 000000000000..125fc0b94dfa --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomers.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1.OrganizationLocationName; + +public class SyncListCustomers { + + public static void main(String[] args) throws Exception { + syncListCustomers(); + } + + public static void syncListCustomers() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListCustomersRequest request = + ListCustomersRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Customer element : cloudControlsPartnerCoreClient.listCustomers(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomersOrganizationlocationname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomersOrganizationlocationname.java new file mode 100644 index 000000000000..d6d7231cd2d0 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomersOrganizationlocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_Organizationlocationname_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.OrganizationLocationName; + +public class SyncListCustomersOrganizationlocationname { + + public static void main(String[] args) throws Exception { + syncListCustomersOrganizationlocationname(); + } + + public static void syncListCustomersOrganizationlocationname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + for (Customer element : cloudControlsPartnerCoreClient.listCustomers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_Organizationlocationname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomersString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomersString.java new file mode 100644 index 000000000000..28cd73816e47 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listcustomers/SyncListCustomersString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.Customer; +import com.google.cloud.cloudcontrolspartner.v1.OrganizationLocationName; + +public class SyncListCustomersString { + + public static void main(String[] args) throws Exception { + syncListCustomersString(); + } + + public static void syncListCustomersString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + for (Customer element : cloudControlsPartnerCoreClient.listCustomers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListCustomers_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/AsyncListWorkloads.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/AsyncListWorkloads.java new file mode 100644 index 000000000000..6feb1b5beac5 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/AsyncListWorkloads.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1.Workload; + +public class AsyncListWorkloads { + + public static void main(String[] args) throws Exception { + asyncListWorkloads(); + } + + public static void asyncListWorkloads() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.listWorkloadsPagedCallable().futureCall(request); + // Do something. + for (Workload element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/AsyncListWorkloadsPaged.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/AsyncListWorkloadsPaged.java new file mode 100644 index 000000000000..5390565de52c --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/AsyncListWorkloadsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_Paged_async] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Workload; +import com.google.common.base.Strings; + +public class AsyncListWorkloadsPaged { + + public static void main(String[] args) throws Exception { + asyncListWorkloadsPaged(); + } + + public static void asyncListWorkloadsPaged() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListWorkloadsResponse response = + cloudControlsPartnerCoreClient.listWorkloadsCallable().call(request); + for (Workload element : response.getWorkloadsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_Paged_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloads.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloads.java new file mode 100644 index 000000000000..e77cbf202549 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloads.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1.Workload; + +public class SyncListWorkloads { + + public static void main(String[] args) throws Exception { + syncListWorkloads(); + } + + public static void syncListWorkloads() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsCustomername.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsCustomername.java new file mode 100644 index 000000000000..80c477d5e59c --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsCustomername.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_Customername_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1.Workload; + +public class SyncListWorkloadsCustomername { + + public static void main(String[] args) throws Exception { + syncListWorkloadsCustomername(); + } + + public static void syncListWorkloadsCustomername() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_Customername_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsString.java new file mode 100644 index 000000000000..4f01c69bc7ae --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1.Workload; + +public class SyncListWorkloadsString { + + public static void main(String[] args) throws Exception { + syncListWorkloadsString(); + } + + public static void syncListWorkloadsString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString(); + for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCore_ListWorkloads_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercoresettings/getworkload/SyncGetWorkload.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercoresettings/getworkload/SyncGetWorkload.java new file mode 100644 index 000000000000..17884ca2a977 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnercoresettings/getworkload/SyncGetWorkload.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCoreSettings_GetWorkload_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerCoreSettings; +import java.time.Duration; + +public class SyncGetWorkload { + + public static void main(String[] args) throws Exception { + syncGetWorkload(); + } + + public static void syncGetWorkload() 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 + CloudControlsPartnerCoreSettings.Builder cloudControlsPartnerCoreSettingsBuilder = + CloudControlsPartnerCoreSettings.newBuilder(); + cloudControlsPartnerCoreSettingsBuilder + .getWorkloadSettings() + .setRetrySettings( + cloudControlsPartnerCoreSettingsBuilder + .getWorkloadSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings = + cloudControlsPartnerCoreSettingsBuilder.build(); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCoreSettings_GetWorkload_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..ba288d509b10 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringSettings; +import com.google.cloud.cloudcontrolspartner.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings = + CloudControlsPartnerMonitoringSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_Create_SetCredentialsProvider_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider1.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..c1881d34c1fe --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_Create_SetCredentialsProvider1_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringSettings; + +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 + CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings = + CloudControlsPartnerMonitoringSettings.newHttpJsonBuilder().build(); + CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_Create_SetCredentialsProvider1_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetEndpoint.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..85718f3b139d --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_Create_SetEndpoint_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringSettings; +import com.google.cloud.cloudcontrolspartner.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 + CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings = + CloudControlsPartnerMonitoringSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_Create_SetEndpoint_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/AsyncGetViolation.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/AsyncGetViolation.java new file mode 100644 index 000000000000..c367d30ff58f --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/AsyncGetViolation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_GetViolation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.ViolationName; + +public class AsyncGetViolation { + + public static void main(String[] args) throws Exception { + asyncGetViolation(); + } + + public static void asyncGetViolation() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + GetViolationRequest request = + GetViolationRequest.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .build(); + ApiFuture future = + cloudControlsPartnerMonitoringClient.getViolationCallable().futureCall(request); + // Do something. + Violation response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_GetViolation_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolation.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolation.java new file mode 100644 index 000000000000..39f24637c657 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_GetViolation_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.ViolationName; + +public class SyncGetViolation { + + public static void main(String[] args) throws Exception { + syncGetViolation(); + } + + public static void syncGetViolation() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + GetViolationRequest request = + GetViolationRequest.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .build(); + Violation response = cloudControlsPartnerMonitoringClient.getViolation(request); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_GetViolation_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationString.java new file mode 100644 index 000000000000..08ea8697b345 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_GetViolation_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.ViolationName; + +public class SyncGetViolationString { + + public static void main(String[] args) throws Exception { + syncGetViolationString(); + } + + public static void syncGetViolationString() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + String name = + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString(); + Violation response = cloudControlsPartnerMonitoringClient.getViolation(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_GetViolation_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationViolationname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationViolationname.java new file mode 100644 index 000000000000..ee3a06df7936 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationViolationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_GetViolation_Violationname_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.ViolationName; + +public class SyncGetViolationViolationname { + + public static void main(String[] args) throws Exception { + syncGetViolationViolationname(); + } + + public static void syncGetViolationViolationname() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + ViolationName name = + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + Violation response = cloudControlsPartnerMonitoringClient.getViolation(name); + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_GetViolation_Violationname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/AsyncListViolations.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/AsyncListViolations.java new file mode 100644 index 000000000000..affc39170921 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/AsyncListViolations.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; +import com.google.type.Interval; + +public class AsyncListViolations { + + public static void main(String[] args) throws Exception { + asyncListViolations(); + } + + public static void asyncListViolations() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setInterval(Interval.newBuilder().build()) + .build(); + ApiFuture future = + cloudControlsPartnerMonitoringClient.listViolationsPagedCallable().futureCall(request); + // Do something. + for (Violation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/AsyncListViolationsPaged.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/AsyncListViolationsPaged.java new file mode 100644 index 000000000000..dac5c41952c4 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/AsyncListViolationsPaged.java @@ -0,0 +1,69 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_Paged_async] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; +import com.google.common.base.Strings; +import com.google.type.Interval; + +public class AsyncListViolationsPaged { + + public static void main(String[] args) throws Exception { + asyncListViolationsPaged(); + } + + public static void asyncListViolationsPaged() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setInterval(Interval.newBuilder().build()) + .build(); + while (true) { + ListViolationsResponse response = + cloudControlsPartnerMonitoringClient.listViolationsCallable().call(request); + for (Violation element : response.getViolationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_Paged_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolations.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolations.java new file mode 100644 index 000000000000..40f7a00dbf82 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolations.java @@ -0,0 +1,58 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; +import com.google.type.Interval; + +public class SyncListViolations { + + public static void main(String[] args) throws Exception { + syncListViolations(); + } + + public static void syncListViolations() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setInterval(Interval.newBuilder().build()) + .build(); + for (Violation element : + cloudControlsPartnerMonitoringClient.listViolations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsString.java new file mode 100644 index 000000000000..8376714d6a52 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_String_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class SyncListViolationsString { + + public static void main(String[] args) throws Exception { + syncListViolationsString(); + } + + public static void syncListViolationsString() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + String parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString(); + for (Violation element : + cloudControlsPartnerMonitoringClient.listViolations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsWorkloadname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsWorkloadname.java new file mode 100644 index 000000000000..5707f3f21992 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsWorkloadname.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_Workloadname_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1.Violation; +import com.google.cloud.cloudcontrolspartner.v1.WorkloadName; + +public class SyncListViolationsWorkloadname { + + public static void main(String[] args) throws Exception { + syncListViolationsWorkloadname(); + } + + public static void syncListViolationsWorkloadname() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + for (Violation element : + cloudControlsPartnerMonitoringClient.listViolations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoring_ListViolations_Workloadname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoringsettings/getviolation/SyncGetViolation.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoringsettings/getviolation/SyncGetViolation.java new file mode 100644 index 000000000000..ce0d93e70487 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/cloudcontrolspartnermonitoringsettings/getviolation/SyncGetViolation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoringSettings_GetViolation_sync] +import com.google.cloud.cloudcontrolspartner.v1.CloudControlsPartnerMonitoringSettings; +import java.time.Duration; + +public class SyncGetViolation { + + public static void main(String[] args) throws Exception { + syncGetViolation(); + } + + public static void syncGetViolation() 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 + CloudControlsPartnerMonitoringSettings.Builder cloudControlsPartnerMonitoringSettingsBuilder = + CloudControlsPartnerMonitoringSettings.newBuilder(); + cloudControlsPartnerMonitoringSettingsBuilder + .getViolationSettings() + .setRetrySettings( + cloudControlsPartnerMonitoringSettingsBuilder + .getViolationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings = + cloudControlsPartnerMonitoringSettingsBuilder.build(); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoringSettings_GetViolation_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/stub/cloudcontrolspartnercorestubsettings/getworkload/SyncGetWorkload.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/stub/cloudcontrolspartnercorestubsettings/getworkload/SyncGetWorkload.java new file mode 100644 index 000000000000..a061a796da8f --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/stub/cloudcontrolspartnercorestubsettings/getworkload/SyncGetWorkload.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerCoreStubSettings_GetWorkload_sync] +import com.google.cloud.cloudcontrolspartner.v1.stub.CloudControlsPartnerCoreStubSettings; +import java.time.Duration; + +public class SyncGetWorkload { + + public static void main(String[] args) throws Exception { + syncGetWorkload(); + } + + public static void syncGetWorkload() 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 + CloudControlsPartnerCoreStubSettings.Builder cloudControlsPartnerCoreSettingsBuilder = + CloudControlsPartnerCoreStubSettings.newBuilder(); + cloudControlsPartnerCoreSettingsBuilder + .getWorkloadSettings() + .setRetrySettings( + cloudControlsPartnerCoreSettingsBuilder + .getWorkloadSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudControlsPartnerCoreStubSettings cloudControlsPartnerCoreSettings = + cloudControlsPartnerCoreSettingsBuilder.build(); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerCoreStubSettings_GetWorkload_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/stub/cloudcontrolspartnermonitoringstubsettings/getviolation/SyncGetViolation.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/stub/cloudcontrolspartnermonitoringstubsettings/getviolation/SyncGetViolation.java new file mode 100644 index 000000000000..bdd0a568ac51 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1/stub/cloudcontrolspartnermonitoringstubsettings/getviolation/SyncGetViolation.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1.stub.samples; + +// [START cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoringStubSettings_GetViolation_sync] +import com.google.cloud.cloudcontrolspartner.v1.stub.CloudControlsPartnerMonitoringStubSettings; +import java.time.Duration; + +public class SyncGetViolation { + + public static void main(String[] args) throws Exception { + syncGetViolation(); + } + + public static void syncGetViolation() 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 + CloudControlsPartnerMonitoringStubSettings.Builder + cloudControlsPartnerMonitoringSettingsBuilder = + CloudControlsPartnerMonitoringStubSettings.newBuilder(); + cloudControlsPartnerMonitoringSettingsBuilder + .getViolationSettings() + .setRetrySettings( + cloudControlsPartnerMonitoringSettingsBuilder + .getViolationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudControlsPartnerMonitoringStubSettings cloudControlsPartnerMonitoringSettings = + cloudControlsPartnerMonitoringSettingsBuilder.build(); + } +} +// [END cloudcontrolspartner_v1_generated_CloudControlsPartnerMonitoringStubSettings_GetViolation_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..f37a487afb86 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreSettings; +import com.google.cloud.cloudcontrolspartner.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings = + CloudControlsPartnerCoreSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_Create_SetCredentialsProvider_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider1.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..e0a7cc730202 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_Create_SetCredentialsProvider1_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreSettings; + +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 + CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings = + CloudControlsPartnerCoreSettings.newHttpJsonBuilder().build(); + CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_Create_SetCredentialsProvider1_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetEndpoint.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..b24f9e87699a --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_Create_SetEndpoint_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreSettings; +import com.google.cloud.cloudcontrolspartner.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings = + CloudControlsPartnerCoreSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create(cloudControlsPartnerCoreSettings); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_Create_SetEndpoint_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/AsyncGetCustomer.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/AsyncGetCustomer.java new file mode 100644 index 000000000000..3e4b0adf0927 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/AsyncGetCustomer.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetCustomer_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest; + +public class AsyncGetCustomer { + + public static void main(String[] args) throws Exception { + asyncGetCustomer(); + } + + public static void asyncGetCustomer() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetCustomerRequest request = + GetCustomerRequest.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getCustomerCallable().futureCall(request); + // Do something. + Customer response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetCustomer_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomer.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomer.java new file mode 100644 index 000000000000..535cd514144c --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomer.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetCustomer_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1beta.GetCustomerRequest; + +public class SyncGetCustomer { + + public static void main(String[] args) throws Exception { + syncGetCustomer(); + } + + public static void syncGetCustomer() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetCustomerRequest request = + GetCustomerRequest.newBuilder() + .setName(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .build(); + Customer response = cloudControlsPartnerCoreClient.getCustomer(request); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetCustomer_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomerCustomername.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomerCustomername.java new file mode 100644 index 000000000000..f1c120170073 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomerCustomername.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetCustomer_Customername_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; + +public class SyncGetCustomerCustomername { + + public static void main(String[] args) throws Exception { + syncGetCustomerCustomername(); + } + + public static void syncGetCustomerCustomername() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + CustomerName name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + Customer response = cloudControlsPartnerCoreClient.getCustomer(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetCustomer_Customername_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomerString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomerString.java new file mode 100644 index 000000000000..7a7803d1df51 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getcustomer/SyncGetCustomerString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetCustomer_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; + +public class SyncGetCustomerString { + + public static void main(String[] args) throws Exception { + syncGetCustomerString(); + } + + public static void syncGetCustomerString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString(); + Customer response = cloudControlsPartnerCoreClient.getCustomer(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetCustomer_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/AsyncGetEkmConnections.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/AsyncGetEkmConnections.java new file mode 100644 index 000000000000..0c34e5c2a849 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/AsyncGetEkmConnections.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetEkmConnections_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsName; +import com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest; + +public class AsyncGetEkmConnections { + + public static void main(String[] args) throws Exception { + asyncGetEkmConnections(); + } + + public static void asyncGetEkmConnections() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetEkmConnectionsRequest request = + GetEkmConnectionsRequest.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getEkmConnectionsCallable().futureCall(request); + // Do something. + EkmConnections response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetEkmConnections_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnections.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnections.java new file mode 100644 index 000000000000..104d52f20982 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnections.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetEkmConnections_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsName; +import com.google.cloud.cloudcontrolspartner.v1beta.GetEkmConnectionsRequest; + +public class SyncGetEkmConnections { + + public static void main(String[] args) throws Exception { + syncGetEkmConnections(); + } + + public static void syncGetEkmConnections() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetEkmConnectionsRequest request = + GetEkmConnectionsRequest.newBuilder() + .setName( + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(request); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetEkmConnections_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsEkmconnectionsname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsEkmconnectionsname.java new file mode 100644 index 000000000000..4627ad31d61d --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsEkmconnectionsname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetEkmConnections_Ekmconnectionsname_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsName; + +public class SyncGetEkmConnectionsEkmconnectionsname { + + public static void main(String[] args) throws Exception { + syncGetEkmConnectionsEkmconnectionsname(); + } + + public static void syncGetEkmConnectionsEkmconnectionsname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + EkmConnectionsName name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetEkmConnections_Ekmconnectionsname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsString.java new file mode 100644 index 000000000000..2c65d7554bf9 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getekmconnections/SyncGetEkmConnectionsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetEkmConnections_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnections; +import com.google.cloud.cloudcontrolspartner.v1beta.EkmConnectionsName; + +public class SyncGetEkmConnectionsString { + + public static void main(String[] args) throws Exception { + syncGetEkmConnectionsString(); + } + + public static void syncGetEkmConnectionsString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = + EkmConnectionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString(); + EkmConnections response = cloudControlsPartnerCoreClient.getEkmConnections(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetEkmConnections_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/AsyncGetPartner.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/AsyncGetPartner.java new file mode 100644 index 000000000000..d96195ed1323 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/AsyncGetPartner.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartner_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Partner; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerName; + +public class AsyncGetPartner { + + public static void main(String[] args) throws Exception { + asyncGetPartner(); + } + + public static void asyncGetPartner() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetPartnerRequest request = + GetPartnerRequest.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getPartnerCallable().futureCall(request); + // Do something. + Partner response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartner_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartner.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartner.java new file mode 100644 index 000000000000..238e6e08204b --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartner.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartner_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Partner; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerName; + +public class SyncGetPartner { + + public static void main(String[] args) throws Exception { + syncGetPartner(); + } + + public static void syncGetPartner() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetPartnerRequest request = + GetPartnerRequest.newBuilder() + .setName(PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .build(); + Partner response = cloudControlsPartnerCoreClient.getPartner(request); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartner_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartnerPartnername.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartnerPartnername.java new file mode 100644 index 000000000000..0b5efee7de47 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartnerPartnername.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartner_Partnername_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Partner; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerName; + +public class SyncGetPartnerPartnername { + + public static void main(String[] args) throws Exception { + syncGetPartnerPartnername(); + } + + public static void syncGetPartnerPartnername() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + PartnerName name = PartnerName.of("[ORGANIZATION]", "[LOCATION]"); + Partner response = cloudControlsPartnerCoreClient.getPartner(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartner_Partnername_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartnerString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartnerString.java new file mode 100644 index 000000000000..ec4fc90e5e83 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartner/SyncGetPartnerString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartner_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Partner; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerName; + +public class SyncGetPartnerString { + + public static void main(String[] args) throws Exception { + syncGetPartnerString(); + } + + public static void syncGetPartnerString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = PartnerName.of("[ORGANIZATION]", "[LOCATION]").toString(); + Partner response = cloudControlsPartnerCoreClient.getPartner(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartner_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/AsyncGetPartnerPermissions.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/AsyncGetPartnerPermissions.java new file mode 100644 index 000000000000..6d92008d2ba3 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/AsyncGetPartnerPermissions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartnerPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsName; + +public class AsyncGetPartnerPermissions { + + public static void main(String[] args) throws Exception { + asyncGetPartnerPermissions(); + } + + public static void asyncGetPartnerPermissions() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetPartnerPermissionsRequest request = + GetPartnerPermissionsRequest.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getPartnerPermissionsCallable().futureCall(request); + // Do something. + PartnerPermissions response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartnerPermissions_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissions.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissions.java new file mode 100644 index 000000000000..ad919773a100 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissions.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartnerPermissions_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.GetPartnerPermissionsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsName; + +public class SyncGetPartnerPermissions { + + public static void main(String[] args) throws Exception { + syncGetPartnerPermissions(); + } + + public static void syncGetPartnerPermissions() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetPartnerPermissionsRequest request = + GetPartnerPermissionsRequest.newBuilder() + .setName( + PartnerPermissionsName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(request); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartnerPermissions_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsPartnerpermissionsname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsPartnerpermissionsname.java new file mode 100644 index 000000000000..1b61377679f5 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsPartnerpermissionsname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartnerPermissions_Partnerpermissionsname_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsName; + +public class SyncGetPartnerPermissionsPartnerpermissionsname { + + public static void main(String[] args) throws Exception { + syncGetPartnerPermissionsPartnerpermissionsname(); + } + + public static void syncGetPartnerPermissionsPartnerpermissionsname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + PartnerPermissionsName name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartnerPermissions_Partnerpermissionsname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsString.java new file mode 100644 index 000000000000..53cecd4a14fa --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getpartnerpermissions/SyncGetPartnerPermissionsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartnerPermissions_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions; +import com.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissionsName; + +public class SyncGetPartnerPermissionsString { + + public static void main(String[] args) throws Exception { + syncGetPartnerPermissionsString(); + } + + public static void syncGetPartnerPermissionsString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = + PartnerPermissionsName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString(); + PartnerPermissions response = cloudControlsPartnerCoreClient.getPartnerPermissions(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetPartnerPermissions_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/AsyncGetWorkload.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/AsyncGetWorkload.java new file mode 100644 index 000000000000..510e680c8a57 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/AsyncGetWorkload.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetWorkload_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class AsyncGetWorkload { + + public static void main(String[] args) throws Exception { + asyncGetWorkload(); + } + + public static void asyncGetWorkload() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetWorkloadRequest request = + GetWorkloadRequest.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.getWorkloadCallable().futureCall(request); + // Do something. + Workload response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetWorkload_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkload.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkload.java new file mode 100644 index 000000000000..8ffdd4a5085d --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkload.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetWorkload_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.GetWorkloadRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class SyncGetWorkload { + + public static void main(String[] args) throws Exception { + syncGetWorkload(); + } + + public static void syncGetWorkload() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + GetWorkloadRequest request = + GetWorkloadRequest.newBuilder() + .setName( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .build(); + Workload response = cloudControlsPartnerCoreClient.getWorkload(request); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetWorkload_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkloadString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkloadString.java new file mode 100644 index 000000000000..8e274c3ae0bc --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkloadString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetWorkload_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class SyncGetWorkloadString { + + public static void main(String[] args) throws Exception { + syncGetWorkloadString(); + } + + public static void syncGetWorkloadString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String name = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString(); + Workload response = cloudControlsPartnerCoreClient.getWorkload(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetWorkload_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkloadWorkloadname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkloadWorkloadname.java new file mode 100644 index 000000000000..75e7cdfe4959 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/getworkload/SyncGetWorkloadWorkloadname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetWorkload_Workloadname_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class SyncGetWorkloadWorkloadname { + + public static void main(String[] args) throws Exception { + syncGetWorkloadWorkloadname(); + } + + public static void syncGetWorkloadWorkloadname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + WorkloadName name = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + Workload response = cloudControlsPartnerCoreClient.getWorkload(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_GetWorkload_Workloadname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequests.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequests.java new file mode 100644 index 000000000000..921095770dca --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequests.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class AsyncListAccessApprovalRequests { + + public static void main(String[] args) throws Exception { + asyncListAccessApprovalRequests(); + } + + public static void asyncListAccessApprovalRequests() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient + .listAccessApprovalRequestsPagedCallable() + .futureCall(request); + // Do something. + for (AccessApprovalRequest element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequestsPaged.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequestsPaged.java new file mode 100644 index 000000000000..b06873bc5673 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/AsyncListAccessApprovalRequestsPaged.java @@ -0,0 +1,67 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_Paged_async] +import com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; +import com.google.common.base.Strings; + +public class AsyncListAccessApprovalRequestsPaged { + + public static void main(String[] args) throws Exception { + asyncListAccessApprovalRequestsPaged(); + } + + public static void asyncListAccessApprovalRequestsPaged() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListAccessApprovalRequestsResponse response = + cloudControlsPartnerCoreClient.listAccessApprovalRequestsCallable().call(request); + for (AccessApprovalRequest element : response.getAccessApprovalRequestsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_Paged_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequests.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequests.java new file mode 100644 index 000000000000..faded5e89b8c --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequests.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.ListAccessApprovalRequestsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class SyncListAccessApprovalRequests { + + public static void main(String[] args) throws Exception { + syncListAccessApprovalRequests(); + } + + public static void syncListAccessApprovalRequests() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListAccessApprovalRequestsRequest request = + ListAccessApprovalRequestsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (AccessApprovalRequest element : + cloudControlsPartnerCoreClient.listAccessApprovalRequests(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsString.java new file mode 100644 index 000000000000..7e51ca12cdaf --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class SyncListAccessApprovalRequestsString { + + public static void main(String[] args) throws Exception { + syncListAccessApprovalRequestsString(); + } + + public static void syncListAccessApprovalRequestsString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString(); + for (AccessApprovalRequest element : + cloudControlsPartnerCoreClient.listAccessApprovalRequests(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsWorkloadname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsWorkloadname.java new file mode 100644 index 000000000000..6ddb32041761 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listaccessapprovalrequests/SyncListAccessApprovalRequestsWorkloadname.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_Workloadname_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class SyncListAccessApprovalRequestsWorkloadname { + + public static void main(String[] args) throws Exception { + syncListAccessApprovalRequestsWorkloadname(); + } + + public static void syncListAccessApprovalRequestsWorkloadname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + for (AccessApprovalRequest element : + cloudControlsPartnerCoreClient.listAccessApprovalRequests(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListAccessApprovalRequests_Workloadname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/AsyncListCustomers.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/AsyncListCustomers.java new file mode 100644 index 000000000000..41f4d9936335 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/AsyncListCustomers.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.OrganizationLocationName; + +public class AsyncListCustomers { + + public static void main(String[] args) throws Exception { + asyncListCustomers(); + } + + public static void asyncListCustomers() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListCustomersRequest request = + ListCustomersRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.listCustomersPagedCallable().futureCall(request); + // Do something. + for (Customer element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/AsyncListCustomersPaged.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/AsyncListCustomersPaged.java new file mode 100644 index 000000000000..aa907ca1ff3f --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/AsyncListCustomersPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_Paged_async] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.OrganizationLocationName; +import com.google.common.base.Strings; + +public class AsyncListCustomersPaged { + + public static void main(String[] args) throws Exception { + asyncListCustomersPaged(); + } + + public static void asyncListCustomersPaged() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListCustomersRequest request = + ListCustomersRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListCustomersResponse response = + cloudControlsPartnerCoreClient.listCustomersCallable().call(request); + for (Customer element : response.getCustomersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_Paged_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomers.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomers.java new file mode 100644 index 000000000000..6c16579a9816 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomers.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.ListCustomersRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.OrganizationLocationName; + +public class SyncListCustomers { + + public static void main(String[] args) throws Exception { + syncListCustomers(); + } + + public static void syncListCustomers() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListCustomersRequest request = + ListCustomersRequest.newBuilder() + .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Customer element : cloudControlsPartnerCoreClient.listCustomers(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomersOrganizationlocationname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomersOrganizationlocationname.java new file mode 100644 index 000000000000..2235f408dc1b --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomersOrganizationlocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_Organizationlocationname_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.OrganizationLocationName; + +public class SyncListCustomersOrganizationlocationname { + + public static void main(String[] args) throws Exception { + syncListCustomersOrganizationlocationname(); + } + + public static void syncListCustomersOrganizationlocationname() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + for (Customer element : cloudControlsPartnerCoreClient.listCustomers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_Organizationlocationname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomersString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomersString.java new file mode 100644 index 000000000000..293d5dca69bf --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listcustomers/SyncListCustomersString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Customer; +import com.google.cloud.cloudcontrolspartner.v1beta.OrganizationLocationName; + +public class SyncListCustomersString { + + public static void main(String[] args) throws Exception { + syncListCustomersString(); + } + + public static void syncListCustomersString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + for (Customer element : cloudControlsPartnerCoreClient.listCustomers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListCustomers_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/AsyncListWorkloads.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/AsyncListWorkloads.java new file mode 100644 index 000000000000..e2a8a8c98196 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/AsyncListWorkloads.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; + +public class AsyncListWorkloads { + + public static void main(String[] args) throws Exception { + asyncListWorkloads(); + } + + public static void asyncListWorkloads() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + cloudControlsPartnerCoreClient.listWorkloadsPagedCallable().futureCall(request); + // Do something. + for (Workload element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/AsyncListWorkloadsPaged.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/AsyncListWorkloadsPaged.java new file mode 100644 index 000000000000..efc686c6fb4c --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/AsyncListWorkloadsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_Paged_async] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; +import com.google.common.base.Strings; + +public class AsyncListWorkloadsPaged { + + public static void main(String[] args) throws Exception { + asyncListWorkloadsPaged(); + } + + public static void asyncListWorkloadsPaged() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListWorkloadsResponse response = + cloudControlsPartnerCoreClient.listWorkloadsCallable().call(request); + for (Workload element : response.getWorkloadsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_Paged_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloads.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloads.java new file mode 100644 index 000000000000..e56bef68abd3 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloads.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1beta.ListWorkloadsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; + +public class SyncListWorkloads { + + public static void main(String[] args) throws Exception { + syncListWorkloads(); + } + + public static void syncListWorkloads() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + ListWorkloadsRequest request = + ListWorkloadsRequest.newBuilder() + .setParent(CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsCustomername.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsCustomername.java new file mode 100644 index 000000000000..5a773a2b02da --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsCustomername.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_Customername_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; + +public class SyncListWorkloadsCustomername { + + public static void main(String[] args) throws Exception { + syncListWorkloadsCustomername(); + } + + public static void syncListWorkloadsCustomername() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + CustomerName parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]"); + for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_Customername_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsString.java new file mode 100644 index 000000000000..bdde645cd4d3 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercore/listworkloads/SyncListWorkloadsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CustomerName; +import com.google.cloud.cloudcontrolspartner.v1beta.Workload; + +public class SyncListWorkloadsString { + + public static void main(String[] args) throws Exception { + syncListWorkloadsString(); + } + + public static void syncListWorkloadsString() 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 (CloudControlsPartnerCoreClient cloudControlsPartnerCoreClient = + CloudControlsPartnerCoreClient.create()) { + String parent = CustomerName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]").toString(); + for (Workload element : cloudControlsPartnerCoreClient.listWorkloads(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_ListWorkloads_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercoresettings/getworkload/SyncGetWorkload.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercoresettings/getworkload/SyncGetWorkload.java new file mode 100644 index 000000000000..75136c0605b2 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnercoresettings/getworkload/SyncGetWorkload.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCoreSettings_GetWorkload_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreSettings; +import java.time.Duration; + +public class SyncGetWorkload { + + public static void main(String[] args) throws Exception { + syncGetWorkload(); + } + + public static void syncGetWorkload() 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 + CloudControlsPartnerCoreSettings.Builder cloudControlsPartnerCoreSettingsBuilder = + CloudControlsPartnerCoreSettings.newBuilder(); + cloudControlsPartnerCoreSettingsBuilder + .getWorkloadSettings() + .setRetrySettings( + cloudControlsPartnerCoreSettingsBuilder + .getWorkloadSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudControlsPartnerCoreSettings cloudControlsPartnerCoreSettings = + cloudControlsPartnerCoreSettingsBuilder.build(); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCoreSettings_GetWorkload_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..7d26d8680e89 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringSettings; +import com.google.cloud.cloudcontrolspartner.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings = + CloudControlsPartnerMonitoringSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_Create_SetCredentialsProvider_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider1.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..e5d431dfb9ce --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_Create_SetCredentialsProvider1_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringSettings; + +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 + CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings = + CloudControlsPartnerMonitoringSettings.newHttpJsonBuilder().build(); + CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_Create_SetCredentialsProvider1_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetEndpoint.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..59ac3de2e39d --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_Create_SetEndpoint_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringSettings; +import com.google.cloud.cloudcontrolspartner.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings = + CloudControlsPartnerMonitoringSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create(cloudControlsPartnerMonitoringSettings); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_Create_SetEndpoint_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/AsyncGetViolation.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/AsyncGetViolation.java new file mode 100644 index 000000000000..3707631b45d0 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/AsyncGetViolation.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_GetViolation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.ViolationName; + +public class AsyncGetViolation { + + public static void main(String[] args) throws Exception { + asyncGetViolation(); + } + + public static void asyncGetViolation() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + GetViolationRequest request = + GetViolationRequest.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .build(); + ApiFuture future = + cloudControlsPartnerMonitoringClient.getViolationCallable().futureCall(request); + // Do something. + Violation response = future.get(); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_GetViolation_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolation.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolation.java new file mode 100644 index 000000000000..573330ca484e --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_GetViolation_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.GetViolationRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.ViolationName; + +public class SyncGetViolation { + + public static void main(String[] args) throws Exception { + syncGetViolation(); + } + + public static void syncGetViolation() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + GetViolationRequest request = + GetViolationRequest.newBuilder() + .setName( + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString()) + .build(); + Violation response = cloudControlsPartnerMonitoringClient.getViolation(request); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_GetViolation_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationString.java new file mode 100644 index 000000000000..8c203bc8015f --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_GetViolation_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.ViolationName; + +public class SyncGetViolationString { + + public static void main(String[] args) throws Exception { + syncGetViolationString(); + } + + public static void syncGetViolationString() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + String name = + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]") + .toString(); + Violation response = cloudControlsPartnerMonitoringClient.getViolation(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_GetViolation_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationViolationname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationViolationname.java new file mode 100644 index 000000000000..3c826993a767 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/getviolation/SyncGetViolationViolationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_GetViolation_Violationname_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.ViolationName; + +public class SyncGetViolationViolationname { + + public static void main(String[] args) throws Exception { + syncGetViolationViolationname(); + } + + public static void syncGetViolationViolationname() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + ViolationName name = + ViolationName.of( + "[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]", "[VIOLATION]"); + Violation response = cloudControlsPartnerMonitoringClient.getViolation(name); + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_GetViolation_Violationname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/AsyncListViolations.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/AsyncListViolations.java new file mode 100644 index 000000000000..19fe1c6b66aa --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/AsyncListViolations.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; +import com.google.type.Interval; + +public class AsyncListViolations { + + public static void main(String[] args) throws Exception { + asyncListViolations(); + } + + public static void asyncListViolations() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setInterval(Interval.newBuilder().build()) + .build(); + ApiFuture future = + cloudControlsPartnerMonitoringClient.listViolationsPagedCallable().futureCall(request); + // Do something. + for (Violation element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/AsyncListViolationsPaged.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/AsyncListViolationsPaged.java new file mode 100644 index 000000000000..2725aa943e17 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/AsyncListViolationsPaged.java @@ -0,0 +1,69 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_Paged_async] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsResponse; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; +import com.google.common.base.Strings; +import com.google.type.Interval; + +public class AsyncListViolationsPaged { + + public static void main(String[] args) throws Exception { + asyncListViolationsPaged(); + } + + public static void asyncListViolationsPaged() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setInterval(Interval.newBuilder().build()) + .build(); + while (true) { + ListViolationsResponse response = + cloudControlsPartnerMonitoringClient.listViolationsCallable().call(request); + for (Violation element : response.getViolationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_Paged_async] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolations.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolations.java new file mode 100644 index 000000000000..ad67684f2c47 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolations.java @@ -0,0 +1,58 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.ListViolationsRequest; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; +import com.google.type.Interval; + +public class SyncListViolations { + + public static void main(String[] args) throws Exception { + syncListViolations(); + } + + public static void syncListViolations() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + ListViolationsRequest request = + ListViolationsRequest.newBuilder() + .setParent( + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setInterval(Interval.newBuilder().build()) + .build(); + for (Violation element : + cloudControlsPartnerMonitoringClient.listViolations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsString.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsString.java new file mode 100644 index 000000000000..6734734a8efc --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_String_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class SyncListViolationsString { + + public static void main(String[] args) throws Exception { + syncListViolationsString(); + } + + public static void syncListViolationsString() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + String parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]").toString(); + for (Violation element : + cloudControlsPartnerMonitoringClient.listViolations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_String_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsWorkloadname.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsWorkloadname.java new file mode 100644 index 000000000000..67bd04410b59 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoring/listviolations/SyncListViolationsWorkloadname.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_Workloadname_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringClient; +import com.google.cloud.cloudcontrolspartner.v1beta.Violation; +import com.google.cloud.cloudcontrolspartner.v1beta.WorkloadName; + +public class SyncListViolationsWorkloadname { + + public static void main(String[] args) throws Exception { + syncListViolationsWorkloadname(); + } + + public static void syncListViolationsWorkloadname() 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 (CloudControlsPartnerMonitoringClient cloudControlsPartnerMonitoringClient = + CloudControlsPartnerMonitoringClient.create()) { + WorkloadName parent = + WorkloadName.of("[ORGANIZATION]", "[LOCATION]", "[CUSTOMER]", "[WORKLOAD]"); + for (Violation element : + cloudControlsPartnerMonitoringClient.listViolations(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_Workloadname_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoringsettings/getviolation/SyncGetViolation.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoringsettings/getviolation/SyncGetViolation.java new file mode 100644 index 000000000000..e6d70bc47dfb --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/cloudcontrolspartnermonitoringsettings/getviolation/SyncGetViolation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoringSettings_GetViolation_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerMonitoringSettings; +import java.time.Duration; + +public class SyncGetViolation { + + public static void main(String[] args) throws Exception { + syncGetViolation(); + } + + public static void syncGetViolation() 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 + CloudControlsPartnerMonitoringSettings.Builder cloudControlsPartnerMonitoringSettingsBuilder = + CloudControlsPartnerMonitoringSettings.newBuilder(); + cloudControlsPartnerMonitoringSettingsBuilder + .getViolationSettings() + .setRetrySettings( + cloudControlsPartnerMonitoringSettingsBuilder + .getViolationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudControlsPartnerMonitoringSettings cloudControlsPartnerMonitoringSettings = + cloudControlsPartnerMonitoringSettingsBuilder.build(); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoringSettings_GetViolation_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/stub/cloudcontrolspartnercorestubsettings/getworkload/SyncGetWorkload.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/stub/cloudcontrolspartnercorestubsettings/getworkload/SyncGetWorkload.java new file mode 100644 index 000000000000..c25db6521993 --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/stub/cloudcontrolspartnercorestubsettings/getworkload/SyncGetWorkload.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCoreStubSettings_GetWorkload_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.stub.CloudControlsPartnerCoreStubSettings; +import java.time.Duration; + +public class SyncGetWorkload { + + public static void main(String[] args) throws Exception { + syncGetWorkload(); + } + + public static void syncGetWorkload() 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 + CloudControlsPartnerCoreStubSettings.Builder cloudControlsPartnerCoreSettingsBuilder = + CloudControlsPartnerCoreStubSettings.newBuilder(); + cloudControlsPartnerCoreSettingsBuilder + .getWorkloadSettings() + .setRetrySettings( + cloudControlsPartnerCoreSettingsBuilder + .getWorkloadSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudControlsPartnerCoreStubSettings cloudControlsPartnerCoreSettings = + cloudControlsPartnerCoreSettingsBuilder.build(); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCoreStubSettings_GetWorkload_sync] diff --git a/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/stub/cloudcontrolspartnermonitoringstubsettings/getviolation/SyncGetViolation.java b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/stub/cloudcontrolspartnermonitoringstubsettings/getviolation/SyncGetViolation.java new file mode 100644 index 000000000000..eae94bb9953b --- /dev/null +++ b/java-cloudcontrolspartner/samples/snippets/generated/com/google/cloud/cloudcontrolspartner/v1beta/stub/cloudcontrolspartnermonitoringstubsettings/getviolation/SyncGetViolation.java @@ -0,0 +1,51 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.cloudcontrolspartner.v1beta.stub.samples; + +// [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoringStubSettings_GetViolation_sync] +import com.google.cloud.cloudcontrolspartner.v1beta.stub.CloudControlsPartnerMonitoringStubSettings; +import java.time.Duration; + +public class SyncGetViolation { + + public static void main(String[] args) throws Exception { + syncGetViolation(); + } + + public static void syncGetViolation() 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 + CloudControlsPartnerMonitoringStubSettings.Builder + cloudControlsPartnerMonitoringSettingsBuilder = + CloudControlsPartnerMonitoringStubSettings.newBuilder(); + cloudControlsPartnerMonitoringSettingsBuilder + .getViolationSettings() + .setRetrySettings( + cloudControlsPartnerMonitoringSettingsBuilder + .getViolationSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudControlsPartnerMonitoringStubSettings cloudControlsPartnerMonitoringSettings = + cloudControlsPartnerMonitoringSettingsBuilder.build(); + } +} +// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoringStubSettings_GetViolation_sync] diff --git a/pom.xml b/pom.xml index 48845fcf2838..e8c18048e166 100644 --- a/pom.xml +++ b/pom.xml @@ -55,6 +55,7 @@ java-channel java-cloudbuild java-cloudcommerceconsumerprocurement + java-cloudcontrolspartner java-cloudquotas java-cloudsupport java-compute diff --git a/versions.txt b/versions.txt index 24cf2f03feee..fe6c8a29b86c 100644 --- a/versions.txt +++ b/versions.txt @@ -730,6 +730,11 @@ proto-google-cloud-securityposture-v1:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-securityposture-v1:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-securitycenter-v2:2.44.0:2.45.0-SNAPSHOT grpc-google-cloud-securitycenter-v2:2.44.0:2.45.0-SNAPSHOT +google-cloud-cloudcontrolspartner:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-cloudcontrolspartner-v1beta:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-cloudcontrolspartner-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-cloudcontrolspartner-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-cloudcontrolspartner-v1beta:0.0.0:0.0.1-SNAPSHOT google-cloud-workspaceevents:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-workspaceevents-v1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-workspaceevents-v1:0.0.0:0.0.1-SNAPSHOT