diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index a41283bd0bfb..1645880138f3 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -938,6 +938,13 @@ pom import + + com.google.cloud + google-cloud-securityposture-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-security-private-ca-bom diff --git a/java-securityposture/.OwlBot.yaml b/java-securityposture/.OwlBot.yaml new file mode 100644 index 000000000000..cfd403b5c0a9 --- /dev/null +++ b/java-securityposture/.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-securityposture/grpc-google-.*/src" +- "/java-securityposture/proto-google-.*/src" +- "/java-securityposture/google-.*/src" +- "/java-securityposture/samples/snippets/generated" + +deep-preserve-regex: +- "/java-securityposture/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/securityposture/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-securityposture/$1/proto-google-cloud-securityposture-$1/src" +- source: "/google/cloud/securityposture/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-securityposture/$1/grpc-google-cloud-securityposture-$1/src" +- source: "/google/cloud/securityposture/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-securityposture/$1/google-cloud-securityposture/src" +- source: "/google/cloud/securityposture/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-securityposture/$1/samples/snippets/generated" + + +api-name: securityposture \ No newline at end of file diff --git a/java-securityposture/.repo-metadata.json b/java-securityposture/.repo-metadata.json new file mode 100644 index 000000000000..631d68961336 --- /dev/null +++ b/java-securityposture/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "securityposture", + "name_pretty": "Security Posture API", + "product_documentation": "https://cloud.google.com/security-command-center/docs/security-posture-overview", + "api_description": "Security Posture is a comprehensive framework of policy sets that empowers organizations to define, assess early, deploy, and monitor their security measures in a unified way and helps simplify governance and reduces administrative toil.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-securityposture/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-securityposture", + "repo_short": "java-securityposture", + "distribution_name": "com.google.cloud:google-cloud-securityposture", + "api_id": "securityposture.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-securityposture/README.md b/java-securityposture/README.md new file mode 100644 index 000000000000..fc4a4bcfbd7a --- /dev/null +++ b/java-securityposture/README.md @@ -0,0 +1,225 @@ +# Google Security Posture API Client for Java + +Java idiomatic client for [Security Posture 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.32.0 + pom + import + + + + + + + com.google.cloud + google-cloud-securityposture + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-securityposture + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-securityposture:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-securityposture" % "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 Security Posture API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Security Posture API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Security Posture API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Security Posture 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-securityposture` library. See the [Quickstart](#quickstart) section +to add `google-cloud-securityposture` as a dependency in your code. + +## About Security Posture API + + +[Security Posture API][product-docs] Security Posture is a comprehensive framework of policy sets that empowers organizations to define, assess early, deploy, and monitor their security measures in a unified way and helps simplify governance and reduces administrative toil. + +See the [Security Posture API client library docs][javadocs] to learn how to +use this Security Posture API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Security Posture API uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/security-command-center/docs/security-posture-overview +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-securityposture/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-securityposture/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-securityposture.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-securityposture/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-securityposture/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-securityposture/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-securityposture/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=securityposture.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-securityposture/google-cloud-securityposture-bom/pom.xml b/java-securityposture/google-cloud-securityposture-bom/pom.xml new file mode 100644 index 000000000000..d4d99681b050 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture-bom/pom.xml @@ -0,0 +1,44 @@ + + + 4.0.0 + com.google.cloud + google-cloud-securityposture-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.30.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Security Posture API BOM + + BOM for Security Posture API + + + + true + + + + + + com.google.cloud + google-cloud-securityposture + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-securityposture-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-securityposture-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-securityposture/google-cloud-securityposture/pom.xml b/java-securityposture/google-cloud-securityposture/pom.xml new file mode 100644 index 000000000000..411cfc6b9f5b --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + com.google.cloud + google-cloud-securityposture + 0.0.1-SNAPSHOT + jar + Google Security Posture API + Security Posture API Security Posture is a comprehensive framework of policy sets that empowers organizations to define, assess early, deploy, and monitor their security measures in a unified way and helps simplify governance and reduces administrative toil. + + com.google.cloud + google-cloud-securityposture-parent + 0.0.1-SNAPSHOT + + + google-cloud-securityposture + + + + 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-securityposture-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-securityposture-v1 + test + + + + com.google.api + gax + testlib + test + + + com.google.api + gax-grpc + testlib + test + + + com.google.api + gax-httpjson + testlib + test + + + diff --git a/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureClient.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureClient.java new file mode 100644 index 000000000000..b52f2ce85bd2 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureClient.java @@ -0,0 +1,3225 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1; + +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.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +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.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.stub.SecurityPostureStub; +import com.google.cloud.securityposture.v1.stub.SecurityPostureStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+ *   PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]");
+ *   Posture response = securityPostureClient.getPosture(name);
+ * }
+ * }
+ * + *

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

ListPostures

(-- This option restricts the visibility of the API to only projects that will (-- be labeled as `PREVIEW` or `GOOGLE_INTERNAL` by the service. (-- option (google.api.api_visibility).restriction = "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in a given organization and location. In case a posture has multiple revisions, the latest revision as per UpdateTime will be returned.

+ *

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

+ *
    + *
  • listPostures(ListPosturesRequest request) + *

+ *

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

+ *
    + *
  • listPostures(OrganizationName parent) + *

  • listPostures(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.

+ *
    + *
  • listPosturesPagedCallable() + *

  • listPosturesCallable() + *

+ *

ListPostureRevisions

Lists revisions of a Posture in a given organization and location.

+ *

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

+ *
    + *
  • listPostureRevisions(ListPostureRevisionsRequest request) + *

+ *

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

+ *
    + *
  • listPostureRevisionsPagedCallable() + *

  • listPostureRevisionsCallable() + *

+ *

GetPosture

Gets a posture in a given organization and location. User must provide revision_id to retrieve a specific revision of the resource. NOT_FOUND error is returned if the revision_id or the Posture name does not exist. In case revision_id is not provided then the latest Posture revision by UpdateTime is returned.

+ *

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

+ *
    + *
  • getPosture(GetPostureRequest request) + *

+ *

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

+ *
    + *
  • getPosture(PostureName name) + *

  • getPosture(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.

+ *
    + *
  • getPostureCallable() + *

+ *

CreatePosture

Creates a new Posture resource. If a Posture with the specified name already exists in the specified organization and location, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

+ *

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

+ *
    + *
  • createPostureAsync(CreatePostureRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createPostureAsync(OrganizationName parent, Posture posture, String postureId) + *

  • createPostureAsync(String parent, Posture posture, String postureId) + *

+ *

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

+ *
    + *
  • createPostureOperationCallable() + *

  • createPostureCallable() + *

+ *

UpdatePosture

Updates an existing Posture. A new revision of the posture will be created if the revision to be updated is currently deployed on a workload. Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the Posture does not exist. Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag supplied in the request does not match the persisted etag of the Posture. Updatable fields are state, description and policy_sets. State update operation cannot be clubbed with update of description and policy_sets. An ACTIVE posture can be updated to both DRAFT or DEPRECATED states. Postures in DRAFT or DEPRECATED states can only be updated to ACTIVE state.

+ *

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

+ *
    + *
  • updatePostureAsync(UpdatePostureRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updatePostureAsync(Posture posture, FieldMask updateMask) + *

+ *

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

+ *
    + *
  • updatePostureOperationCallable() + *

  • updatePostureCallable() + *

+ *

DeletePosture

Deletes all the revisions of a resource. A posture can only be deleted when none of the revisions are deployed to any workload.

+ *

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

+ *
    + *
  • deletePostureAsync(DeletePostureRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • deletePostureAsync(PostureName name) + *

  • deletePostureAsync(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.

+ *
    + *
  • deletePostureOperationCallable() + *

  • deletePostureCallable() + *

+ *

ExtractPosture

Extracts existing policies on a workload as a posture. If a Posture on the given workload already exists, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

+ *

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

+ *
    + *
  • extractPostureAsync(ExtractPostureRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • extractPostureAsync(OrganizationName parent, String postureId, String workload) + *

  • extractPostureAsync(String parent, String postureId, String workload) + *

+ *

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

+ *
    + *
  • extractPostureOperationCallable() + *

  • extractPostureCallable() + *

+ *

ListPostureDeployments

PostureDeployments Lists PostureDeployments in a given project and location.

+ *

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

+ *
    + *
  • listPostureDeployments(ListPostureDeploymentsRequest request) + *

+ *

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

+ *
    + *
  • listPostureDeployments(OrganizationName parent) + *

  • listPostureDeployments(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.

+ *
    + *
  • listPostureDeploymentsPagedCallable() + *

  • listPostureDeploymentsCallable() + *

+ *

GetPostureDeployment

Gets details of a single PostureDeployment.

+ *

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

+ *
    + *
  • getPostureDeployment(GetPostureDeploymentRequest request) + *

+ *

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

+ *
    + *
  • getPostureDeployment(PostureDeploymentName name) + *

  • getPostureDeployment(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.

+ *
    + *
  • getPostureDeploymentCallable() + *

+ *

CreatePostureDeployment

Creates a new PostureDeployment in a given project and location.

+ *

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

+ *
    + *
  • createPostureDeploymentAsync(CreatePostureDeploymentRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createPostureDeploymentAsync(OrganizationName parent, PostureDeployment postureDeployment, String postureDeploymentId) + *

  • createPostureDeploymentAsync(String parent, PostureDeployment postureDeployment, String postureDeploymentId) + *

+ *

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

+ *
    + *
  • createPostureDeploymentOperationCallable() + *

  • createPostureDeploymentCallable() + *

+ *

UpdatePostureDeployment

Updates the parameters of a single PostureDeployment.

+ *

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

+ *
    + *
  • updatePostureDeploymentAsync(UpdatePostureDeploymentRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updatePostureDeploymentAsync(PostureDeployment postureDeployment, FieldMask updateMask) + *

+ *

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

+ *
    + *
  • updatePostureDeploymentOperationCallable() + *

  • updatePostureDeploymentCallable() + *

+ *

DeletePostureDeployment

Deletes a single PostureDeployment.

+ *

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

+ *
    + *
  • deletePostureDeploymentAsync(DeletePostureDeploymentRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • deletePostureDeploymentAsync(PostureDeploymentName name) + *

  • deletePostureDeploymentAsync(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.

+ *
    + *
  • deletePostureDeploymentOperationCallable() + *

  • deletePostureDeploymentCallable() + *

+ *

ListPostureTemplates

PostureTemplates Lists all the PostureTemplates available to the user.

+ *

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

+ *
    + *
  • listPostureTemplates(ListPostureTemplatesRequest request) + *

+ *

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

+ *
    + *
  • listPostureTemplates(OrganizationName parent) + *

  • listPostureTemplates(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.

+ *
    + *
  • listPostureTemplatesPagedCallable() + *

  • listPostureTemplatesCallable() + *

+ *

GetPostureTemplate

Gets a PostureTemplate. User must provide revision_id to retrieve a specific revision of the resource. NOT_FOUND error is returned if the revision_id or the PostureTemplate name does not exist. In case revision_id is not provided then the PostureTemplate with latest revision_id is returned.

+ *

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

+ *
    + *
  • getPostureTemplate(GetPostureTemplateRequest request) + *

+ *

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

+ *
    + *
  • getPostureTemplate(PostureTemplateName name) + *

  • getPostureTemplate(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.

+ *
    + *
  • getPostureTemplateCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

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

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

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

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

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

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

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

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 SecurityPostureSettings 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
+ * SecurityPostureSettings securityPostureSettings =
+ *     SecurityPostureSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SecurityPostureClient securityPostureClient =
+ *     SecurityPostureClient.create(securityPostureSettings);
+ * }
+ * + *

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
+ * SecurityPostureSettings securityPostureSettings =
+ *     SecurityPostureSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SecurityPostureClient securityPostureClient =
+ *     SecurityPostureClient.create(securityPostureSettings);
+ * }
+ * + *

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
+ * SecurityPostureSettings securityPostureSettings =
+ *     SecurityPostureSettings.newHttpJsonBuilder().build();
+ * SecurityPostureClient securityPostureClient =
+ *     SecurityPostureClient.create(securityPostureSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class SecurityPostureClient implements BackgroundResource { + private final SecurityPostureSettings settings; + private final SecurityPostureStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of SecurityPostureClient with default settings. */ + public static final SecurityPostureClient create() throws IOException { + return create(SecurityPostureSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SecurityPostureClient, 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 SecurityPostureClient create(SecurityPostureSettings settings) + throws IOException { + return new SecurityPostureClient(settings); + } + + /** + * Constructs an instance of SecurityPostureClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SecurityPostureSettings). + */ + public static final SecurityPostureClient create(SecurityPostureStub stub) { + return new SecurityPostureClient(stub); + } + + /** + * Constructs an instance of SecurityPostureClient, 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 SecurityPostureClient(SecurityPostureSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SecurityPostureStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected SecurityPostureClient(SecurityPostureStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final SecurityPostureSettings getSettings() { + return settings; + } + + public SecurityPostureStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * (-- This option restricts the visibility of the API to only projects that will (-- be labeled + * as `PREVIEW` or `GOOGLE_INTERNAL` by the service. (-- option + * (google.api.api_visibility).restriction = "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in + * a given organization and location. In case a posture has multiple revisions, the latest + * revision as per UpdateTime will be returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (Posture element : securityPostureClient.listPostures(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListPosturesRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPosturesPagedResponse listPostures(OrganizationName parent) { + ListPosturesRequest request = + ListPosturesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listPostures(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * (-- This option restricts the visibility of the API to only projects that will (-- be labeled + * as `PREVIEW` or `GOOGLE_INTERNAL` by the service. (-- option + * (google.api.api_visibility).restriction = "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in + * a given organization and location. In case a posture has multiple revisions, the latest + * revision as per UpdateTime will be returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   for (Posture element : securityPostureClient.listPostures(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListPosturesRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPosturesPagedResponse listPostures(String parent) { + ListPosturesRequest request = ListPosturesRequest.newBuilder().setParent(parent).build(); + return listPostures(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * (-- This option restricts the visibility of the API to only projects that will (-- be labeled + * as `PREVIEW` or `GOOGLE_INTERNAL` by the service. (-- option + * (google.api.api_visibility).restriction = "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in + * a given organization and location. In case a posture has multiple revisions, the latest + * revision as per UpdateTime will be returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPosturesRequest request =
+   *       ListPosturesRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Posture element : securityPostureClient.listPostures(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 ListPosturesPagedResponse listPostures(ListPosturesRequest request) { + return listPosturesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * (-- This option restricts the visibility of the API to only projects that will (-- be labeled + * as `PREVIEW` or `GOOGLE_INTERNAL` by the service. (-- option + * (google.api.api_visibility).restriction = "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in + * a given organization and location. In case a posture has multiple revisions, the latest + * revision as per UpdateTime will be returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPosturesRequest request =
+   *       ListPosturesRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.listPosturesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Posture element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPosturesPagedCallable() { + return stub.listPosturesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * (-- This option restricts the visibility of the API to only projects that will (-- be labeled + * as `PREVIEW` or `GOOGLE_INTERNAL` by the service. (-- option + * (google.api.api_visibility).restriction = "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in + * a given organization and location. In case a posture has multiple revisions, the latest + * revision as per UpdateTime will be returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPosturesRequest request =
+   *       ListPosturesRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListPosturesResponse response = securityPostureClient.listPosturesCallable().call(request);
+   *     for (Posture element : response.getPosturesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listPosturesCallable() { + return stub.listPosturesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists revisions of a Posture in a given organization and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureRevisionsRequest request =
+   *       ListPostureRevisionsRequest.newBuilder()
+   *           .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Posture element : securityPostureClient.listPostureRevisions(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 ListPostureRevisionsPagedResponse listPostureRevisions( + ListPostureRevisionsRequest request) { + return listPostureRevisionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists revisions of a Posture in a given organization and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureRevisionsRequest request =
+   *       ListPostureRevisionsRequest.newBuilder()
+   *           .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.listPostureRevisionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Posture element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPostureRevisionsPagedCallable() { + return stub.listPostureRevisionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists revisions of a Posture in a given organization and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureRevisionsRequest request =
+   *       ListPostureRevisionsRequest.newBuilder()
+   *           .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListPostureRevisionsResponse response =
+   *         securityPostureClient.listPostureRevisionsCallable().call(request);
+   *     for (Posture element : response.getRevisionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPostureRevisionsCallable() { + return stub.listPostureRevisionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a posture in a given organization and location. User must provide revision_id to retrieve + * a specific revision of the resource. NOT_FOUND error is returned if the revision_id or the + * Posture name does not exist. In case revision_id is not provided then the latest Posture + * revision by UpdateTime is returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]");
+   *   Posture response = securityPostureClient.getPosture(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Posture getPosture(PostureName name) { + GetPostureRequest request = + GetPostureRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPosture(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a posture in a given organization and location. User must provide revision_id to retrieve + * a specific revision of the resource. NOT_FOUND error is returned if the revision_id or the + * Posture name does not exist. In case revision_id is not provided then the latest Posture + * revision by UpdateTime is returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString();
+   *   Posture response = securityPostureClient.getPosture(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Posture getPosture(String name) { + GetPostureRequest request = GetPostureRequest.newBuilder().setName(name).build(); + return getPosture(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a posture in a given organization and location. User must provide revision_id to retrieve + * a specific revision of the resource. NOT_FOUND error is returned if the revision_id or the + * Posture name does not exist. In case revision_id is not provided then the latest Posture + * revision by UpdateTime is returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   GetPostureRequest request =
+   *       GetPostureRequest.newBuilder()
+   *           .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString())
+   *           .setRevisionId("revisionId-1507445162")
+   *           .build();
+   *   Posture response = securityPostureClient.getPosture(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 Posture getPosture(GetPostureRequest request) { + return getPostureCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a posture in a given organization and location. User must provide revision_id to retrieve + * a specific revision of the resource. NOT_FOUND error is returned if the revision_id or the + * Posture name does not exist. In case revision_id is not provided then the latest Posture + * revision by UpdateTime is returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   GetPostureRequest request =
+   *       GetPostureRequest.newBuilder()
+   *           .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString())
+   *           .setRevisionId("revisionId-1507445162")
+   *           .build();
+   *   ApiFuture future = securityPostureClient.getPostureCallable().futureCall(request);
+   *   // Do something.
+   *   Posture response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getPostureCallable() { + return stub.getPostureCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Posture resource. If a Posture with the specified name already exists in the + * specified organization and location, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   Posture posture = Posture.newBuilder().build();
+   *   String postureId = "postureId2023219203";
+   *   Posture response = securityPostureClient.createPostureAsync(parent, posture, postureId).get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param posture Required. The resource being created. + * @param postureId Required. User provided identifier. It should be unique in scope of an + * Organization and location. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createPostureAsync( + OrganizationName parent, Posture posture, String postureId) { + CreatePostureRequest request = + CreatePostureRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPosture(posture) + .setPostureId(postureId) + .build(); + return createPostureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Posture resource. If a Posture with the specified name already exists in the + * specified organization and location, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   Posture posture = Posture.newBuilder().build();
+   *   String postureId = "postureId2023219203";
+   *   Posture response = securityPostureClient.createPostureAsync(parent, posture, postureId).get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. + * @param posture Required. The resource being created. + * @param postureId Required. User provided identifier. It should be unique in scope of an + * Organization and location. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createPostureAsync( + String parent, Posture posture, String postureId) { + CreatePostureRequest request = + CreatePostureRequest.newBuilder() + .setParent(parent) + .setPosture(posture) + .setPostureId(postureId) + .build(); + return createPostureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Posture resource. If a Posture with the specified name already exists in the + * specified organization and location, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   CreatePostureRequest request =
+   *       CreatePostureRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureId("postureId2023219203")
+   *           .setPosture(Posture.newBuilder().build())
+   *           .build();
+   *   Posture response = securityPostureClient.createPostureAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture createPostureAsync( + CreatePostureRequest request) { + return createPostureOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Posture resource. If a Posture with the specified name already exists in the + * specified organization and location, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   CreatePostureRequest request =
+   *       CreatePostureRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureId("postureId2023219203")
+   *           .setPosture(Posture.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       securityPostureClient.createPostureOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Posture response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createPostureOperationCallable() { + return stub.createPostureOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Posture resource. If a Posture with the specified name already exists in the + * specified organization and location, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   CreatePostureRequest request =
+   *       CreatePostureRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureId("postureId2023219203")
+   *           .setPosture(Posture.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.createPostureCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createPostureCallable() { + return stub.createPostureCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing Posture. A new revision of the posture will be created if the revision to + * be updated is currently deployed on a workload. Returns a `google.rpc.Status` with + * `google.rpc.Code.NOT_FOUND` if the Posture does not exist. Returns a `google.rpc.Status` with + * `google.rpc.Code.ABORTED` if the etag supplied in the request does not match the persisted etag + * of the Posture. Updatable fields are state, description and policy_sets. State update operation + * cannot be clubbed with update of description and policy_sets. An ACTIVE posture can be updated + * to both DRAFT or DEPRECATED states. Postures in DRAFT or DEPRECATED states can only be updated + * to ACTIVE state. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   Posture posture = Posture.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Posture response = securityPostureClient.updatePostureAsync(posture, updateMask).get();
+   * }
+   * }
+ * + * @param posture Required. The resource being updated. + * @param updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Posture resource by the update. The fields specified in the update_mask are relative to the + * resource, not the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updatePostureAsync( + Posture posture, FieldMask updateMask) { + UpdatePostureRequest request = + UpdatePostureRequest.newBuilder().setPosture(posture).setUpdateMask(updateMask).build(); + return updatePostureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing Posture. A new revision of the posture will be created if the revision to + * be updated is currently deployed on a workload. Returns a `google.rpc.Status` with + * `google.rpc.Code.NOT_FOUND` if the Posture does not exist. Returns a `google.rpc.Status` with + * `google.rpc.Code.ABORTED` if the etag supplied in the request does not match the persisted etag + * of the Posture. Updatable fields are state, description and policy_sets. State update operation + * cannot be clubbed with update of description and policy_sets. An ACTIVE posture can be updated + * to both DRAFT or DEPRECATED states. Postures in DRAFT or DEPRECATED states can only be updated + * to ACTIVE state. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   UpdatePostureRequest request =
+   *       UpdatePostureRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPosture(Posture.newBuilder().build())
+   *           .setRevisionId("revisionId-1507445162")
+   *           .build();
+   *   Posture response = securityPostureClient.updatePostureAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture updatePostureAsync( + UpdatePostureRequest request) { + return updatePostureOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing Posture. A new revision of the posture will be created if the revision to + * be updated is currently deployed on a workload. Returns a `google.rpc.Status` with + * `google.rpc.Code.NOT_FOUND` if the Posture does not exist. Returns a `google.rpc.Status` with + * `google.rpc.Code.ABORTED` if the etag supplied in the request does not match the persisted etag + * of the Posture. Updatable fields are state, description and policy_sets. State update operation + * cannot be clubbed with update of description and policy_sets. An ACTIVE posture can be updated + * to both DRAFT or DEPRECATED states. Postures in DRAFT or DEPRECATED states can only be updated + * to ACTIVE state. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   UpdatePostureRequest request =
+   *       UpdatePostureRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPosture(Posture.newBuilder().build())
+   *           .setRevisionId("revisionId-1507445162")
+   *           .build();
+   *   OperationFuture future =
+   *       securityPostureClient.updatePostureOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Posture response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updatePostureOperationCallable() { + return stub.updatePostureOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing Posture. A new revision of the posture will be created if the revision to + * be updated is currently deployed on a workload. Returns a `google.rpc.Status` with + * `google.rpc.Code.NOT_FOUND` if the Posture does not exist. Returns a `google.rpc.Status` with + * `google.rpc.Code.ABORTED` if the etag supplied in the request does not match the persisted etag + * of the Posture. Updatable fields are state, description and policy_sets. State update operation + * cannot be clubbed with update of description and policy_sets. An ACTIVE posture can be updated + * to both DRAFT or DEPRECATED states. Postures in DRAFT or DEPRECATED states can only be updated + * to ACTIVE state. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   UpdatePostureRequest request =
+   *       UpdatePostureRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPosture(Posture.newBuilder().build())
+   *           .setRevisionId("revisionId-1507445162")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.updatePostureCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updatePostureCallable() { + return stub.updatePostureCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the revisions of a resource. A posture can only be deleted when none of the + * revisions are deployed to any 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]");
+   *   securityPostureClient.deletePostureAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deletePostureAsync(PostureName name) { + DeletePostureRequest request = + DeletePostureRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deletePostureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the revisions of a resource. A posture can only be deleted when none of the + * revisions are deployed to any 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString();
+   *   securityPostureClient.deletePostureAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deletePostureAsync(String name) { + DeletePostureRequest request = DeletePostureRequest.newBuilder().setName(name).build(); + return deletePostureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the revisions of a resource. A posture can only be deleted when none of the + * revisions are deployed to any 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   DeletePostureRequest request =
+   *       DeletePostureRequest.newBuilder()
+   *           .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   securityPostureClient.deletePostureAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture deletePostureAsync( + DeletePostureRequest request) { + return deletePostureOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the revisions of a resource. A posture can only be deleted when none of the + * revisions are deployed to any 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   DeletePostureRequest request =
+   *       DeletePostureRequest.newBuilder()
+   *           .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       securityPostureClient.deletePostureOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deletePostureOperationCallable() { + return stub.deletePostureOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the revisions of a resource. A posture can only be deleted when none of the + * revisions are deployed to any 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   DeletePostureRequest request =
+   *       DeletePostureRequest.newBuilder()
+   *           .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.deletePostureCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deletePostureCallable() { + return stub.deletePostureCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Extracts existing policies on a workload as a posture. If a Posture on the given workload + * already exists, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   String postureId = "postureId2023219203";
+   *   String workload = "workload35560311";
+   *   Posture response =
+   *       securityPostureClient.extractPostureAsync(parent, postureId, workload).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. The format of this value is as follows: + * `organizations/{organization}/locations/{location}` + * @param postureId Required. User provided identifier. It should be unique in scope of an + * Organization and location. + * @param workload Required. Workload from which the policies are to be extracted, it should + * belong to the same organization defined in parent. The format of this value varies + * depending on the scope of the request: - `folder/folderNumber` - `project/projectNumber` - + * `organization/organizationNumber` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture extractPostureAsync( + OrganizationName parent, String postureId, String workload) { + ExtractPostureRequest request = + ExtractPostureRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPostureId(postureId) + .setWorkload(workload) + .build(); + return extractPostureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Extracts existing policies on a workload as a posture. If a Posture on the given workload + * already exists, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   String postureId = "postureId2023219203";
+   *   String workload = "workload35560311";
+   *   Posture response =
+   *       securityPostureClient.extractPostureAsync(parent, postureId, workload).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. The format of this value is as follows: + * `organizations/{organization}/locations/{location}` + * @param postureId Required. User provided identifier. It should be unique in scope of an + * Organization and location. + * @param workload Required. Workload from which the policies are to be extracted, it should + * belong to the same organization defined in parent. The format of this value varies + * depending on the scope of the request: - `folder/folderNumber` - `project/projectNumber` - + * `organization/organizationNumber` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture extractPostureAsync( + String parent, String postureId, String workload) { + ExtractPostureRequest request = + ExtractPostureRequest.newBuilder() + .setParent(parent) + .setPostureId(postureId) + .setWorkload(workload) + .build(); + return extractPostureAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Extracts existing policies on a workload as a posture. If a Posture on the given workload + * already exists, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ExtractPostureRequest request =
+   *       ExtractPostureRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureId("postureId2023219203")
+   *           .setWorkload("workload35560311")
+   *           .build();
+   *   Posture response = securityPostureClient.extractPostureAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture extractPostureAsync( + ExtractPostureRequest request) { + return extractPostureOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Extracts existing policies on a workload as a posture. If a Posture on the given workload + * already exists, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ExtractPostureRequest request =
+   *       ExtractPostureRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureId("postureId2023219203")
+   *           .setWorkload("workload35560311")
+   *           .build();
+   *   OperationFuture future =
+   *       securityPostureClient.extractPostureOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Posture response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + extractPostureOperationCallable() { + return stub.extractPostureOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Extracts existing policies on a workload as a posture. If a Posture on the given workload + * already exists, the long running operation returns a + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ExtractPostureRequest request =
+   *       ExtractPostureRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureId("postureId2023219203")
+   *           .setWorkload("workload35560311")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.extractPostureCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable extractPostureCallable() { + return stub.extractPostureCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureDeployments Lists PostureDeployments in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (PostureDeployment element :
+   *       securityPostureClient.listPostureDeployments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListPostureDeploymentsRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPostureDeploymentsPagedResponse listPostureDeployments(OrganizationName parent) { + ListPostureDeploymentsRequest request = + ListPostureDeploymentsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listPostureDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureDeployments Lists PostureDeployments in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   for (PostureDeployment element :
+   *       securityPostureClient.listPostureDeployments(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListPostureDeploymentsRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPostureDeploymentsPagedResponse listPostureDeployments(String parent) { + ListPostureDeploymentsRequest request = + ListPostureDeploymentsRequest.newBuilder().setParent(parent).build(); + return listPostureDeployments(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureDeployments Lists PostureDeployments in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureDeploymentsRequest request =
+   *       ListPostureDeploymentsRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (PostureDeployment element :
+   *       securityPostureClient.listPostureDeployments(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 ListPostureDeploymentsPagedResponse listPostureDeployments( + ListPostureDeploymentsRequest request) { + return listPostureDeploymentsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureDeployments Lists PostureDeployments in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureDeploymentsRequest request =
+   *       ListPostureDeploymentsRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.listPostureDeploymentsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (PostureDeployment element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPostureDeploymentsPagedCallable() { + return stub.listPostureDeploymentsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureDeployments Lists PostureDeployments in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureDeploymentsRequest request =
+   *       ListPostureDeploymentsRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListPostureDeploymentsResponse response =
+   *         securityPostureClient.listPostureDeploymentsCallable().call(request);
+   *     for (PostureDeployment element : response.getPostureDeploymentsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPostureDeploymentsCallable() { + return stub.listPostureDeploymentsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   PostureDeploymentName name =
+   *       PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]");
+   *   PostureDeployment response = securityPostureClient.getPostureDeployment(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PostureDeployment getPostureDeployment(PostureDeploymentName name) { + GetPostureDeploymentRequest request = + GetPostureDeploymentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getPostureDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String name =
+   *       PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]")
+   *           .toString();
+   *   PostureDeployment response = securityPostureClient.getPostureDeployment(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PostureDeployment getPostureDeployment(String name) { + GetPostureDeploymentRequest request = + GetPostureDeploymentRequest.newBuilder().setName(name).build(); + return getPostureDeployment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   GetPostureDeploymentRequest request =
+   *       GetPostureDeploymentRequest.newBuilder()
+   *           .setName(
+   *               PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]")
+   *                   .toString())
+   *           .build();
+   *   PostureDeployment response = securityPostureClient.getPostureDeployment(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 PostureDeployment getPostureDeployment(GetPostureDeploymentRequest request) { + return getPostureDeploymentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   GetPostureDeploymentRequest request =
+   *       GetPostureDeploymentRequest.newBuilder()
+   *           .setName(
+   *               PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.getPostureDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   PostureDeployment response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getPostureDeploymentCallable() { + return stub.getPostureDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new PostureDeployment in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   PostureDeployment postureDeployment = PostureDeployment.newBuilder().build();
+   *   String postureDeploymentId = "postureDeploymentId1771206568";
+   *   PostureDeployment response =
+   *       securityPostureClient
+   *           .createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. Format: organizations/{org_id}/locations/{location} + * @param postureDeployment Required. The resource being created. + * @param postureDeploymentId Required. User provided identifier. It should be unique in scope of + * an Organization and location. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createPostureDeploymentAsync( + OrganizationName parent, PostureDeployment postureDeployment, String postureDeploymentId) { + CreatePostureDeploymentRequest request = + CreatePostureDeploymentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPostureDeployment(postureDeployment) + .setPostureDeploymentId(postureDeploymentId) + .build(); + return createPostureDeploymentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new PostureDeployment in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   PostureDeployment postureDeployment = PostureDeployment.newBuilder().build();
+   *   String postureDeploymentId = "postureDeploymentId1771206568";
+   *   PostureDeployment response =
+   *       securityPostureClient
+   *           .createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId)
+   *           .get();
+   * }
+   * }
+ * + * @param parent Required. Value for parent. Format: organizations/{org_id}/locations/{location} + * @param postureDeployment Required. The resource being created. + * @param postureDeploymentId Required. User provided identifier. It should be unique in scope of + * an Organization and location. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createPostureDeploymentAsync( + String parent, PostureDeployment postureDeployment, String postureDeploymentId) { + CreatePostureDeploymentRequest request = + CreatePostureDeploymentRequest.newBuilder() + .setParent(parent) + .setPostureDeployment(postureDeployment) + .setPostureDeploymentId(postureDeploymentId) + .build(); + return createPostureDeploymentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new PostureDeployment in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   CreatePostureDeploymentRequest request =
+   *       CreatePostureDeploymentRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureDeploymentId("postureDeploymentId1771206568")
+   *           .setPostureDeployment(PostureDeployment.newBuilder().build())
+   *           .build();
+   *   PostureDeployment response =
+   *       securityPostureClient.createPostureDeploymentAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture createPostureDeploymentAsync( + CreatePostureDeploymentRequest request) { + return createPostureDeploymentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new PostureDeployment in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   CreatePostureDeploymentRequest request =
+   *       CreatePostureDeploymentRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureDeploymentId("postureDeploymentId1771206568")
+   *           .setPostureDeployment(PostureDeployment.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       securityPostureClient.createPostureDeploymentOperationCallable().futureCall(request);
+   *   // Do something.
+   *   PostureDeployment response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CreatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + createPostureDeploymentOperationCallable() { + return stub.createPostureDeploymentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new PostureDeployment in a given project and location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   CreatePostureDeploymentRequest request =
+   *       CreatePostureDeploymentRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPostureDeploymentId("postureDeploymentId1771206568")
+   *           .setPostureDeployment(PostureDeployment.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.createPostureDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createPostureDeploymentCallable() { + return stub.createPostureDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   PostureDeployment postureDeployment = PostureDeployment.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   PostureDeployment response =
+   *       securityPostureClient.updatePostureDeploymentAsync(postureDeployment, updateMask).get();
+   * }
+   * }
+ * + * @param postureDeployment Required. The resource being updated. + * @param updateMask Required. Field mask is used to specify the fields to be overwritten in the + * PostureDeployment resource by the update. The fields specified in the update_mask are + * relative to the resource, not the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be overwritten. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updatePostureDeploymentAsync( + PostureDeployment postureDeployment, FieldMask updateMask) { + UpdatePostureDeploymentRequest request = + UpdatePostureDeploymentRequest.newBuilder() + .setPostureDeployment(postureDeployment) + .setUpdateMask(updateMask) + .build(); + return updatePostureDeploymentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   UpdatePostureDeploymentRequest request =
+   *       UpdatePostureDeploymentRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPostureDeployment(PostureDeployment.newBuilder().build())
+   *           .build();
+   *   PostureDeployment response =
+   *       securityPostureClient.updatePostureDeploymentAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture updatePostureDeploymentAsync( + UpdatePostureDeploymentRequest request) { + return updatePostureDeploymentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   UpdatePostureDeploymentRequest request =
+   *       UpdatePostureDeploymentRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPostureDeployment(PostureDeployment.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       securityPostureClient.updatePostureDeploymentOperationCallable().futureCall(request);
+   *   // Do something.
+   *   PostureDeployment response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + UpdatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + updatePostureDeploymentOperationCallable() { + return stub.updatePostureDeploymentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   UpdatePostureDeploymentRequest request =
+   *       UpdatePostureDeploymentRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setPostureDeployment(PostureDeployment.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.updatePostureDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + updatePostureDeploymentCallable() { + return stub.updatePostureDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   PostureDeploymentName name =
+   *       PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]");
+   *   securityPostureClient.deletePostureDeploymentAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deletePostureDeploymentAsync( + PostureDeploymentName name) { + DeletePostureDeploymentRequest request = + DeletePostureDeploymentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return deletePostureDeploymentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String name =
+   *       PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]")
+   *           .toString();
+   *   securityPostureClient.deletePostureDeploymentAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deletePostureDeploymentAsync(String name) { + DeletePostureDeploymentRequest request = + DeletePostureDeploymentRequest.newBuilder().setName(name).build(); + return deletePostureDeploymentAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   DeletePostureDeploymentRequest request =
+   *       DeletePostureDeploymentRequest.newBuilder()
+   *           .setName(
+   *               PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   securityPostureClient.deletePostureDeploymentAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture deletePostureDeploymentAsync( + DeletePostureDeploymentRequest request) { + return deletePostureDeploymentOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   DeletePostureDeploymentRequest request =
+   *       DeletePostureDeploymentRequest.newBuilder()
+   *           .setName(
+   *               PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       securityPostureClient.deletePostureDeploymentOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deletePostureDeploymentOperationCallable() { + return stub.deletePostureDeploymentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single PostureDeployment. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   DeletePostureDeploymentRequest request =
+   *       DeletePostureDeploymentRequest.newBuilder()
+   *           .setName(
+   *               PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.deletePostureDeploymentCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + deletePostureDeploymentCallable() { + return stub.deletePostureDeploymentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureTemplates Lists all the PostureTemplates available to the user. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (PostureTemplate element :
+   *       securityPostureClient.listPostureTemplates(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListPostureTemplatesRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPostureTemplatesPagedResponse listPostureTemplates(OrganizationName parent) { + ListPostureTemplatesRequest request = + ListPostureTemplatesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listPostureTemplates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureTemplates Lists all the PostureTemplates available to the user. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString();
+   *   for (PostureTemplate element :
+   *       securityPostureClient.listPostureTemplates(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Parent value for ListPostureTemplatesRequest. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPostureTemplatesPagedResponse listPostureTemplates(String parent) { + ListPostureTemplatesRequest request = + ListPostureTemplatesRequest.newBuilder().setParent(parent).build(); + return listPostureTemplates(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureTemplates Lists all the PostureTemplates available to the user. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureTemplatesRequest request =
+   *       ListPostureTemplatesRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (PostureTemplate element :
+   *       securityPostureClient.listPostureTemplates(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 ListPostureTemplatesPagedResponse listPostureTemplates( + ListPostureTemplatesRequest request) { + return listPostureTemplatesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureTemplates Lists all the PostureTemplates available to the user. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureTemplatesRequest request =
+   *       ListPostureTemplatesRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.listPostureTemplatesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (PostureTemplate element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPostureTemplatesPagedCallable() { + return stub.listPostureTemplatesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * PostureTemplates Lists all the PostureTemplates available to the user. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListPostureTemplatesRequest request =
+   *       ListPostureTemplatesRequest.newBuilder()
+   *           .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListPostureTemplatesResponse response =
+   *         securityPostureClient.listPostureTemplatesCallable().call(request);
+   *     for (PostureTemplate element : response.getPostureTemplatesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPostureTemplatesCallable() { + return stub.listPostureTemplatesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a PostureTemplate. User must provide revision_id to retrieve a specific revision of the + * resource. NOT_FOUND error is returned if the revision_id or the PostureTemplate name does not + * exist. In case revision_id is not provided then the PostureTemplate with latest revision_id is + * returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   PostureTemplateName name =
+   *       PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]");
+   *   PostureTemplate response = securityPostureClient.getPostureTemplate(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PostureTemplate getPostureTemplate(PostureTemplateName name) { + GetPostureTemplateRequest request = + GetPostureTemplateRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getPostureTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a PostureTemplate. User must provide revision_id to retrieve a specific revision of the + * resource. NOT_FOUND error is returned if the revision_id or the PostureTemplate name does not + * exist. In case revision_id is not provided then the PostureTemplate with latest revision_id is + * returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   String name =
+   *       PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]").toString();
+   *   PostureTemplate response = securityPostureClient.getPostureTemplate(name);
+   * }
+   * }
+ * + * @param name Required. Name of the resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PostureTemplate getPostureTemplate(String name) { + GetPostureTemplateRequest request = + GetPostureTemplateRequest.newBuilder().setName(name).build(); + return getPostureTemplate(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a PostureTemplate. User must provide revision_id to retrieve a specific revision of the + * resource. NOT_FOUND error is returned if the revision_id or the PostureTemplate name does not + * exist. In case revision_id is not provided then the PostureTemplate with latest revision_id is + * returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   GetPostureTemplateRequest request =
+   *       GetPostureTemplateRequest.newBuilder()
+   *           .setName(
+   *               PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]")
+   *                   .toString())
+   *           .setRevisionId("revisionId-1507445162")
+   *           .build();
+   *   PostureTemplate response = securityPostureClient.getPostureTemplate(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 PostureTemplate getPostureTemplate(GetPostureTemplateRequest request) { + return getPostureTemplateCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a PostureTemplate. User must provide revision_id to retrieve a specific revision of the + * resource. NOT_FOUND error is returned if the revision_id or the PostureTemplate name does not + * exist. In case revision_id is not provided then the PostureTemplate with latest revision_id is + * returned. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   GetPostureTemplateRequest request =
+   *       GetPostureTemplateRequest.newBuilder()
+   *           .setName(
+   *               PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]")
+   *                   .toString())
+   *           .setRevisionId("revisionId-1507445162")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.getPostureTemplateCallable().futureCall(request);
+   *   // Do something.
+   *   PostureTemplate response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getPostureTemplateCallable() { + return stub.getPostureTemplateCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : securityPostureClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       securityPostureClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         securityPostureClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = securityPostureClient.getLocation(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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = securityPostureClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + @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 ListPosturesPagedResponse + extends AbstractPagedListResponse< + ListPosturesRequest, + ListPosturesResponse, + Posture, + ListPosturesPage, + ListPosturesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPosturesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListPosturesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListPosturesPagedResponse(ListPosturesPage page) { + super(page, ListPosturesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPosturesPage + extends AbstractPage { + + private ListPosturesPage( + PageContext context, + ListPosturesResponse response) { + super(context, response); + } + + private static ListPosturesPage createEmptyPage() { + return new ListPosturesPage(null, null); + } + + @Override + protected ListPosturesPage createPage( + PageContext context, + ListPosturesResponse response) { + return new ListPosturesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPosturesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPosturesRequest, + ListPosturesResponse, + Posture, + ListPosturesPage, + ListPosturesFixedSizeCollection> { + + private ListPosturesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPosturesFixedSizeCollection createEmptyCollection() { + return new ListPosturesFixedSizeCollection(null, 0); + } + + @Override + protected ListPosturesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPosturesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListPostureRevisionsPagedResponse + extends AbstractPagedListResponse< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + Posture, + ListPostureRevisionsPage, + ListPostureRevisionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPostureRevisionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListPostureRevisionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListPostureRevisionsPagedResponse(ListPostureRevisionsPage page) { + super(page, ListPostureRevisionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPostureRevisionsPage + extends AbstractPage< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + Posture, + ListPostureRevisionsPage> { + + private ListPostureRevisionsPage( + PageContext context, + ListPostureRevisionsResponse response) { + super(context, response); + } + + private static ListPostureRevisionsPage createEmptyPage() { + return new ListPostureRevisionsPage(null, null); + } + + @Override + protected ListPostureRevisionsPage createPage( + PageContext context, + ListPostureRevisionsResponse response) { + return new ListPostureRevisionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPostureRevisionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + Posture, + ListPostureRevisionsPage, + ListPostureRevisionsFixedSizeCollection> { + + private ListPostureRevisionsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPostureRevisionsFixedSizeCollection createEmptyCollection() { + return new ListPostureRevisionsFixedSizeCollection(null, 0); + } + + @Override + protected ListPostureRevisionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPostureRevisionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListPostureDeploymentsPagedResponse + extends AbstractPagedListResponse< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + PostureDeployment, + ListPostureDeploymentsPage, + ListPostureDeploymentsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListPostureDeploymentsRequest, ListPostureDeploymentsResponse, PostureDeployment> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPostureDeploymentsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListPostureDeploymentsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListPostureDeploymentsPagedResponse(ListPostureDeploymentsPage page) { + super(page, ListPostureDeploymentsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPostureDeploymentsPage + extends AbstractPage< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + PostureDeployment, + ListPostureDeploymentsPage> { + + private ListPostureDeploymentsPage( + PageContext< + ListPostureDeploymentsRequest, ListPostureDeploymentsResponse, PostureDeployment> + context, + ListPostureDeploymentsResponse response) { + super(context, response); + } + + private static ListPostureDeploymentsPage createEmptyPage() { + return new ListPostureDeploymentsPage(null, null); + } + + @Override + protected ListPostureDeploymentsPage createPage( + PageContext< + ListPostureDeploymentsRequest, ListPostureDeploymentsResponse, PostureDeployment> + context, + ListPostureDeploymentsResponse response) { + return new ListPostureDeploymentsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListPostureDeploymentsRequest, ListPostureDeploymentsResponse, PostureDeployment> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPostureDeploymentsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + PostureDeployment, + ListPostureDeploymentsPage, + ListPostureDeploymentsFixedSizeCollection> { + + private ListPostureDeploymentsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPostureDeploymentsFixedSizeCollection createEmptyCollection() { + return new ListPostureDeploymentsFixedSizeCollection(null, 0); + } + + @Override + protected ListPostureDeploymentsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPostureDeploymentsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListPostureTemplatesPagedResponse + extends AbstractPagedListResponse< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + PostureTemplate, + ListPostureTemplatesPage, + ListPostureTemplatesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPostureTemplatesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListPostureTemplatesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListPostureTemplatesPagedResponse(ListPostureTemplatesPage page) { + super(page, ListPostureTemplatesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPostureTemplatesPage + extends AbstractPage< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + PostureTemplate, + ListPostureTemplatesPage> { + + private ListPostureTemplatesPage( + PageContext + context, + ListPostureTemplatesResponse response) { + super(context, response); + } + + private static ListPostureTemplatesPage createEmptyPage() { + return new ListPostureTemplatesPage(null, null); + } + + @Override + protected ListPostureTemplatesPage createPage( + PageContext + context, + ListPostureTemplatesResponse response) { + return new ListPostureTemplatesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPostureTemplatesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + PostureTemplate, + ListPostureTemplatesPage, + ListPostureTemplatesFixedSizeCollection> { + + private ListPostureTemplatesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPostureTemplatesFixedSizeCollection createEmptyCollection() { + return new ListPostureTemplatesFixedSizeCollection(null, 0); + } + + @Override + protected ListPostureTemplatesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPostureTemplatesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureSettings.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureSettings.java new file mode 100644 index 000000000000..bbe3bc18e003 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureSettings.java @@ -0,0 +1,498 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1; + +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListLocationsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureDeploymentsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureRevisionsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureTemplatesPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPosturesPagedResponse; + +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.OperationCallSettings; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.stub.SecurityPostureStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 SecurityPostureClient}. + * + *

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

    + *
  • The default service address (securityposture.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 getPosture 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
+ * SecurityPostureSettings.Builder securityPostureSettingsBuilder =
+ *     SecurityPostureSettings.newBuilder();
+ * securityPostureSettingsBuilder
+ *     .getPostureSettings()
+ *     .setRetrySettings(
+ *         securityPostureSettingsBuilder
+ *             .getPostureSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SecurityPostureSettings securityPostureSettings = securityPostureSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SecurityPostureSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listPostures. */ + public PagedCallSettings + listPosturesSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).listPosturesSettings(); + } + + /** Returns the object with the settings used for calls to listPostureRevisions. */ + public PagedCallSettings< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + ListPostureRevisionsPagedResponse> + listPostureRevisionsSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).listPostureRevisionsSettings(); + } + + /** Returns the object with the settings used for calls to getPosture. */ + public UnaryCallSettings getPostureSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).getPostureSettings(); + } + + /** Returns the object with the settings used for calls to createPosture. */ + public UnaryCallSettings createPostureSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).createPostureSettings(); + } + + /** Returns the object with the settings used for calls to createPosture. */ + public OperationCallSettings + createPostureOperationSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).createPostureOperationSettings(); + } + + /** Returns the object with the settings used for calls to updatePosture. */ + public UnaryCallSettings updatePostureSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).updatePostureSettings(); + } + + /** Returns the object with the settings used for calls to updatePosture. */ + public OperationCallSettings + updatePostureOperationSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).updatePostureOperationSettings(); + } + + /** Returns the object with the settings used for calls to deletePosture. */ + public UnaryCallSettings deletePostureSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).deletePostureSettings(); + } + + /** Returns the object with the settings used for calls to deletePosture. */ + public OperationCallSettings + deletePostureOperationSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).deletePostureOperationSettings(); + } + + /** Returns the object with the settings used for calls to extractPosture. */ + public UnaryCallSettings extractPostureSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).extractPostureSettings(); + } + + /** Returns the object with the settings used for calls to extractPosture. */ + public OperationCallSettings + extractPostureOperationSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).extractPostureOperationSettings(); + } + + /** Returns the object with the settings used for calls to listPostureDeployments. */ + public PagedCallSettings< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + ListPostureDeploymentsPagedResponse> + listPostureDeploymentsSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).listPostureDeploymentsSettings(); + } + + /** Returns the object with the settings used for calls to getPostureDeployment. */ + public UnaryCallSettings + getPostureDeploymentSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).getPostureDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to createPostureDeployment. */ + public UnaryCallSettings + createPostureDeploymentSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).createPostureDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to createPostureDeployment. */ + public OperationCallSettings + createPostureDeploymentOperationSettings() { + return ((SecurityPostureStubSettings) getStubSettings()) + .createPostureDeploymentOperationSettings(); + } + + /** Returns the object with the settings used for calls to updatePostureDeployment. */ + public UnaryCallSettings + updatePostureDeploymentSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).updatePostureDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to updatePostureDeployment. */ + public OperationCallSettings + updatePostureDeploymentOperationSettings() { + return ((SecurityPostureStubSettings) getStubSettings()) + .updatePostureDeploymentOperationSettings(); + } + + /** Returns the object with the settings used for calls to deletePostureDeployment. */ + public UnaryCallSettings + deletePostureDeploymentSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).deletePostureDeploymentSettings(); + } + + /** Returns the object with the settings used for calls to deletePostureDeployment. */ + public OperationCallSettings + deletePostureDeploymentOperationSettings() { + return ((SecurityPostureStubSettings) getStubSettings()) + .deletePostureDeploymentOperationSettings(); + } + + /** Returns the object with the settings used for calls to listPostureTemplates. */ + public PagedCallSettings< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + ListPostureTemplatesPagedResponse> + listPostureTemplatesSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).listPostureTemplatesSettings(); + } + + /** Returns the object with the settings used for calls to getPostureTemplate. */ + public UnaryCallSettings + getPostureTemplateSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).getPostureTemplateSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((SecurityPostureStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final SecurityPostureSettings create(SecurityPostureStubSettings stub) + throws IOException { + return new SecurityPostureSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SecurityPostureStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SecurityPostureStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SecurityPostureStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SecurityPostureStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SecurityPostureStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SecurityPostureStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SecurityPostureStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SecurityPostureStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SecurityPostureSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SecurityPostureSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SecurityPostureStubSettings.newBuilder(clientContext)); + } + + protected Builder(SecurityPostureSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SecurityPostureStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SecurityPostureStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(SecurityPostureStubSettings.newHttpJsonBuilder()); + } + + public SecurityPostureStubSettings.Builder getStubSettingsBuilder() { + return ((SecurityPostureStubSettings.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 listPostures. */ + public PagedCallSettings.Builder< + ListPosturesRequest, ListPosturesResponse, ListPosturesPagedResponse> + listPosturesSettings() { + return getStubSettingsBuilder().listPosturesSettings(); + } + + /** Returns the builder for the settings used for calls to listPostureRevisions. */ + public PagedCallSettings.Builder< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + ListPostureRevisionsPagedResponse> + listPostureRevisionsSettings() { + return getStubSettingsBuilder().listPostureRevisionsSettings(); + } + + /** Returns the builder for the settings used for calls to getPosture. */ + public UnaryCallSettings.Builder getPostureSettings() { + return getStubSettingsBuilder().getPostureSettings(); + } + + /** Returns the builder for the settings used for calls to createPosture. */ + public UnaryCallSettings.Builder createPostureSettings() { + return getStubSettingsBuilder().createPostureSettings(); + } + + /** Returns the builder for the settings used for calls to createPosture. */ + public OperationCallSettings.Builder + createPostureOperationSettings() { + return getStubSettingsBuilder().createPostureOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updatePosture. */ + public UnaryCallSettings.Builder updatePostureSettings() { + return getStubSettingsBuilder().updatePostureSettings(); + } + + /** Returns the builder for the settings used for calls to updatePosture. */ + public OperationCallSettings.Builder + updatePostureOperationSettings() { + return getStubSettingsBuilder().updatePostureOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deletePosture. */ + public UnaryCallSettings.Builder deletePostureSettings() { + return getStubSettingsBuilder().deletePostureSettings(); + } + + /** Returns the builder for the settings used for calls to deletePosture. */ + public OperationCallSettings.Builder + deletePostureOperationSettings() { + return getStubSettingsBuilder().deletePostureOperationSettings(); + } + + /** Returns the builder for the settings used for calls to extractPosture. */ + public UnaryCallSettings.Builder extractPostureSettings() { + return getStubSettingsBuilder().extractPostureSettings(); + } + + /** Returns the builder for the settings used for calls to extractPosture. */ + public OperationCallSettings.Builder + extractPostureOperationSettings() { + return getStubSettingsBuilder().extractPostureOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listPostureDeployments. */ + public PagedCallSettings.Builder< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + ListPostureDeploymentsPagedResponse> + listPostureDeploymentsSettings() { + return getStubSettingsBuilder().listPostureDeploymentsSettings(); + } + + /** Returns the builder for the settings used for calls to getPostureDeployment. */ + public UnaryCallSettings.Builder + getPostureDeploymentSettings() { + return getStubSettingsBuilder().getPostureDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to createPostureDeployment. */ + public UnaryCallSettings.Builder + createPostureDeploymentSettings() { + return getStubSettingsBuilder().createPostureDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to createPostureDeployment. */ + public OperationCallSettings.Builder< + CreatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + createPostureDeploymentOperationSettings() { + return getStubSettingsBuilder().createPostureDeploymentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updatePostureDeployment. */ + public UnaryCallSettings.Builder + updatePostureDeploymentSettings() { + return getStubSettingsBuilder().updatePostureDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to updatePostureDeployment. */ + public OperationCallSettings.Builder< + UpdatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + updatePostureDeploymentOperationSettings() { + return getStubSettingsBuilder().updatePostureDeploymentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deletePostureDeployment. */ + public UnaryCallSettings.Builder + deletePostureDeploymentSettings() { + return getStubSettingsBuilder().deletePostureDeploymentSettings(); + } + + /** Returns the builder for the settings used for calls to deletePostureDeployment. */ + public OperationCallSettings.Builder + deletePostureDeploymentOperationSettings() { + return getStubSettingsBuilder().deletePostureDeploymentOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listPostureTemplates. */ + public PagedCallSettings.Builder< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + ListPostureTemplatesPagedResponse> + listPostureTemplatesSettings() { + return getStubSettingsBuilder().listPostureTemplatesSettings(); + } + + /** Returns the builder for the settings used for calls to getPostureTemplate. */ + public UnaryCallSettings.Builder + getPostureTemplateSettings() { + return getStubSettingsBuilder().getPostureTemplateSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + @Override + public SecurityPostureSettings build() throws IOException { + return new SecurityPostureSettings(this); + } + } +} diff --git a/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/gapic_metadata.json b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/gapic_metadata.json new file mode 100644 index 000000000000..51594e981117 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/gapic_metadata.json @@ -0,0 +1,66 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.securityposture.v1", + "libraryPackage": "com.google.cloud.securityposture.v1", + "services": { + "SecurityPosture": { + "clients": { + "grpc": { + "libraryClient": "SecurityPostureClient", + "rpcs": { + "CreatePosture": { + "methods": ["createPostureAsync", "createPostureAsync", "createPostureAsync", "createPostureOperationCallable", "createPostureCallable"] + }, + "CreatePostureDeployment": { + "methods": ["createPostureDeploymentAsync", "createPostureDeploymentAsync", "createPostureDeploymentAsync", "createPostureDeploymentOperationCallable", "createPostureDeploymentCallable"] + }, + "DeletePosture": { + "methods": ["deletePostureAsync", "deletePostureAsync", "deletePostureAsync", "deletePostureOperationCallable", "deletePostureCallable"] + }, + "DeletePostureDeployment": { + "methods": ["deletePostureDeploymentAsync", "deletePostureDeploymentAsync", "deletePostureDeploymentAsync", "deletePostureDeploymentOperationCallable", "deletePostureDeploymentCallable"] + }, + "ExtractPosture": { + "methods": ["extractPostureAsync", "extractPostureAsync", "extractPostureAsync", "extractPostureOperationCallable", "extractPostureCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetPosture": { + "methods": ["getPosture", "getPosture", "getPosture", "getPostureCallable"] + }, + "GetPostureDeployment": { + "methods": ["getPostureDeployment", "getPostureDeployment", "getPostureDeployment", "getPostureDeploymentCallable"] + }, + "GetPostureTemplate": { + "methods": ["getPostureTemplate", "getPostureTemplate", "getPostureTemplate", "getPostureTemplateCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListPostureDeployments": { + "methods": ["listPostureDeployments", "listPostureDeployments", "listPostureDeployments", "listPostureDeploymentsPagedCallable", "listPostureDeploymentsCallable"] + }, + "ListPostureRevisions": { + "methods": ["listPostureRevisions", "listPostureRevisionsPagedCallable", "listPostureRevisionsCallable"] + }, + "ListPostureTemplates": { + "methods": ["listPostureTemplates", "listPostureTemplates", "listPostureTemplates", "listPostureTemplatesPagedCallable", "listPostureTemplatesCallable"] + }, + "ListPostures": { + "methods": ["listPostures", "listPostures", "listPostures", "listPosturesPagedCallable", "listPosturesCallable"] + }, + "UpdatePosture": { + "methods": ["updatePostureAsync", "updatePostureAsync", "updatePostureOperationCallable", "updatePostureCallable"] + }, + "UpdatePostureDeployment": { + "methods": ["updatePostureDeploymentAsync", "updatePostureDeploymentAsync", "updatePostureDeploymentOperationCallable", "updatePostureDeploymentCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/package-info.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/package-info.java new file mode 100644 index 000000000000..5c80b445ccd1 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/package-info.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. + */ + +/** + * A client to Security Posture API + * + *

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

======================= SecurityPostureClient ======================= + * + *

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

Sample for SecurityPostureClient: + * + *

{@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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
+ *   PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]");
+ *   Posture response = securityPostureClient.getPosture(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.securityposture.v1; + +import javax.annotation.Generated; diff --git a/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/GrpcSecurityPostureCallableFactory.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/GrpcSecurityPostureCallableFactory.java new file mode 100644 index 000000000000..7f59e558311f --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/GrpcSecurityPostureCallableFactory.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.securityposture.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 SecurityPosture service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcSecurityPostureCallableFactory 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-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/GrpcSecurityPostureStub.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/GrpcSecurityPostureStub.java new file mode 100644 index 000000000000..811dab51979c --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/GrpcSecurityPostureStub.java @@ -0,0 +1,842 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.stub; + +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListLocationsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureDeploymentsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureRevisionsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureTemplatesPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPosturesPagedResponse; + +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.CreatePostureRequest; +import com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.DeletePostureRequest; +import com.google.cloud.securityposture.v1.ExtractPostureRequest; +import com.google.cloud.securityposture.v1.GetPostureDeploymentRequest; +import com.google.cloud.securityposture.v1.GetPostureRequest; +import com.google.cloud.securityposture.v1.GetPostureTemplateRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse; +import com.google.cloud.securityposture.v1.ListPostureRevisionsRequest; +import com.google.cloud.securityposture.v1.ListPostureRevisionsResponse; +import com.google.cloud.securityposture.v1.ListPostureTemplatesRequest; +import com.google.cloud.securityposture.v1.ListPostureTemplatesResponse; +import com.google.cloud.securityposture.v1.ListPosturesRequest; +import com.google.cloud.securityposture.v1.ListPosturesResponse; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.UpdatePostureRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +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 SecurityPosture service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcSecurityPostureStub extends SecurityPostureStub { + private static final MethodDescriptor + listPosturesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/ListPostures") + .setRequestMarshaller(ProtoUtils.marshaller(ListPosturesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListPosturesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listPostureRevisionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/ListPostureRevisions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListPostureRevisionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListPostureRevisionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getPostureMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/GetPosture") + .setRequestMarshaller(ProtoUtils.marshaller(GetPostureRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Posture.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createPostureMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/CreatePosture") + .setRequestMarshaller( + ProtoUtils.marshaller(CreatePostureRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updatePostureMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/UpdatePosture") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdatePostureRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deletePostureMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/DeletePosture") + .setRequestMarshaller( + ProtoUtils.marshaller(DeletePostureRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + extractPostureMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/ExtractPosture") + .setRequestMarshaller( + ProtoUtils.marshaller(ExtractPostureRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListPostureDeploymentsRequest, ListPostureDeploymentsResponse> + listPostureDeploymentsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/ListPostureDeployments") + .setRequestMarshaller( + ProtoUtils.marshaller(ListPostureDeploymentsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListPostureDeploymentsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getPostureDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/GetPostureDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(GetPostureDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PostureDeployment.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createPostureDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/CreatePostureDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(CreatePostureDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updatePostureDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/UpdatePostureDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdatePostureDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deletePostureDeploymentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/DeletePostureDeployment") + .setRequestMarshaller( + ProtoUtils.marshaller(DeletePostureDeploymentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listPostureTemplatesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/ListPostureTemplates") + .setRequestMarshaller( + ProtoUtils.marshaller(ListPostureTemplatesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListPostureTemplatesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getPostureTemplateMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/GetPostureTemplate") + .setRequestMarshaller( + ProtoUtils.marshaller(GetPostureTemplateRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PostureTemplate.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .build(); + + private final UnaryCallable listPosturesCallable; + private final UnaryCallable + listPosturesPagedCallable; + private final UnaryCallable + listPostureRevisionsCallable; + private final UnaryCallable + listPostureRevisionsPagedCallable; + private final UnaryCallable getPostureCallable; + private final UnaryCallable createPostureCallable; + private final OperationCallable + createPostureOperationCallable; + private final UnaryCallable updatePostureCallable; + private final OperationCallable + updatePostureOperationCallable; + private final UnaryCallable deletePostureCallable; + private final OperationCallable + deletePostureOperationCallable; + private final UnaryCallable extractPostureCallable; + private final OperationCallable + extractPostureOperationCallable; + private final UnaryCallable + listPostureDeploymentsCallable; + private final UnaryCallable + listPostureDeploymentsPagedCallable; + private final UnaryCallable + getPostureDeploymentCallable; + private final UnaryCallable + createPostureDeploymentCallable; + private final OperationCallable< + CreatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + createPostureDeploymentOperationCallable; + private final UnaryCallable + updatePostureDeploymentCallable; + private final OperationCallable< + UpdatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + updatePostureDeploymentOperationCallable; + private final UnaryCallable + deletePostureDeploymentCallable; + private final OperationCallable + deletePostureDeploymentOperationCallable; + private final UnaryCallable + listPostureTemplatesCallable; + private final UnaryCallable + listPostureTemplatesPagedCallable; + private final UnaryCallable + getPostureTemplateCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSecurityPostureStub create(SecurityPostureStubSettings settings) + throws IOException { + return new GrpcSecurityPostureStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSecurityPostureStub create(ClientContext clientContext) + throws IOException { + return new GrpcSecurityPostureStub( + SecurityPostureStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSecurityPostureStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSecurityPostureStub( + SecurityPostureStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSecurityPostureStub, 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 GrpcSecurityPostureStub( + SecurityPostureStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcSecurityPostureCallableFactory()); + } + + /** + * Constructs an instance of GrpcSecurityPostureStub, 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 GrpcSecurityPostureStub( + SecurityPostureStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listPosturesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPosturesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listPostureRevisionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPostureRevisionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getPostureTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPostureMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createPostureTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createPostureMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updatePostureTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updatePostureMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("posture.name", String.valueOf(request.getPosture().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deletePostureTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePostureMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings extractPostureTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(extractPostureMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listPostureDeploymentsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listPostureDeploymentsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getPostureDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPostureDeploymentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + createPostureDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createPostureDeploymentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + updatePostureDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updatePostureDeploymentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "posture_deployment.name", + String.valueOf(request.getPostureDeployment().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + deletePostureDeploymentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePostureDeploymentMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listPostureTemplatesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPostureTemplatesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getPostureTemplateTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPostureTemplateMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listPosturesCallable = + callableFactory.createUnaryCallable( + listPosturesTransportSettings, settings.listPosturesSettings(), clientContext); + this.listPosturesPagedCallable = + callableFactory.createPagedCallable( + listPosturesTransportSettings, settings.listPosturesSettings(), clientContext); + this.listPostureRevisionsCallable = + callableFactory.createUnaryCallable( + listPostureRevisionsTransportSettings, + settings.listPostureRevisionsSettings(), + clientContext); + this.listPostureRevisionsPagedCallable = + callableFactory.createPagedCallable( + listPostureRevisionsTransportSettings, + settings.listPostureRevisionsSettings(), + clientContext); + this.getPostureCallable = + callableFactory.createUnaryCallable( + getPostureTransportSettings, settings.getPostureSettings(), clientContext); + this.createPostureCallable = + callableFactory.createUnaryCallable( + createPostureTransportSettings, settings.createPostureSettings(), clientContext); + this.createPostureOperationCallable = + callableFactory.createOperationCallable( + createPostureTransportSettings, + settings.createPostureOperationSettings(), + clientContext, + operationsStub); + this.updatePostureCallable = + callableFactory.createUnaryCallable( + updatePostureTransportSettings, settings.updatePostureSettings(), clientContext); + this.updatePostureOperationCallable = + callableFactory.createOperationCallable( + updatePostureTransportSettings, + settings.updatePostureOperationSettings(), + clientContext, + operationsStub); + this.deletePostureCallable = + callableFactory.createUnaryCallable( + deletePostureTransportSettings, settings.deletePostureSettings(), clientContext); + this.deletePostureOperationCallable = + callableFactory.createOperationCallable( + deletePostureTransportSettings, + settings.deletePostureOperationSettings(), + clientContext, + operationsStub); + this.extractPostureCallable = + callableFactory.createUnaryCallable( + extractPostureTransportSettings, settings.extractPostureSettings(), clientContext); + this.extractPostureOperationCallable = + callableFactory.createOperationCallable( + extractPostureTransportSettings, + settings.extractPostureOperationSettings(), + clientContext, + operationsStub); + this.listPostureDeploymentsCallable = + callableFactory.createUnaryCallable( + listPostureDeploymentsTransportSettings, + settings.listPostureDeploymentsSettings(), + clientContext); + this.listPostureDeploymentsPagedCallable = + callableFactory.createPagedCallable( + listPostureDeploymentsTransportSettings, + settings.listPostureDeploymentsSettings(), + clientContext); + this.getPostureDeploymentCallable = + callableFactory.createUnaryCallable( + getPostureDeploymentTransportSettings, + settings.getPostureDeploymentSettings(), + clientContext); + this.createPostureDeploymentCallable = + callableFactory.createUnaryCallable( + createPostureDeploymentTransportSettings, + settings.createPostureDeploymentSettings(), + clientContext); + this.createPostureDeploymentOperationCallable = + callableFactory.createOperationCallable( + createPostureDeploymentTransportSettings, + settings.createPostureDeploymentOperationSettings(), + clientContext, + operationsStub); + this.updatePostureDeploymentCallable = + callableFactory.createUnaryCallable( + updatePostureDeploymentTransportSettings, + settings.updatePostureDeploymentSettings(), + clientContext); + this.updatePostureDeploymentOperationCallable = + callableFactory.createOperationCallable( + updatePostureDeploymentTransportSettings, + settings.updatePostureDeploymentOperationSettings(), + clientContext, + operationsStub); + this.deletePostureDeploymentCallable = + callableFactory.createUnaryCallable( + deletePostureDeploymentTransportSettings, + settings.deletePostureDeploymentSettings(), + clientContext); + this.deletePostureDeploymentOperationCallable = + callableFactory.createOperationCallable( + deletePostureDeploymentTransportSettings, + settings.deletePostureDeploymentOperationSettings(), + clientContext, + operationsStub); + this.listPostureTemplatesCallable = + callableFactory.createUnaryCallable( + listPostureTemplatesTransportSettings, + settings.listPostureTemplatesSettings(), + clientContext); + this.listPostureTemplatesPagedCallable = + callableFactory.createPagedCallable( + listPostureTemplatesTransportSettings, + settings.listPostureTemplatesSettings(), + clientContext); + this.getPostureTemplateCallable = + callableFactory.createUnaryCallable( + getPostureTemplateTransportSettings, + settings.getPostureTemplateSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listPosturesCallable() { + return listPosturesCallable; + } + + @Override + public UnaryCallable listPosturesPagedCallable() { + return listPosturesPagedCallable; + } + + @Override + public UnaryCallable + listPostureRevisionsCallable() { + return listPostureRevisionsCallable; + } + + @Override + public UnaryCallable + listPostureRevisionsPagedCallable() { + return listPostureRevisionsPagedCallable; + } + + @Override + public UnaryCallable getPostureCallable() { + return getPostureCallable; + } + + @Override + public UnaryCallable createPostureCallable() { + return createPostureCallable; + } + + @Override + public OperationCallable + createPostureOperationCallable() { + return createPostureOperationCallable; + } + + @Override + public UnaryCallable updatePostureCallable() { + return updatePostureCallable; + } + + @Override + public OperationCallable + updatePostureOperationCallable() { + return updatePostureOperationCallable; + } + + @Override + public UnaryCallable deletePostureCallable() { + return deletePostureCallable; + } + + @Override + public OperationCallable + deletePostureOperationCallable() { + return deletePostureOperationCallable; + } + + @Override + public UnaryCallable extractPostureCallable() { + return extractPostureCallable; + } + + @Override + public OperationCallable + extractPostureOperationCallable() { + return extractPostureOperationCallable; + } + + @Override + public UnaryCallable + listPostureDeploymentsCallable() { + return listPostureDeploymentsCallable; + } + + @Override + public UnaryCallable + listPostureDeploymentsPagedCallable() { + return listPostureDeploymentsPagedCallable; + } + + @Override + public UnaryCallable + getPostureDeploymentCallable() { + return getPostureDeploymentCallable; + } + + @Override + public UnaryCallable + createPostureDeploymentCallable() { + return createPostureDeploymentCallable; + } + + @Override + public OperationCallable + createPostureDeploymentOperationCallable() { + return createPostureDeploymentOperationCallable; + } + + @Override + public UnaryCallable + updatePostureDeploymentCallable() { + return updatePostureDeploymentCallable; + } + + @Override + public OperationCallable + updatePostureDeploymentOperationCallable() { + return updatePostureDeploymentOperationCallable; + } + + @Override + public UnaryCallable + deletePostureDeploymentCallable() { + return deletePostureDeploymentCallable; + } + + @Override + public OperationCallable + deletePostureDeploymentOperationCallable() { + return deletePostureDeploymentOperationCallable; + } + + @Override + public UnaryCallable + listPostureTemplatesCallable() { + return listPostureTemplatesCallable; + } + + @Override + public UnaryCallable + listPostureTemplatesPagedCallable() { + return listPostureTemplatesPagedCallable; + } + + @Override + public UnaryCallable getPostureTemplateCallable() { + return getPostureTemplateCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/HttpJsonSecurityPostureCallableFactory.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/HttpJsonSecurityPostureCallableFactory.java new file mode 100644 index 000000000000..5beb92641751 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/HttpJsonSecurityPostureCallableFactory.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.securityposture.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the SecurityPosture service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonSecurityPostureCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/HttpJsonSecurityPostureStub.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/HttpJsonSecurityPostureStub.java new file mode 100644 index 000000000000..9fb6b372c48a --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/HttpJsonSecurityPostureStub.java @@ -0,0 +1,1379 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.stub; + +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListLocationsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureDeploymentsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureRevisionsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureTemplatesPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPosturesPagedResponse; + +import com.google.api.HttpRule; +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.HttpJsonOperationSnapshot; +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.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.CreatePostureRequest; +import com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.DeletePostureRequest; +import com.google.cloud.securityposture.v1.ExtractPostureRequest; +import com.google.cloud.securityposture.v1.GetPostureDeploymentRequest; +import com.google.cloud.securityposture.v1.GetPostureRequest; +import com.google.cloud.securityposture.v1.GetPostureTemplateRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse; +import com.google.cloud.securityposture.v1.ListPostureRevisionsRequest; +import com.google.cloud.securityposture.v1.ListPostureRevisionsResponse; +import com.google.cloud.securityposture.v1.ListPostureTemplatesRequest; +import com.google.cloud.securityposture.v1.ListPostureTemplatesResponse; +import com.google.cloud.securityposture.v1.ListPosturesRequest; +import com.google.cloud.securityposture.v1.ListPosturesResponse; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.UpdatePostureRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 SecurityPosture service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonSecurityPostureStub extends SecurityPostureStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Posture.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(PostureDeployment.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listPosturesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/ListPostures") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/postures", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListPosturesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListPostureRevisionsRequest, ListPostureRevisionsResponse> + listPostureRevisionsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/ListPostureRevisions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/postures/*}:listRevisions", + 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, "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(ListPostureRevisionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor getPostureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/GetPosture") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/postures/*}", + 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, "revisionId", request.getRevisionId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Posture.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createPostureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/CreatePosture") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/postures", + 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, "postureId", request.getPostureId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("posture", request.getPosture(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreatePostureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updatePostureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/UpdatePosture") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{posture.name=organizations/*/locations/*/postures/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "posture.name", request.getPosture().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "revisionId", request.getRevisionId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("posture", request.getPosture(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdatePostureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deletePostureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/DeletePosture") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/postures/*}", + 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, "etag", request.getEtag()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeletePostureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + extractPostureMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.securityposture.v1.SecurityPosture/ExtractPosture") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/postures:extract", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ExtractPostureRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + ListPostureDeploymentsRequest, ListPostureDeploymentsResponse> + listPostureDeploymentsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/ListPostureDeployments") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/postureDeployments", + 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, "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(ListPostureDeploymentsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getPostureDeploymentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/GetPostureDeployment") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/postureDeployments/*}", + 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(PostureDeployment.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createPostureDeploymentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/CreatePostureDeployment") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/postureDeployments", + 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, "postureDeploymentId", request.getPostureDeploymentId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "postureDeployment", request.getPostureDeployment(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreatePostureDeploymentRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updatePostureDeploymentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/UpdatePostureDeployment") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{postureDeployment.name=organizations/*/locations/*/postureDeployments/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "postureDeployment.name", + request.getPostureDeployment().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "postureDeployment", request.getPostureDeployment(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdatePostureDeploymentRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deletePostureDeploymentMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/DeletePostureDeployment") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/postureDeployments/*}", + 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, "etag", request.getEtag()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeletePostureDeploymentRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor< + ListPostureTemplatesRequest, ListPostureTemplatesResponse> + listPostureTemplatesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/ListPostureTemplates") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=organizations/*/locations/*}/postureTemplates", + 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, "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(ListPostureTemplatesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getPostureTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.securityposture.v1.SecurityPosture/GetPostureTemplate") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*/postureTemplates/*}", + 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, "revisionId", request.getRevisionId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PostureTemplate.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*}/locations", + 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(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=organizations/*/locations/*}", + 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(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listPosturesCallable; + private final UnaryCallable + listPosturesPagedCallable; + private final UnaryCallable + listPostureRevisionsCallable; + private final UnaryCallable + listPostureRevisionsPagedCallable; + private final UnaryCallable getPostureCallable; + private final UnaryCallable createPostureCallable; + private final OperationCallable + createPostureOperationCallable; + private final UnaryCallable updatePostureCallable; + private final OperationCallable + updatePostureOperationCallable; + private final UnaryCallable deletePostureCallable; + private final OperationCallable + deletePostureOperationCallable; + private final UnaryCallable extractPostureCallable; + private final OperationCallable + extractPostureOperationCallable; + private final UnaryCallable + listPostureDeploymentsCallable; + private final UnaryCallable + listPostureDeploymentsPagedCallable; + private final UnaryCallable + getPostureDeploymentCallable; + private final UnaryCallable + createPostureDeploymentCallable; + private final OperationCallable< + CreatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + createPostureDeploymentOperationCallable; + private final UnaryCallable + updatePostureDeploymentCallable; + private final OperationCallable< + UpdatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + updatePostureDeploymentOperationCallable; + private final UnaryCallable + deletePostureDeploymentCallable; + private final OperationCallable + deletePostureDeploymentOperationCallable; + private final UnaryCallable + listPostureTemplatesCallable; + private final UnaryCallable + listPostureTemplatesPagedCallable; + private final UnaryCallable + getPostureTemplateCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSecurityPostureStub create(SecurityPostureStubSettings settings) + throws IOException { + return new HttpJsonSecurityPostureStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSecurityPostureStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonSecurityPostureStub( + SecurityPostureStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSecurityPostureStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSecurityPostureStub( + SecurityPostureStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSecurityPostureStub, 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 HttpJsonSecurityPostureStub( + SecurityPostureStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonSecurityPostureCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSecurityPostureStub, 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 HttpJsonSecurityPostureStub( + SecurityPostureStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1/{name=organizations/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1/{name=organizations/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1/{name=organizations/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1/{name=organizations/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings listPosturesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listPosturesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listPostureRevisionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listPostureRevisionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getPostureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPostureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createPostureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createPostureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updatePostureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updatePostureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("posture.name", String.valueOf(request.getPosture().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deletePostureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deletePostureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings extractPostureTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(extractPostureMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listPostureDeploymentsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listPostureDeploymentsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getPostureDeploymentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPostureDeploymentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + createPostureDeploymentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createPostureDeploymentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + updatePostureDeploymentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updatePostureDeploymentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "posture_deployment.name", + String.valueOf(request.getPostureDeployment().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + deletePostureDeploymentTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deletePostureDeploymentMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listPostureTemplatesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listPostureTemplatesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getPostureTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPostureTemplateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + + this.listPosturesCallable = + callableFactory.createUnaryCallable( + listPosturesTransportSettings, settings.listPosturesSettings(), clientContext); + this.listPosturesPagedCallable = + callableFactory.createPagedCallable( + listPosturesTransportSettings, settings.listPosturesSettings(), clientContext); + this.listPostureRevisionsCallable = + callableFactory.createUnaryCallable( + listPostureRevisionsTransportSettings, + settings.listPostureRevisionsSettings(), + clientContext); + this.listPostureRevisionsPagedCallable = + callableFactory.createPagedCallable( + listPostureRevisionsTransportSettings, + settings.listPostureRevisionsSettings(), + clientContext); + this.getPostureCallable = + callableFactory.createUnaryCallable( + getPostureTransportSettings, settings.getPostureSettings(), clientContext); + this.createPostureCallable = + callableFactory.createUnaryCallable( + createPostureTransportSettings, settings.createPostureSettings(), clientContext); + this.createPostureOperationCallable = + callableFactory.createOperationCallable( + createPostureTransportSettings, + settings.createPostureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updatePostureCallable = + callableFactory.createUnaryCallable( + updatePostureTransportSettings, settings.updatePostureSettings(), clientContext); + this.updatePostureOperationCallable = + callableFactory.createOperationCallable( + updatePostureTransportSettings, + settings.updatePostureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deletePostureCallable = + callableFactory.createUnaryCallable( + deletePostureTransportSettings, settings.deletePostureSettings(), clientContext); + this.deletePostureOperationCallable = + callableFactory.createOperationCallable( + deletePostureTransportSettings, + settings.deletePostureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.extractPostureCallable = + callableFactory.createUnaryCallable( + extractPostureTransportSettings, settings.extractPostureSettings(), clientContext); + this.extractPostureOperationCallable = + callableFactory.createOperationCallable( + extractPostureTransportSettings, + settings.extractPostureOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listPostureDeploymentsCallable = + callableFactory.createUnaryCallable( + listPostureDeploymentsTransportSettings, + settings.listPostureDeploymentsSettings(), + clientContext); + this.listPostureDeploymentsPagedCallable = + callableFactory.createPagedCallable( + listPostureDeploymentsTransportSettings, + settings.listPostureDeploymentsSettings(), + clientContext); + this.getPostureDeploymentCallable = + callableFactory.createUnaryCallable( + getPostureDeploymentTransportSettings, + settings.getPostureDeploymentSettings(), + clientContext); + this.createPostureDeploymentCallable = + callableFactory.createUnaryCallable( + createPostureDeploymentTransportSettings, + settings.createPostureDeploymentSettings(), + clientContext); + this.createPostureDeploymentOperationCallable = + callableFactory.createOperationCallable( + createPostureDeploymentTransportSettings, + settings.createPostureDeploymentOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updatePostureDeploymentCallable = + callableFactory.createUnaryCallable( + updatePostureDeploymentTransportSettings, + settings.updatePostureDeploymentSettings(), + clientContext); + this.updatePostureDeploymentOperationCallable = + callableFactory.createOperationCallable( + updatePostureDeploymentTransportSettings, + settings.updatePostureDeploymentOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deletePostureDeploymentCallable = + callableFactory.createUnaryCallable( + deletePostureDeploymentTransportSettings, + settings.deletePostureDeploymentSettings(), + clientContext); + this.deletePostureDeploymentOperationCallable = + callableFactory.createOperationCallable( + deletePostureDeploymentTransportSettings, + settings.deletePostureDeploymentOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.listPostureTemplatesCallable = + callableFactory.createUnaryCallable( + listPostureTemplatesTransportSettings, + settings.listPostureTemplatesSettings(), + clientContext); + this.listPostureTemplatesPagedCallable = + callableFactory.createPagedCallable( + listPostureTemplatesTransportSettings, + settings.listPostureTemplatesSettings(), + clientContext); + this.getPostureTemplateCallable = + callableFactory.createUnaryCallable( + getPostureTemplateTransportSettings, + settings.getPostureTemplateSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listPosturesMethodDescriptor); + methodDescriptors.add(listPostureRevisionsMethodDescriptor); + methodDescriptors.add(getPostureMethodDescriptor); + methodDescriptors.add(createPostureMethodDescriptor); + methodDescriptors.add(updatePostureMethodDescriptor); + methodDescriptors.add(deletePostureMethodDescriptor); + methodDescriptors.add(extractPostureMethodDescriptor); + methodDescriptors.add(listPostureDeploymentsMethodDescriptor); + methodDescriptors.add(getPostureDeploymentMethodDescriptor); + methodDescriptors.add(createPostureDeploymentMethodDescriptor); + methodDescriptors.add(updatePostureDeploymentMethodDescriptor); + methodDescriptors.add(deletePostureDeploymentMethodDescriptor); + methodDescriptors.add(listPostureTemplatesMethodDescriptor); + methodDescriptors.add(getPostureTemplateMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listPosturesCallable() { + return listPosturesCallable; + } + + @Override + public UnaryCallable listPosturesPagedCallable() { + return listPosturesPagedCallable; + } + + @Override + public UnaryCallable + listPostureRevisionsCallable() { + return listPostureRevisionsCallable; + } + + @Override + public UnaryCallable + listPostureRevisionsPagedCallable() { + return listPostureRevisionsPagedCallable; + } + + @Override + public UnaryCallable getPostureCallable() { + return getPostureCallable; + } + + @Override + public UnaryCallable createPostureCallable() { + return createPostureCallable; + } + + @Override + public OperationCallable + createPostureOperationCallable() { + return createPostureOperationCallable; + } + + @Override + public UnaryCallable updatePostureCallable() { + return updatePostureCallable; + } + + @Override + public OperationCallable + updatePostureOperationCallable() { + return updatePostureOperationCallable; + } + + @Override + public UnaryCallable deletePostureCallable() { + return deletePostureCallable; + } + + @Override + public OperationCallable + deletePostureOperationCallable() { + return deletePostureOperationCallable; + } + + @Override + public UnaryCallable extractPostureCallable() { + return extractPostureCallable; + } + + @Override + public OperationCallable + extractPostureOperationCallable() { + return extractPostureOperationCallable; + } + + @Override + public UnaryCallable + listPostureDeploymentsCallable() { + return listPostureDeploymentsCallable; + } + + @Override + public UnaryCallable + listPostureDeploymentsPagedCallable() { + return listPostureDeploymentsPagedCallable; + } + + @Override + public UnaryCallable + getPostureDeploymentCallable() { + return getPostureDeploymentCallable; + } + + @Override + public UnaryCallable + createPostureDeploymentCallable() { + return createPostureDeploymentCallable; + } + + @Override + public OperationCallable + createPostureDeploymentOperationCallable() { + return createPostureDeploymentOperationCallable; + } + + @Override + public UnaryCallable + updatePostureDeploymentCallable() { + return updatePostureDeploymentCallable; + } + + @Override + public OperationCallable + updatePostureDeploymentOperationCallable() { + return updatePostureDeploymentOperationCallable; + } + + @Override + public UnaryCallable + deletePostureDeploymentCallable() { + return deletePostureDeploymentCallable; + } + + @Override + public OperationCallable + deletePostureDeploymentOperationCallable() { + return deletePostureDeploymentOperationCallable; + } + + @Override + public UnaryCallable + listPostureTemplatesCallable() { + return listPostureTemplatesCallable; + } + + @Override + public UnaryCallable + listPostureTemplatesPagedCallable() { + return listPostureTemplatesPagedCallable; + } + + @Override + public UnaryCallable getPostureTemplateCallable() { + return getPostureTemplateCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @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-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/SecurityPostureStub.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/SecurityPostureStub.java new file mode 100644 index 000000000000..4fd80cb8e7ff --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/SecurityPostureStub.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.securityposture.v1.stub; + +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListLocationsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureDeploymentsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureRevisionsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureTemplatesPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPosturesPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.CreatePostureRequest; +import com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.DeletePostureRequest; +import com.google.cloud.securityposture.v1.ExtractPostureRequest; +import com.google.cloud.securityposture.v1.GetPostureDeploymentRequest; +import com.google.cloud.securityposture.v1.GetPostureRequest; +import com.google.cloud.securityposture.v1.GetPostureTemplateRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse; +import com.google.cloud.securityposture.v1.ListPostureRevisionsRequest; +import com.google.cloud.securityposture.v1.ListPostureRevisionsResponse; +import com.google.cloud.securityposture.v1.ListPostureTemplatesRequest; +import com.google.cloud.securityposture.v1.ListPostureTemplatesResponse; +import com.google.cloud.securityposture.v1.ListPosturesRequest; +import com.google.cloud.securityposture.v1.ListPosturesResponse; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.UpdatePostureRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SecurityPosture service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class SecurityPostureStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable listPosturesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPosturesPagedCallable()"); + } + + public UnaryCallable listPosturesCallable() { + throw new UnsupportedOperationException("Not implemented: listPosturesCallable()"); + } + + public UnaryCallable + listPostureRevisionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPostureRevisionsPagedCallable()"); + } + + public UnaryCallable + listPostureRevisionsCallable() { + throw new UnsupportedOperationException("Not implemented: listPostureRevisionsCallable()"); + } + + public UnaryCallable getPostureCallable() { + throw new UnsupportedOperationException("Not implemented: getPostureCallable()"); + } + + public OperationCallable + createPostureOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createPostureOperationCallable()"); + } + + public UnaryCallable createPostureCallable() { + throw new UnsupportedOperationException("Not implemented: createPostureCallable()"); + } + + public OperationCallable + updatePostureOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updatePostureOperationCallable()"); + } + + public UnaryCallable updatePostureCallable() { + throw new UnsupportedOperationException("Not implemented: updatePostureCallable()"); + } + + public OperationCallable + deletePostureOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deletePostureOperationCallable()"); + } + + public UnaryCallable deletePostureCallable() { + throw new UnsupportedOperationException("Not implemented: deletePostureCallable()"); + } + + public OperationCallable + extractPostureOperationCallable() { + throw new UnsupportedOperationException("Not implemented: extractPostureOperationCallable()"); + } + + public UnaryCallable extractPostureCallable() { + throw new UnsupportedOperationException("Not implemented: extractPostureCallable()"); + } + + public UnaryCallable + listPostureDeploymentsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listPostureDeploymentsPagedCallable()"); + } + + public UnaryCallable + listPostureDeploymentsCallable() { + throw new UnsupportedOperationException("Not implemented: listPostureDeploymentsCallable()"); + } + + public UnaryCallable + getPostureDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: getPostureDeploymentCallable()"); + } + + public OperationCallable + createPostureDeploymentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createPostureDeploymentOperationCallable()"); + } + + public UnaryCallable + createPostureDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: createPostureDeploymentCallable()"); + } + + public OperationCallable + updatePostureDeploymentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updatePostureDeploymentOperationCallable()"); + } + + public UnaryCallable + updatePostureDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: updatePostureDeploymentCallable()"); + } + + public OperationCallable + deletePostureDeploymentOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: deletePostureDeploymentOperationCallable()"); + } + + public UnaryCallable + deletePostureDeploymentCallable() { + throw new UnsupportedOperationException("Not implemented: deletePostureDeploymentCallable()"); + } + + public UnaryCallable + listPostureTemplatesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPostureTemplatesPagedCallable()"); + } + + public UnaryCallable + listPostureTemplatesCallable() { + throw new UnsupportedOperationException("Not implemented: listPostureTemplatesCallable()"); + } + + public UnaryCallable getPostureTemplateCallable() { + throw new UnsupportedOperationException("Not implemented: getPostureTemplateCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/SecurityPostureStubSettings.java b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/SecurityPostureStubSettings.java new file mode 100644 index 000000000000..e15177f18270 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/java/com/google/cloud/securityposture/v1/stub/SecurityPostureStubSettings.java @@ -0,0 +1,1442 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.stub; + +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListLocationsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureDeploymentsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureRevisionsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureTemplatesPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPosturesPagedResponse; + +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.grpc.ProtoOperationTransformers; +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.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +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.OperationCallSettings; +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.CreatePostureRequest; +import com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.DeletePostureRequest; +import com.google.cloud.securityposture.v1.ExtractPostureRequest; +import com.google.cloud.securityposture.v1.GetPostureDeploymentRequest; +import com.google.cloud.securityposture.v1.GetPostureRequest; +import com.google.cloud.securityposture.v1.GetPostureTemplateRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse; +import com.google.cloud.securityposture.v1.ListPostureRevisionsRequest; +import com.google.cloud.securityposture.v1.ListPostureRevisionsResponse; +import com.google.cloud.securityposture.v1.ListPostureTemplatesRequest; +import com.google.cloud.securityposture.v1.ListPostureTemplatesResponse; +import com.google.cloud.securityposture.v1.ListPosturesRequest; +import com.google.cloud.securityposture.v1.ListPosturesResponse; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.UpdatePostureRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 SecurityPostureStub}. + * + *

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

    + *
  • The default service address (securityposture.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 getPosture 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
+ * SecurityPostureStubSettings.Builder securityPostureSettingsBuilder =
+ *     SecurityPostureStubSettings.newBuilder();
+ * securityPostureSettingsBuilder
+ *     .getPostureSettings()
+ *     .setRetrySettings(
+ *         securityPostureSettingsBuilder
+ *             .getPostureSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SecurityPostureStubSettings securityPostureSettings = securityPostureSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SecurityPostureStubSettings 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< + ListPosturesRequest, ListPosturesResponse, ListPosturesPagedResponse> + listPosturesSettings; + private final PagedCallSettings< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + ListPostureRevisionsPagedResponse> + listPostureRevisionsSettings; + private final UnaryCallSettings getPostureSettings; + private final UnaryCallSettings createPostureSettings; + private final OperationCallSettings + createPostureOperationSettings; + private final UnaryCallSettings updatePostureSettings; + private final OperationCallSettings + updatePostureOperationSettings; + private final UnaryCallSettings deletePostureSettings; + private final OperationCallSettings + deletePostureOperationSettings; + private final UnaryCallSettings extractPostureSettings; + private final OperationCallSettings + extractPostureOperationSettings; + private final PagedCallSettings< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + ListPostureDeploymentsPagedResponse> + listPostureDeploymentsSettings; + private final UnaryCallSettings + getPostureDeploymentSettings; + private final UnaryCallSettings + createPostureDeploymentSettings; + private final OperationCallSettings< + CreatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + createPostureDeploymentOperationSettings; + private final UnaryCallSettings + updatePostureDeploymentSettings; + private final OperationCallSettings< + UpdatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + updatePostureDeploymentOperationSettings; + private final UnaryCallSettings + deletePostureDeploymentSettings; + private final OperationCallSettings + deletePostureDeploymentOperationSettings; + private final PagedCallSettings< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + ListPostureTemplatesPagedResponse> + listPostureTemplatesSettings; + private final UnaryCallSettings + getPostureTemplateSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_POSTURES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPosturesRequest injectToken(ListPosturesRequest payload, String token) { + return ListPosturesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPosturesRequest injectPageSize(ListPosturesRequest payload, int pageSize) { + return ListPosturesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPosturesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPosturesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPosturesResponse payload) { + return payload.getPosturesList() == null + ? ImmutableList.of() + : payload.getPosturesList(); + } + }; + + private static final PagedListDescriptor< + ListPostureRevisionsRequest, ListPostureRevisionsResponse, Posture> + LIST_POSTURE_REVISIONS_PAGE_STR_DESC = + new PagedListDescriptor< + ListPostureRevisionsRequest, ListPostureRevisionsResponse, Posture>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPostureRevisionsRequest injectToken( + ListPostureRevisionsRequest payload, String token) { + return ListPostureRevisionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPostureRevisionsRequest injectPageSize( + ListPostureRevisionsRequest payload, int pageSize) { + return ListPostureRevisionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPostureRevisionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPostureRevisionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPostureRevisionsResponse payload) { + return payload.getRevisionsList() == null + ? ImmutableList.of() + : payload.getRevisionsList(); + } + }; + + private static final PagedListDescriptor< + ListPostureDeploymentsRequest, ListPostureDeploymentsResponse, PostureDeployment> + LIST_POSTURE_DEPLOYMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListPostureDeploymentsRequest, ListPostureDeploymentsResponse, PostureDeployment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPostureDeploymentsRequest injectToken( + ListPostureDeploymentsRequest payload, String token) { + return ListPostureDeploymentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPostureDeploymentsRequest injectPageSize( + ListPostureDeploymentsRequest payload, int pageSize) { + return ListPostureDeploymentsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListPostureDeploymentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPostureDeploymentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListPostureDeploymentsResponse payload) { + return payload.getPostureDeploymentsList() == null + ? ImmutableList.of() + : payload.getPostureDeploymentsList(); + } + }; + + private static final PagedListDescriptor< + ListPostureTemplatesRequest, ListPostureTemplatesResponse, PostureTemplate> + LIST_POSTURE_TEMPLATES_PAGE_STR_DESC = + new PagedListDescriptor< + ListPostureTemplatesRequest, ListPostureTemplatesResponse, PostureTemplate>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPostureTemplatesRequest injectToken( + ListPostureTemplatesRequest payload, String token) { + return ListPostureTemplatesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPostureTemplatesRequest injectPageSize( + ListPostureTemplatesRequest payload, int pageSize) { + return ListPostureTemplatesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPostureTemplatesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPostureTemplatesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListPostureTemplatesResponse payload) { + return payload.getPostureTemplatesList() == null + ? ImmutableList.of() + : payload.getPostureTemplatesList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListPosturesRequest, ListPosturesResponse, ListPosturesPagedResponse> + LIST_POSTURES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPosturesRequest, ListPosturesResponse, ListPosturesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPosturesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_POSTURES_PAGE_STR_DESC, request, context); + return ListPosturesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + ListPostureRevisionsPagedResponse> + LIST_POSTURE_REVISIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + ListPostureRevisionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPostureRevisionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_POSTURE_REVISIONS_PAGE_STR_DESC, request, context); + return ListPostureRevisionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + ListPostureDeploymentsPagedResponse> + LIST_POSTURE_DEPLOYMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + ListPostureDeploymentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListPostureDeploymentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + PostureDeployment> + pageContext = + PageContext.create( + callable, LIST_POSTURE_DEPLOYMENTS_PAGE_STR_DESC, request, context); + return ListPostureDeploymentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + ListPostureTemplatesPagedResponse> + LIST_POSTURE_TEMPLATES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + ListPostureTemplatesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPostureTemplatesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListPostureTemplatesRequest, ListPostureTemplatesResponse, PostureTemplate> + pageContext = + PageContext.create( + callable, LIST_POSTURE_TEMPLATES_PAGE_STR_DESC, request, context); + return ListPostureTemplatesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listPostures. */ + public PagedCallSettings + listPosturesSettings() { + return listPosturesSettings; + } + + /** Returns the object with the settings used for calls to listPostureRevisions. */ + public PagedCallSettings< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + ListPostureRevisionsPagedResponse> + listPostureRevisionsSettings() { + return listPostureRevisionsSettings; + } + + /** Returns the object with the settings used for calls to getPosture. */ + public UnaryCallSettings getPostureSettings() { + return getPostureSettings; + } + + /** Returns the object with the settings used for calls to createPosture. */ + public UnaryCallSettings createPostureSettings() { + return createPostureSettings; + } + + /** Returns the object with the settings used for calls to createPosture. */ + public OperationCallSettings + createPostureOperationSettings() { + return createPostureOperationSettings; + } + + /** Returns the object with the settings used for calls to updatePosture. */ + public UnaryCallSettings updatePostureSettings() { + return updatePostureSettings; + } + + /** Returns the object with the settings used for calls to updatePosture. */ + public OperationCallSettings + updatePostureOperationSettings() { + return updatePostureOperationSettings; + } + + /** Returns the object with the settings used for calls to deletePosture. */ + public UnaryCallSettings deletePostureSettings() { + return deletePostureSettings; + } + + /** Returns the object with the settings used for calls to deletePosture. */ + public OperationCallSettings + deletePostureOperationSettings() { + return deletePostureOperationSettings; + } + + /** Returns the object with the settings used for calls to extractPosture. */ + public UnaryCallSettings extractPostureSettings() { + return extractPostureSettings; + } + + /** Returns the object with the settings used for calls to extractPosture. */ + public OperationCallSettings + extractPostureOperationSettings() { + return extractPostureOperationSettings; + } + + /** Returns the object with the settings used for calls to listPostureDeployments. */ + public PagedCallSettings< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + ListPostureDeploymentsPagedResponse> + listPostureDeploymentsSettings() { + return listPostureDeploymentsSettings; + } + + /** Returns the object with the settings used for calls to getPostureDeployment. */ + public UnaryCallSettings + getPostureDeploymentSettings() { + return getPostureDeploymentSettings; + } + + /** Returns the object with the settings used for calls to createPostureDeployment. */ + public UnaryCallSettings + createPostureDeploymentSettings() { + return createPostureDeploymentSettings; + } + + /** Returns the object with the settings used for calls to createPostureDeployment. */ + public OperationCallSettings + createPostureDeploymentOperationSettings() { + return createPostureDeploymentOperationSettings; + } + + /** Returns the object with the settings used for calls to updatePostureDeployment. */ + public UnaryCallSettings + updatePostureDeploymentSettings() { + return updatePostureDeploymentSettings; + } + + /** Returns the object with the settings used for calls to updatePostureDeployment. */ + public OperationCallSettings + updatePostureDeploymentOperationSettings() { + return updatePostureDeploymentOperationSettings; + } + + /** Returns the object with the settings used for calls to deletePostureDeployment. */ + public UnaryCallSettings + deletePostureDeploymentSettings() { + return deletePostureDeploymentSettings; + } + + /** Returns the object with the settings used for calls to deletePostureDeployment. */ + public OperationCallSettings + deletePostureDeploymentOperationSettings() { + return deletePostureDeploymentOperationSettings; + } + + /** Returns the object with the settings used for calls to listPostureTemplates. */ + public PagedCallSettings< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + ListPostureTemplatesPagedResponse> + listPostureTemplatesSettings() { + return listPostureTemplatesSettings; + } + + /** Returns the object with the settings used for calls to getPostureTemplate. */ + public UnaryCallSettings + getPostureTemplateSettings() { + return getPostureTemplateSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public SecurityPostureStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSecurityPostureStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSecurityPostureStub.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 "securityposture"; + } + + /** 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 "securityposture.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "securityposture.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(SecurityPostureStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SecurityPostureStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SecurityPostureStubSettings.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 SecurityPostureStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listPosturesSettings = settingsBuilder.listPosturesSettings().build(); + listPostureRevisionsSettings = settingsBuilder.listPostureRevisionsSettings().build(); + getPostureSettings = settingsBuilder.getPostureSettings().build(); + createPostureSettings = settingsBuilder.createPostureSettings().build(); + createPostureOperationSettings = settingsBuilder.createPostureOperationSettings().build(); + updatePostureSettings = settingsBuilder.updatePostureSettings().build(); + updatePostureOperationSettings = settingsBuilder.updatePostureOperationSettings().build(); + deletePostureSettings = settingsBuilder.deletePostureSettings().build(); + deletePostureOperationSettings = settingsBuilder.deletePostureOperationSettings().build(); + extractPostureSettings = settingsBuilder.extractPostureSettings().build(); + extractPostureOperationSettings = settingsBuilder.extractPostureOperationSettings().build(); + listPostureDeploymentsSettings = settingsBuilder.listPostureDeploymentsSettings().build(); + getPostureDeploymentSettings = settingsBuilder.getPostureDeploymentSettings().build(); + createPostureDeploymentSettings = settingsBuilder.createPostureDeploymentSettings().build(); + createPostureDeploymentOperationSettings = + settingsBuilder.createPostureDeploymentOperationSettings().build(); + updatePostureDeploymentSettings = settingsBuilder.updatePostureDeploymentSettings().build(); + updatePostureDeploymentOperationSettings = + settingsBuilder.updatePostureDeploymentOperationSettings().build(); + deletePostureDeploymentSettings = settingsBuilder.deletePostureDeploymentSettings().build(); + deletePostureDeploymentOperationSettings = + settingsBuilder.deletePostureDeploymentOperationSettings().build(); + listPostureTemplatesSettings = settingsBuilder.listPostureTemplatesSettings().build(); + getPostureTemplateSettings = settingsBuilder.getPostureTemplateSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for SecurityPostureStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListPosturesRequest, ListPosturesResponse, ListPosturesPagedResponse> + listPosturesSettings; + private final PagedCallSettings.Builder< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + ListPostureRevisionsPagedResponse> + listPostureRevisionsSettings; + private final UnaryCallSettings.Builder getPostureSettings; + private final UnaryCallSettings.Builder createPostureSettings; + private final OperationCallSettings.Builder + createPostureOperationSettings; + private final UnaryCallSettings.Builder updatePostureSettings; + private final OperationCallSettings.Builder + updatePostureOperationSettings; + private final UnaryCallSettings.Builder deletePostureSettings; + private final OperationCallSettings.Builder + deletePostureOperationSettings; + private final UnaryCallSettings.Builder + extractPostureSettings; + private final OperationCallSettings.Builder + extractPostureOperationSettings; + private final PagedCallSettings.Builder< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + ListPostureDeploymentsPagedResponse> + listPostureDeploymentsSettings; + private final UnaryCallSettings.Builder + getPostureDeploymentSettings; + private final UnaryCallSettings.Builder + createPostureDeploymentSettings; + private final OperationCallSettings.Builder< + CreatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + createPostureDeploymentOperationSettings; + private final UnaryCallSettings.Builder + updatePostureDeploymentSettings; + private final OperationCallSettings.Builder< + UpdatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + updatePostureDeploymentOperationSettings; + private final UnaryCallSettings.Builder + deletePostureDeploymentSettings; + private final OperationCallSettings.Builder< + DeletePostureDeploymentRequest, Empty, OperationMetadata> + deletePostureDeploymentOperationSettings; + private final PagedCallSettings.Builder< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + ListPostureTemplatesPagedResponse> + listPostureTemplatesSettings; + private final UnaryCallSettings.Builder + getPostureTemplateSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + 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); + + listPosturesSettings = PagedCallSettings.newBuilder(LIST_POSTURES_PAGE_STR_FACT); + listPostureRevisionsSettings = + PagedCallSettings.newBuilder(LIST_POSTURE_REVISIONS_PAGE_STR_FACT); + getPostureSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createPostureSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createPostureOperationSettings = OperationCallSettings.newBuilder(); + updatePostureSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updatePostureOperationSettings = OperationCallSettings.newBuilder(); + deletePostureSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deletePostureOperationSettings = OperationCallSettings.newBuilder(); + extractPostureSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + extractPostureOperationSettings = OperationCallSettings.newBuilder(); + listPostureDeploymentsSettings = + PagedCallSettings.newBuilder(LIST_POSTURE_DEPLOYMENTS_PAGE_STR_FACT); + getPostureDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createPostureDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createPostureDeploymentOperationSettings = OperationCallSettings.newBuilder(); + updatePostureDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updatePostureDeploymentOperationSettings = OperationCallSettings.newBuilder(); + deletePostureDeploymentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deletePostureDeploymentOperationSettings = OperationCallSettings.newBuilder(); + listPostureTemplatesSettings = + PagedCallSettings.newBuilder(LIST_POSTURE_TEMPLATES_PAGE_STR_FACT); + getPostureTemplateSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listPosturesSettings, + listPostureRevisionsSettings, + getPostureSettings, + createPostureSettings, + updatePostureSettings, + deletePostureSettings, + extractPostureSettings, + listPostureDeploymentsSettings, + getPostureDeploymentSettings, + createPostureDeploymentSettings, + updatePostureDeploymentSettings, + deletePostureDeploymentSettings, + listPostureTemplatesSettings, + getPostureTemplateSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(SecurityPostureStubSettings settings) { + super(settings); + + listPosturesSettings = settings.listPosturesSettings.toBuilder(); + listPostureRevisionsSettings = settings.listPostureRevisionsSettings.toBuilder(); + getPostureSettings = settings.getPostureSettings.toBuilder(); + createPostureSettings = settings.createPostureSettings.toBuilder(); + createPostureOperationSettings = settings.createPostureOperationSettings.toBuilder(); + updatePostureSettings = settings.updatePostureSettings.toBuilder(); + updatePostureOperationSettings = settings.updatePostureOperationSettings.toBuilder(); + deletePostureSettings = settings.deletePostureSettings.toBuilder(); + deletePostureOperationSettings = settings.deletePostureOperationSettings.toBuilder(); + extractPostureSettings = settings.extractPostureSettings.toBuilder(); + extractPostureOperationSettings = settings.extractPostureOperationSettings.toBuilder(); + listPostureDeploymentsSettings = settings.listPostureDeploymentsSettings.toBuilder(); + getPostureDeploymentSettings = settings.getPostureDeploymentSettings.toBuilder(); + createPostureDeploymentSettings = settings.createPostureDeploymentSettings.toBuilder(); + createPostureDeploymentOperationSettings = + settings.createPostureDeploymentOperationSettings.toBuilder(); + updatePostureDeploymentSettings = settings.updatePostureDeploymentSettings.toBuilder(); + updatePostureDeploymentOperationSettings = + settings.updatePostureDeploymentOperationSettings.toBuilder(); + deletePostureDeploymentSettings = settings.deletePostureDeploymentSettings.toBuilder(); + deletePostureDeploymentOperationSettings = + settings.deletePostureDeploymentOperationSettings.toBuilder(); + listPostureTemplatesSettings = settings.listPostureTemplatesSettings.toBuilder(); + getPostureTemplateSettings = settings.getPostureTemplateSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listPosturesSettings, + listPostureRevisionsSettings, + getPostureSettings, + createPostureSettings, + updatePostureSettings, + deletePostureSettings, + extractPostureSettings, + listPostureDeploymentsSettings, + getPostureDeploymentSettings, + createPostureDeploymentSettings, + updatePostureDeploymentSettings, + deletePostureDeploymentSettings, + listPostureTemplatesSettings, + getPostureTemplateSettings, + listLocationsSettings, + getLocationSettings); + } + + 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 + .listPosturesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listPostureRevisionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getPostureSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createPostureSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updatePostureSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deletePostureSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .extractPostureSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listPostureDeploymentsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getPostureDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createPostureDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .updatePostureDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .deletePostureDeploymentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listPostureTemplatesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getPostureTemplateSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createPostureOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Posture.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updatePostureOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Posture.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deletePostureOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .extractPostureOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Posture.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .createPostureDeploymentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(PostureDeployment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updatePostureDeploymentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(PostureDeployment.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deletePostureDeploymentOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + 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 listPostures. */ + public PagedCallSettings.Builder< + ListPosturesRequest, ListPosturesResponse, ListPosturesPagedResponse> + listPosturesSettings() { + return listPosturesSettings; + } + + /** Returns the builder for the settings used for calls to listPostureRevisions. */ + public PagedCallSettings.Builder< + ListPostureRevisionsRequest, + ListPostureRevisionsResponse, + ListPostureRevisionsPagedResponse> + listPostureRevisionsSettings() { + return listPostureRevisionsSettings; + } + + /** Returns the builder for the settings used for calls to getPosture. */ + public UnaryCallSettings.Builder getPostureSettings() { + return getPostureSettings; + } + + /** Returns the builder for the settings used for calls to createPosture. */ + public UnaryCallSettings.Builder createPostureSettings() { + return createPostureSettings; + } + + /** Returns the builder for the settings used for calls to createPosture. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createPostureOperationSettings() { + return createPostureOperationSettings; + } + + /** Returns the builder for the settings used for calls to updatePosture. */ + public UnaryCallSettings.Builder updatePostureSettings() { + return updatePostureSettings; + } + + /** Returns the builder for the settings used for calls to updatePosture. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updatePostureOperationSettings() { + return updatePostureOperationSettings; + } + + /** Returns the builder for the settings used for calls to deletePosture. */ + public UnaryCallSettings.Builder deletePostureSettings() { + return deletePostureSettings; + } + + /** Returns the builder for the settings used for calls to deletePosture. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deletePostureOperationSettings() { + return deletePostureOperationSettings; + } + + /** Returns the builder for the settings used for calls to extractPosture. */ + public UnaryCallSettings.Builder extractPostureSettings() { + return extractPostureSettings; + } + + /** Returns the builder for the settings used for calls to extractPosture. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + extractPostureOperationSettings() { + return extractPostureOperationSettings; + } + + /** Returns the builder for the settings used for calls to listPostureDeployments. */ + public PagedCallSettings.Builder< + ListPostureDeploymentsRequest, + ListPostureDeploymentsResponse, + ListPostureDeploymentsPagedResponse> + listPostureDeploymentsSettings() { + return listPostureDeploymentsSettings; + } + + /** Returns the builder for the settings used for calls to getPostureDeployment. */ + public UnaryCallSettings.Builder + getPostureDeploymentSettings() { + return getPostureDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to createPostureDeployment. */ + public UnaryCallSettings.Builder + createPostureDeploymentSettings() { + return createPostureDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to createPostureDeployment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + CreatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + createPostureDeploymentOperationSettings() { + return createPostureDeploymentOperationSettings; + } + + /** Returns the builder for the settings used for calls to updatePostureDeployment. */ + public UnaryCallSettings.Builder + updatePostureDeploymentSettings() { + return updatePostureDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to updatePostureDeployment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + UpdatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + updatePostureDeploymentOperationSettings() { + return updatePostureDeploymentOperationSettings; + } + + /** Returns the builder for the settings used for calls to deletePostureDeployment. */ + public UnaryCallSettings.Builder + deletePostureDeploymentSettings() { + return deletePostureDeploymentSettings; + } + + /** Returns the builder for the settings used for calls to deletePostureDeployment. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deletePostureDeploymentOperationSettings() { + return deletePostureDeploymentOperationSettings; + } + + /** Returns the builder for the settings used for calls to listPostureTemplates. */ + public PagedCallSettings.Builder< + ListPostureTemplatesRequest, + ListPostureTemplatesResponse, + ListPostureTemplatesPagedResponse> + listPostureTemplatesSettings() { + return listPostureTemplatesSettings; + } + + /** Returns the builder for the settings used for calls to getPostureTemplate. */ + public UnaryCallSettings.Builder + getPostureTemplateSettings() { + return getPostureTemplateSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** 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 SecurityPostureStubSettings build() throws IOException { + return new SecurityPostureStubSettings(this); + } + } +} diff --git a/java-securityposture/google-cloud-securityposture/src/main/resources/META-INF/native-image/com.google.cloud.securityposture.v1/reflect-config.json b/java-securityposture/google-cloud-securityposture/src/main/resources/META-INF/native-image/com.google.cloud.securityposture.v1/reflect-config.json new file mode 100644 index 000000000000..7d13aea98a0d --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/main/resources/META-INF/native-image/com.google.cloud.securityposture.v1/reflect-config.json @@ -0,0 +1,2180 @@ +[ + { + "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.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Constraint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Constraint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CreatePostureRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CreatePostureRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig$CustomOutputSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig$CustomOutputSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig$CustomOutputSpec$Property", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig$CustomOutputSpec$Property$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig$ResourceSelector", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig$ResourceSelector$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConfig$Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConstraint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConstraint$ActionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConstraint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.CustomConstraint$MethodType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.DeletePostureRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.DeletePostureRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.EnablementState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ExtractPostureRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ExtractPostureRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.GetPostureDeploymentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.GetPostureDeploymentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.GetPostureRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.GetPostureRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.GetPostureTemplateRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.GetPostureTemplateRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureRevisionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureRevisionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureRevisionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureRevisionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureTemplatesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureTemplatesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureTemplatesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPostureTemplatesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPosturesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPosturesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPosturesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.ListPosturesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.OrgPolicyConstraint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.OrgPolicyConstraint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Policy$ComplianceStandard", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Policy$ComplianceStandard$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PolicyRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PolicyRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PolicyRule$StringValues", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PolicyRule$StringValues$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PolicySet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PolicySet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Posture", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Posture$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.Posture$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PostureDeployment", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PostureDeployment$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PostureDeployment$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PostureTemplate", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PostureTemplate$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.PostureTemplate$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.UpdatePostureRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.securityposture.v1.UpdatePostureRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.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.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockLocations.java b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockLocations.java new file mode 100644 index 000000000000..9503a863781a --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockLocations.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.securityposture.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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockLocationsImpl.java b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..b95e5806e529 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockLocationsImpl.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.securityposture.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +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 MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) 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 ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) 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 GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockSecurityPosture.java b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockSecurityPosture.java new file mode 100644 index 000000000000..104b42ffd0ec --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockSecurityPosture.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.securityposture.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 MockSecurityPosture implements MockGrpcService { + private final MockSecurityPostureImpl serviceImpl; + + public MockSecurityPosture() { + serviceImpl = new MockSecurityPostureImpl(); + } + + @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-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockSecurityPostureImpl.java b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockSecurityPostureImpl.java new file mode 100644 index 000000000000..8d5f391c8edd --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/MockSecurityPostureImpl.java @@ -0,0 +1,357 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.securityposture.v1.SecurityPostureGrpc.SecurityPostureImplBase; +import com.google.longrunning.Operation; +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 MockSecurityPostureImpl extends SecurityPostureImplBase { + private List requests; + private Queue responses; + + public MockSecurityPostureImpl() { + 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 listPostures( + ListPosturesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListPosturesResponse) { + requests.add(request); + responseObserver.onNext(((ListPosturesResponse) 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 ListPostures, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListPosturesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listPostureRevisions( + ListPostureRevisionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListPostureRevisionsResponse) { + requests.add(request); + responseObserver.onNext(((ListPostureRevisionsResponse) 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 ListPostureRevisions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListPostureRevisionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPosture(GetPostureRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Posture) { + requests.add(request); + responseObserver.onNext(((Posture) 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 GetPosture, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Posture.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createPosture( + CreatePostureRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 CreatePosture, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updatePosture( + UpdatePostureRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 UpdatePosture, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deletePosture( + DeletePostureRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 DeletePosture, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void extractPosture( + ExtractPostureRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 ExtractPosture, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listPostureDeployments( + ListPostureDeploymentsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListPostureDeploymentsResponse) { + requests.add(request); + responseObserver.onNext(((ListPostureDeploymentsResponse) 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 ListPostureDeployments, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListPostureDeploymentsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPostureDeployment( + GetPostureDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PostureDeployment) { + requests.add(request); + responseObserver.onNext(((PostureDeployment) 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 GetPostureDeployment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PostureDeployment.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createPostureDeployment( + CreatePostureDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 CreatePostureDeployment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updatePostureDeployment( + UpdatePostureDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 UpdatePostureDeployment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deletePostureDeployment( + DeletePostureDeploymentRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 DeletePostureDeployment, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listPostureTemplates( + ListPostureTemplatesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListPostureTemplatesResponse) { + requests.add(request); + responseObserver.onNext(((ListPostureTemplatesResponse) 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 ListPostureTemplates, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListPostureTemplatesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPostureTemplate( + GetPostureTemplateRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PostureTemplate) { + requests.add(request); + responseObserver.onNext(((PostureTemplate) 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 GetPostureTemplate, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PostureTemplate.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/SecurityPostureClientHttpJsonTest.java b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/SecurityPostureClientHttpJsonTest.java new file mode 100644 index 000000000000..29f3b42d9ff3 --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/SecurityPostureClientHttpJsonTest.java @@ -0,0 +1,1640 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1; + +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListLocationsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureDeploymentsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureRevisionsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureTemplatesPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPosturesPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.stub.HttpJsonSecurityPostureStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +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 SecurityPostureClientHttpJsonTest { + private static MockHttpService mockService; + private static SecurityPostureClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSecurityPostureStub.getMethodDescriptors(), + SecurityPostureSettings.getDefaultEndpoint()); + SecurityPostureSettings settings = + SecurityPostureSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SecurityPostureSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SecurityPostureClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listPosturesTest() throws Exception { + Posture responsesElement = Posture.newBuilder().build(); + ListPosturesResponse expectedResponse = + ListPosturesResponse.newBuilder() + .setNextPageToken("") + .addAllPostures(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListPosturesPagedResponse pagedListResponse = client.listPostures(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPosturesList().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 listPosturesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listPostures(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPosturesTest2() throws Exception { + Posture responsesElement = Posture.newBuilder().build(); + ListPosturesResponse expectedResponse = + ListPosturesResponse.newBuilder() + .setNextPageToken("") + .addAllPostures(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-9365/locations/location-9365"; + + ListPosturesPagedResponse pagedListResponse = client.listPostures(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPosturesList().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 listPosturesExceptionTest2() 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.listPostures(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPostureRevisionsTest() throws Exception { + Posture responsesElement = Posture.newBuilder().build(); + ListPostureRevisionsResponse expectedResponse = + ListPostureRevisionsResponse.newBuilder() + .setNextPageToken("") + .addAllRevisions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListPostureRevisionsRequest request = + ListPostureRevisionsRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListPostureRevisionsPagedResponse pagedListResponse = client.listPostureRevisions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRevisionsList().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 listPostureRevisionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListPostureRevisionsRequest request = + ListPostureRevisionsRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listPostureRevisions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureTest() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + mockService.addResponse(expectedResponse); + + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + + Posture actualResponse = client.getPosture(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 getPostureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + client.getPosture(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureTest2() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + mockService.addResponse(expectedResponse); + + String name = "organizations/organization-7771/locations/location-7771/postures/posture-7771"; + + Posture actualResponse = client.getPosture(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 getPostureExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "organizations/organization-7771/locations/location-7771/postures/posture-7771"; + client.getPosture(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPostureTest() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + + Posture actualResponse = client.createPostureAsync(parent, posture, postureId).get(); + 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 createPostureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + client.createPostureAsync(parent, posture, postureId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createPostureTest2() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "organizations/organization-9365/locations/location-9365"; + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + + Posture actualResponse = client.createPostureAsync(parent, posture, postureId).get(); + 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 createPostureExceptionTest2() 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"; + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + client.createPostureAsync(parent, posture, postureId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updatePostureTest() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updatePostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Posture posture = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Posture actualResponse = client.updatePostureAsync(posture, updateMask).get(); + 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 updatePostureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Posture posture = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updatePostureAsync(posture, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deletePostureTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + + client.deletePostureAsync(name).get(); + + 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 deletePostureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + client.deletePostureAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deletePostureTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "organizations/organization-7771/locations/location-7771/postures/posture-7771"; + + client.deletePostureAsync(name).get(); + + 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 deletePostureExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "organizations/organization-7771/locations/location-7771/postures/posture-7771"; + client.deletePostureAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void extractPostureTest() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("extractPostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + + Posture actualResponse = client.extractPostureAsync(parent, postureId, workload).get(); + 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 extractPostureExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + client.extractPostureAsync(parent, postureId, workload).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void extractPostureTest2() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("extractPostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "organizations/organization-9365/locations/location-9365"; + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + + Posture actualResponse = client.extractPostureAsync(parent, postureId, workload).get(); + 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 extractPostureExceptionTest2() 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"; + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + client.extractPostureAsync(parent, postureId, workload).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listPostureDeploymentsTest() throws Exception { + PostureDeployment responsesElement = PostureDeployment.newBuilder().build(); + ListPostureDeploymentsResponse expectedResponse = + ListPostureDeploymentsResponse.newBuilder() + .setNextPageToken("") + .addAllPostureDeployments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListPostureDeploymentsPagedResponse pagedListResponse = client.listPostureDeployments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPostureDeploymentsList().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 listPostureDeploymentsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listPostureDeployments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPostureDeploymentsTest2() throws Exception { + PostureDeployment responsesElement = PostureDeployment.newBuilder().build(); + ListPostureDeploymentsResponse expectedResponse = + ListPostureDeploymentsResponse.newBuilder() + .setNextPageToken("") + .addAllPostureDeployments(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-9365/locations/location-9365"; + + ListPostureDeploymentsPagedResponse pagedListResponse = client.listPostureDeployments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPostureDeploymentsList().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 listPostureDeploymentsExceptionTest2() 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.listPostureDeployments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureDeploymentTest() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + mockService.addResponse(expectedResponse); + + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + + PostureDeployment actualResponse = client.getPostureDeployment(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 getPostureDeploymentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + client.getPostureDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureDeploymentTest2() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-1322/locations/location-1322/postureDeployments/postureDeployment-1322"; + + PostureDeployment actualResponse = client.getPostureDeployment(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 getPostureDeploymentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-1322/locations/location-1322/postureDeployments/postureDeployment-1322"; + client.getPostureDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPostureDeploymentTest() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + + PostureDeployment actualResponse = + client.createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId).get(); + 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 createPostureDeploymentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + client.createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createPostureDeploymentTest2() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "organizations/organization-9365/locations/location-9365"; + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + + PostureDeployment actualResponse = + client.createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId).get(); + 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 createPostureDeploymentExceptionTest2() 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"; + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + client.createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updatePostureDeploymentTest() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updatePostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + PostureDeployment postureDeployment = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + PostureDeployment actualResponse = + client.updatePostureDeploymentAsync(postureDeployment, updateMask).get(); + 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 updatePostureDeploymentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PostureDeployment postureDeployment = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updatePostureDeploymentAsync(postureDeployment, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deletePostureDeploymentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + + client.deletePostureDeploymentAsync(name).get(); + + 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 deletePostureDeploymentExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + client.deletePostureDeploymentAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deletePostureDeploymentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "organizations/organization-1322/locations/location-1322/postureDeployments/postureDeployment-1322"; + + client.deletePostureDeploymentAsync(name).get(); + + 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 deletePostureDeploymentExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-1322/locations/location-1322/postureDeployments/postureDeployment-1322"; + client.deletePostureDeploymentAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void listPostureTemplatesTest() throws Exception { + PostureTemplate responsesElement = PostureTemplate.newBuilder().build(); + ListPostureTemplatesResponse expectedResponse = + ListPostureTemplatesResponse.newBuilder() + .setNextPageToken("") + .addAllPostureTemplates(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListPostureTemplatesPagedResponse pagedListResponse = client.listPostureTemplates(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPostureTemplatesList().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 listPostureTemplatesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listPostureTemplates(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPostureTemplatesTest2() throws Exception { + PostureTemplate responsesElement = PostureTemplate.newBuilder().build(); + ListPostureTemplatesResponse expectedResponse = + ListPostureTemplatesResponse.newBuilder() + .setNextPageToken("") + .addAllPostureTemplates(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "organizations/organization-9365/locations/location-9365"; + + ListPostureTemplatesPagedResponse pagedListResponse = client.listPostureTemplates(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPostureTemplatesList().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 listPostureTemplatesExceptionTest2() 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.listPostureTemplates(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureTemplateTest() throws Exception { + PostureTemplate expectedResponse = + PostureTemplate.newBuilder() + .setName( + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]") + .toString()) + .setRevisionId("revisionId-1507445162") + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + PostureTemplateName name = + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]"); + + PostureTemplate actualResponse = client.getPostureTemplate(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 getPostureTemplateExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PostureTemplateName name = + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]"); + client.getPostureTemplate(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureTemplateTest2() throws Exception { + PostureTemplate expectedResponse = + PostureTemplate.newBuilder() + .setName( + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]") + .toString()) + .setRevisionId("revisionId-1507445162") + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "organizations/organization-3681/locations/location-3681/postureTemplates/postureTemplate-3681"; + + PostureTemplate actualResponse = client.getPostureTemplate(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 getPostureTemplateExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "organizations/organization-3681/locations/location-3681/postureTemplates/postureTemplate-3681"; + client.getPostureTemplate(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("organizations/organization-1936") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().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 listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("organizations/organization-1936") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("organizations/organization-7066/locations/location-7066") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("organizations/organization-7066/locations/location-7066") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/SecurityPostureClientTest.java b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/SecurityPostureClientTest.java new file mode 100644 index 000000000000..cfdfad8ac1df --- /dev/null +++ b/java-securityposture/google-cloud-securityposture/src/test/java/com/google/cloud/securityposture/v1/SecurityPostureClientTest.java @@ -0,0 +1,1484 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1; + +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListLocationsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureDeploymentsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureRevisionsPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPostureTemplatesPagedResponse; +import static com.google.cloud.securityposture.v1.SecurityPostureClient.ListPosturesPagedResponse; + +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.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +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 SecurityPostureClientTest { + private static MockLocations mockLocations; + private static MockSecurityPosture mockSecurityPosture; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SecurityPostureClient client; + + @BeforeClass + public static void startStaticServer() { + mockSecurityPosture = new MockSecurityPosture(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSecurityPosture, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SecurityPostureSettings settings = + SecurityPostureSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SecurityPostureClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listPosturesTest() throws Exception { + Posture responsesElement = Posture.newBuilder().build(); + ListPosturesResponse expectedResponse = + ListPosturesResponse.newBuilder() + .setNextPageToken("") + .addAllPostures(Arrays.asList(responsesElement)) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListPosturesPagedResponse pagedListResponse = client.listPostures(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPosturesList().get(0), resources.get(0)); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPosturesRequest actualRequest = ((ListPosturesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPosturesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listPostures(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPosturesTest2() throws Exception { + Posture responsesElement = Posture.newBuilder().build(); + ListPosturesResponse expectedResponse = + ListPosturesResponse.newBuilder() + .setNextPageToken("") + .addAllPostures(Arrays.asList(responsesElement)) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPosturesPagedResponse pagedListResponse = client.listPostures(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPosturesList().get(0), resources.get(0)); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPosturesRequest actualRequest = ((ListPosturesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPosturesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String parent = "parent-995424086"; + client.listPostures(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPostureRevisionsTest() throws Exception { + Posture responsesElement = Posture.newBuilder().build(); + ListPostureRevisionsResponse expectedResponse = + ListPostureRevisionsResponse.newBuilder() + .setNextPageToken("") + .addAllRevisions(Arrays.asList(responsesElement)) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + ListPostureRevisionsRequest request = + ListPostureRevisionsRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListPostureRevisionsPagedResponse pagedListResponse = client.listPostureRevisions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getRevisionsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPostureRevisionsRequest actualRequest = + ((ListPostureRevisionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPostureRevisionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + ListPostureRevisionsRequest request = + ListPostureRevisionsRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listPostureRevisions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureTest() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + + Posture actualResponse = client.getPosture(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPostureRequest actualRequest = ((GetPostureRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPostureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + client.getPosture(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureTest2() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + String name = "name3373707"; + + Posture actualResponse = client.getPosture(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPostureRequest actualRequest = ((GetPostureRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPostureExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String name = "name3373707"; + client.getPosture(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPostureTest() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + + Posture actualResponse = client.createPostureAsync(parent, posture, postureId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePostureRequest actualRequest = ((CreatePostureRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(posture, actualRequest.getPosture()); + Assert.assertEquals(postureId, actualRequest.getPostureId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPostureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + client.createPostureAsync(parent, posture, postureId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createPostureTest2() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + String parent = "parent-995424086"; + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + + Posture actualResponse = client.createPostureAsync(parent, posture, postureId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePostureRequest actualRequest = ((CreatePostureRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(posture, actualRequest.getPosture()); + Assert.assertEquals(postureId, actualRequest.getPostureId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPostureExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String parent = "parent-995424086"; + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + client.createPostureAsync(parent, posture, postureId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updatePostureTest() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updatePostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + Posture posture = Posture.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Posture actualResponse = client.updatePostureAsync(posture, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdatePostureRequest actualRequest = ((UpdatePostureRequest) actualRequests.get(0)); + + Assert.assertEquals(posture, actualRequest.getPosture()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updatePostureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + Posture posture = Posture.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updatePostureAsync(posture, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deletePostureTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + + client.deletePostureAsync(name).get(); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePostureRequest actualRequest = ((DeletePostureRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePostureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + client.deletePostureAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deletePostureTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + String name = "name3373707"; + + client.deletePostureAsync(name).get(); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePostureRequest actualRequest = ((DeletePostureRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePostureExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String name = "name3373707"; + client.deletePostureAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void extractPostureTest() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("extractPostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + + Posture actualResponse = client.extractPostureAsync(parent, postureId, workload).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExtractPostureRequest actualRequest = ((ExtractPostureRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(postureId, actualRequest.getPostureId()); + Assert.assertEquals(workload, actualRequest.getWorkload()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void extractPostureExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + client.extractPostureAsync(parent, postureId, workload).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void extractPostureTest2() throws Exception { + Posture expectedResponse = + Posture.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("extractPostureTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + String parent = "parent-995424086"; + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + + Posture actualResponse = client.extractPostureAsync(parent, postureId, workload).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExtractPostureRequest actualRequest = ((ExtractPostureRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(postureId, actualRequest.getPostureId()); + Assert.assertEquals(workload, actualRequest.getWorkload()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void extractPostureExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String parent = "parent-995424086"; + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + client.extractPostureAsync(parent, postureId, workload).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listPostureDeploymentsTest() throws Exception { + PostureDeployment responsesElement = PostureDeployment.newBuilder().build(); + ListPostureDeploymentsResponse expectedResponse = + ListPostureDeploymentsResponse.newBuilder() + .setNextPageToken("") + .addAllPostureDeployments(Arrays.asList(responsesElement)) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListPostureDeploymentsPagedResponse pagedListResponse = client.listPostureDeployments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPostureDeploymentsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPostureDeploymentsRequest actualRequest = + ((ListPostureDeploymentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPostureDeploymentsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listPostureDeployments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPostureDeploymentsTest2() throws Exception { + PostureDeployment responsesElement = PostureDeployment.newBuilder().build(); + ListPostureDeploymentsResponse expectedResponse = + ListPostureDeploymentsResponse.newBuilder() + .setNextPageToken("") + .addAllPostureDeployments(Arrays.asList(responsesElement)) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPostureDeploymentsPagedResponse pagedListResponse = client.listPostureDeployments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPostureDeploymentsList().get(0), resources.get(0)); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPostureDeploymentsRequest actualRequest = + ((ListPostureDeploymentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPostureDeploymentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String parent = "parent-995424086"; + client.listPostureDeployments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureDeploymentTest() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + + PostureDeployment actualResponse = client.getPostureDeployment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPostureDeploymentRequest actualRequest = + ((GetPostureDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPostureDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + client.getPostureDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureDeploymentTest2() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + String name = "name3373707"; + + PostureDeployment actualResponse = client.getPostureDeployment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPostureDeploymentRequest actualRequest = + ((GetPostureDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPostureDeploymentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String name = "name3373707"; + client.getPostureDeployment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPostureDeploymentTest() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + + PostureDeployment actualResponse = + client.createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePostureDeploymentRequest actualRequest = + ((CreatePostureDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(postureDeployment, actualRequest.getPostureDeployment()); + Assert.assertEquals(postureDeploymentId, actualRequest.getPostureDeploymentId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPostureDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + client.createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createPostureDeploymentTest2() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createPostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + String parent = "parent-995424086"; + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + + PostureDeployment actualResponse = + client.createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePostureDeploymentRequest actualRequest = + ((CreatePostureDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(postureDeployment, actualRequest.getPostureDeployment()); + Assert.assertEquals(postureDeploymentId, actualRequest.getPostureDeploymentId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPostureDeploymentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String parent = "parent-995424086"; + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + client.createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updatePostureDeploymentTest() throws Exception { + PostureDeployment expectedResponse = + PostureDeployment.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setTargetResource("targetResource-1933150017") + .setPostureId("postureId2023219203") + .setPostureRevisionId("postureRevisionId416325950") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDescription("description-1724546052") + .setEtag("etag3123477") + .putAllAnnotations(new HashMap()) + .setReconciling(true) + .setDesiredPostureId("desiredPostureId1660628617") + .setDesiredPostureRevisionId("desiredPostureRevisionId1708657092") + .setFailureMessage("failureMessage-1704954083") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updatePostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + PostureDeployment actualResponse = + client.updatePostureDeploymentAsync(postureDeployment, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdatePostureDeploymentRequest actualRequest = + ((UpdatePostureDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(postureDeployment, actualRequest.getPostureDeployment()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updatePostureDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updatePostureDeploymentAsync(postureDeployment, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deletePostureDeploymentTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + + client.deletePostureDeploymentAsync(name).get(); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePostureDeploymentRequest actualRequest = + ((DeletePostureDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePostureDeploymentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + client.deletePostureDeploymentAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deletePostureDeploymentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deletePostureDeploymentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSecurityPosture.addResponse(resultOperation); + + String name = "name3373707"; + + client.deletePostureDeploymentAsync(name).get(); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePostureDeploymentRequest actualRequest = + ((DeletePostureDeploymentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePostureDeploymentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String name = "name3373707"; + client.deletePostureDeploymentAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listPostureTemplatesTest() throws Exception { + PostureTemplate responsesElement = PostureTemplate.newBuilder().build(); + ListPostureTemplatesResponse expectedResponse = + ListPostureTemplatesResponse.newBuilder() + .setNextPageToken("") + .addAllPostureTemplates(Arrays.asList(responsesElement)) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListPostureTemplatesPagedResponse pagedListResponse = client.listPostureTemplates(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPostureTemplatesList().get(0), resources.get(0)); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPostureTemplatesRequest actualRequest = + ((ListPostureTemplatesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPostureTemplatesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listPostureTemplates(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPostureTemplatesTest2() throws Exception { + PostureTemplate responsesElement = PostureTemplate.newBuilder().build(); + ListPostureTemplatesResponse expectedResponse = + ListPostureTemplatesResponse.newBuilder() + .setNextPageToken("") + .addAllPostureTemplates(Arrays.asList(responsesElement)) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPostureTemplatesPagedResponse pagedListResponse = client.listPostureTemplates(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPostureTemplatesList().get(0), resources.get(0)); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPostureTemplatesRequest actualRequest = + ((ListPostureTemplatesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPostureTemplatesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String parent = "parent-995424086"; + client.listPostureTemplates(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureTemplateTest() throws Exception { + PostureTemplate expectedResponse = + PostureTemplate.newBuilder() + .setName( + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]") + .toString()) + .setRevisionId("revisionId-1507445162") + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + PostureTemplateName name = + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]"); + + PostureTemplate actualResponse = client.getPostureTemplate(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPostureTemplateRequest actualRequest = ((GetPostureTemplateRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPostureTemplateExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + PostureTemplateName name = + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]"); + client.getPostureTemplate(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPostureTemplateTest2() throws Exception { + PostureTemplate expectedResponse = + PostureTemplate.newBuilder() + .setName( + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]") + .toString()) + .setRevisionId("revisionId-1507445162") + .setDescription("description-1724546052") + .addAllPolicySets(new ArrayList()) + .build(); + mockSecurityPosture.addResponse(expectedResponse); + + String name = "name3373707"; + + PostureTemplate actualResponse = client.getPostureTemplate(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecurityPosture.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPostureTemplateRequest actualRequest = ((GetPostureTemplateRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPostureTemplateExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecurityPosture.addException(exception); + + try { + String name = "name3373707"; + client.getPostureTemplate(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-securityposture/grpc-google-cloud-securityposture-v1/pom.xml b/java-securityposture/grpc-google-cloud-securityposture-v1/pom.xml new file mode 100644 index 000000000000..43decfd0196b --- /dev/null +++ b/java-securityposture/grpc-google-cloud-securityposture-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-securityposture-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-securityposture-v1 + GRPC library for google-cloud-securityposture + + com.google.cloud + google-cloud-securityposture-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-securityposture-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-securityposture/grpc-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureGrpc.java b/java-securityposture/grpc-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureGrpc.java new file mode 100644 index 000000000000..673e332143b3 --- /dev/null +++ b/java-securityposture/grpc-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityPostureGrpc.java @@ -0,0 +1,2090 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service describing handlers for resources.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/securityposture/v1/securityposture.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SecurityPostureGrpc { + + private SecurityPostureGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.securityposture.v1.SecurityPosture"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPosturesRequest, + com.google.cloud.securityposture.v1.ListPosturesResponse> + getListPosturesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPostures", + requestType = com.google.cloud.securityposture.v1.ListPosturesRequest.class, + responseType = com.google.cloud.securityposture.v1.ListPosturesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPosturesRequest, + com.google.cloud.securityposture.v1.ListPosturesResponse> + getListPosturesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPosturesRequest, + com.google.cloud.securityposture.v1.ListPosturesResponse> + getListPosturesMethod; + if ((getListPosturesMethod = SecurityPostureGrpc.getListPosturesMethod) == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getListPosturesMethod = SecurityPostureGrpc.getListPosturesMethod) == null) { + SecurityPostureGrpc.getListPosturesMethod = + getListPosturesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPostures")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ListPosturesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ListPosturesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("ListPostures")) + .build(); + } + } + } + return getListPosturesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest, + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse> + getListPostureRevisionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPostureRevisions", + requestType = com.google.cloud.securityposture.v1.ListPostureRevisionsRequest.class, + responseType = com.google.cloud.securityposture.v1.ListPostureRevisionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest, + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse> + getListPostureRevisionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest, + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse> + getListPostureRevisionsMethod; + if ((getListPostureRevisionsMethod = SecurityPostureGrpc.getListPostureRevisionsMethod) + == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getListPostureRevisionsMethod = SecurityPostureGrpc.getListPostureRevisionsMethod) + == null) { + SecurityPostureGrpc.getListPostureRevisionsMethod = + getListPostureRevisionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListPostureRevisions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("ListPostureRevisions")) + .build(); + } + } + } + return getListPostureRevisionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureRequest, + com.google.cloud.securityposture.v1.Posture> + getGetPostureMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPosture", + requestType = com.google.cloud.securityposture.v1.GetPostureRequest.class, + responseType = com.google.cloud.securityposture.v1.Posture.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureRequest, + com.google.cloud.securityposture.v1.Posture> + getGetPostureMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureRequest, + com.google.cloud.securityposture.v1.Posture> + getGetPostureMethod; + if ((getGetPostureMethod = SecurityPostureGrpc.getGetPostureMethod) == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getGetPostureMethod = SecurityPostureGrpc.getGetPostureMethod) == null) { + SecurityPostureGrpc.getGetPostureMethod = + getGetPostureMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPosture")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.GetPostureRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.Posture.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("GetPosture")) + .build(); + } + } + } + return getGetPostureMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.CreatePostureRequest, + com.google.longrunning.Operation> + getCreatePostureMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePosture", + requestType = com.google.cloud.securityposture.v1.CreatePostureRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.CreatePostureRequest, + com.google.longrunning.Operation> + getCreatePostureMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.CreatePostureRequest, + com.google.longrunning.Operation> + getCreatePostureMethod; + if ((getCreatePostureMethod = SecurityPostureGrpc.getCreatePostureMethod) == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getCreatePostureMethod = SecurityPostureGrpc.getCreatePostureMethod) == null) { + SecurityPostureGrpc.getCreatePostureMethod = + getCreatePostureMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePosture")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.CreatePostureRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("CreatePosture")) + .build(); + } + } + } + return getCreatePostureMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.UpdatePostureRequest, + com.google.longrunning.Operation> + getUpdatePostureMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePosture", + requestType = com.google.cloud.securityposture.v1.UpdatePostureRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.UpdatePostureRequest, + com.google.longrunning.Operation> + getUpdatePostureMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.UpdatePostureRequest, + com.google.longrunning.Operation> + getUpdatePostureMethod; + if ((getUpdatePostureMethod = SecurityPostureGrpc.getUpdatePostureMethod) == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getUpdatePostureMethod = SecurityPostureGrpc.getUpdatePostureMethod) == null) { + SecurityPostureGrpc.getUpdatePostureMethod = + getUpdatePostureMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePosture")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.UpdatePostureRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("UpdatePosture")) + .build(); + } + } + } + return getUpdatePostureMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.DeletePostureRequest, + com.google.longrunning.Operation> + getDeletePostureMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePosture", + requestType = com.google.cloud.securityposture.v1.DeletePostureRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.DeletePostureRequest, + com.google.longrunning.Operation> + getDeletePostureMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.DeletePostureRequest, + com.google.longrunning.Operation> + getDeletePostureMethod; + if ((getDeletePostureMethod = SecurityPostureGrpc.getDeletePostureMethod) == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getDeletePostureMethod = SecurityPostureGrpc.getDeletePostureMethod) == null) { + SecurityPostureGrpc.getDeletePostureMethod = + getDeletePostureMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePosture")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.DeletePostureRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("DeletePosture")) + .build(); + } + } + } + return getDeletePostureMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ExtractPostureRequest, + com.google.longrunning.Operation> + getExtractPostureMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExtractPosture", + requestType = com.google.cloud.securityposture.v1.ExtractPostureRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ExtractPostureRequest, + com.google.longrunning.Operation> + getExtractPostureMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ExtractPostureRequest, + com.google.longrunning.Operation> + getExtractPostureMethod; + if ((getExtractPostureMethod = SecurityPostureGrpc.getExtractPostureMethod) == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getExtractPostureMethod = SecurityPostureGrpc.getExtractPostureMethod) == null) { + SecurityPostureGrpc.getExtractPostureMethod = + getExtractPostureMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExtractPosture")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ExtractPostureRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("ExtractPosture")) + .build(); + } + } + } + return getExtractPostureMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest, + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse> + getListPostureDeploymentsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPostureDeployments", + requestType = com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest.class, + responseType = com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest, + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse> + getListPostureDeploymentsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest, + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse> + getListPostureDeploymentsMethod; + if ((getListPostureDeploymentsMethod = SecurityPostureGrpc.getListPostureDeploymentsMethod) + == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getListPostureDeploymentsMethod = SecurityPostureGrpc.getListPostureDeploymentsMethod) + == null) { + SecurityPostureGrpc.getListPostureDeploymentsMethod = + getListPostureDeploymentsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListPostureDeployments")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("ListPostureDeployments")) + .build(); + } + } + } + return getListPostureDeploymentsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest, + com.google.cloud.securityposture.v1.PostureDeployment> + getGetPostureDeploymentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPostureDeployment", + requestType = com.google.cloud.securityposture.v1.GetPostureDeploymentRequest.class, + responseType = com.google.cloud.securityposture.v1.PostureDeployment.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest, + com.google.cloud.securityposture.v1.PostureDeployment> + getGetPostureDeploymentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest, + com.google.cloud.securityposture.v1.PostureDeployment> + getGetPostureDeploymentMethod; + if ((getGetPostureDeploymentMethod = SecurityPostureGrpc.getGetPostureDeploymentMethod) + == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getGetPostureDeploymentMethod = SecurityPostureGrpc.getGetPostureDeploymentMethod) + == null) { + SecurityPostureGrpc.getGetPostureDeploymentMethod = + getGetPostureDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetPostureDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.PostureDeployment + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("GetPostureDeployment")) + .build(); + } + } + } + return getGetPostureDeploymentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest, + com.google.longrunning.Operation> + getCreatePostureDeploymentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePostureDeployment", + requestType = com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest, + com.google.longrunning.Operation> + getCreatePostureDeploymentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest, + com.google.longrunning.Operation> + getCreatePostureDeploymentMethod; + if ((getCreatePostureDeploymentMethod = SecurityPostureGrpc.getCreatePostureDeploymentMethod) + == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getCreatePostureDeploymentMethod = + SecurityPostureGrpc.getCreatePostureDeploymentMethod) + == null) { + SecurityPostureGrpc.getCreatePostureDeploymentMethod = + getCreatePostureDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreatePostureDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("CreatePostureDeployment")) + .build(); + } + } + } + return getCreatePostureDeploymentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest, + com.google.longrunning.Operation> + getUpdatePostureDeploymentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePostureDeployment", + requestType = com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest, + com.google.longrunning.Operation> + getUpdatePostureDeploymentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest, + com.google.longrunning.Operation> + getUpdatePostureDeploymentMethod; + if ((getUpdatePostureDeploymentMethod = SecurityPostureGrpc.getUpdatePostureDeploymentMethod) + == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getUpdatePostureDeploymentMethod = + SecurityPostureGrpc.getUpdatePostureDeploymentMethod) + == null) { + SecurityPostureGrpc.getUpdatePostureDeploymentMethod = + getUpdatePostureDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "UpdatePostureDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("UpdatePostureDeployment")) + .build(); + } + } + } + return getUpdatePostureDeploymentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest, + com.google.longrunning.Operation> + getDeletePostureDeploymentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePostureDeployment", + requestType = com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest, + com.google.longrunning.Operation> + getDeletePostureDeploymentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest, + com.google.longrunning.Operation> + getDeletePostureDeploymentMethod; + if ((getDeletePostureDeploymentMethod = SecurityPostureGrpc.getDeletePostureDeploymentMethod) + == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getDeletePostureDeploymentMethod = + SecurityPostureGrpc.getDeletePostureDeploymentMethod) + == null) { + SecurityPostureGrpc.getDeletePostureDeploymentMethod = + getDeletePostureDeploymentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeletePostureDeployment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("DeletePostureDeployment")) + .build(); + } + } + } + return getDeletePostureDeploymentMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest, + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse> + getListPostureTemplatesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPostureTemplates", + requestType = com.google.cloud.securityposture.v1.ListPostureTemplatesRequest.class, + responseType = com.google.cloud.securityposture.v1.ListPostureTemplatesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest, + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse> + getListPostureTemplatesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest, + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse> + getListPostureTemplatesMethod; + if ((getListPostureTemplatesMethod = SecurityPostureGrpc.getListPostureTemplatesMethod) + == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getListPostureTemplatesMethod = SecurityPostureGrpc.getListPostureTemplatesMethod) + == null) { + SecurityPostureGrpc.getListPostureTemplatesMethod = + getListPostureTemplatesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListPostureTemplates")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("ListPostureTemplates")) + .build(); + } + } + } + return getListPostureTemplatesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureTemplateRequest, + com.google.cloud.securityposture.v1.PostureTemplate> + getGetPostureTemplateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPostureTemplate", + requestType = com.google.cloud.securityposture.v1.GetPostureTemplateRequest.class, + responseType = com.google.cloud.securityposture.v1.PostureTemplate.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureTemplateRequest, + com.google.cloud.securityposture.v1.PostureTemplate> + getGetPostureTemplateMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.securityposture.v1.GetPostureTemplateRequest, + com.google.cloud.securityposture.v1.PostureTemplate> + getGetPostureTemplateMethod; + if ((getGetPostureTemplateMethod = SecurityPostureGrpc.getGetPostureTemplateMethod) == null) { + synchronized (SecurityPostureGrpc.class) { + if ((getGetPostureTemplateMethod = SecurityPostureGrpc.getGetPostureTemplateMethod) + == null) { + SecurityPostureGrpc.getGetPostureTemplateMethod = + getGetPostureTemplateMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPostureTemplate")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.GetPostureTemplateRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.securityposture.v1.PostureTemplate + .getDefaultInstance())) + .setSchemaDescriptor( + new SecurityPostureMethodDescriptorSupplier("GetPostureTemplate")) + .build(); + } + } + } + return getGetPostureTemplateMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SecurityPostureStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SecurityPostureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityPostureStub(channel, callOptions); + } + }; + return SecurityPostureStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SecurityPostureBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SecurityPostureBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityPostureBlockingStub(channel, callOptions); + } + }; + return SecurityPostureBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SecurityPostureFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SecurityPostureFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityPostureFutureStub(channel, callOptions); + } + }; + return SecurityPostureFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service describing handlers for resources.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * (-- This option restricts the visibility of the API to only projects that
+     * will
+     * (-- be labeled as `PREVIEW` or `GOOGLE_INTERNAL` by the service.
+     * (-- option (google.api.api_visibility).restriction =
+     * "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in a given organization
+     * and location. In case a posture has multiple revisions, the latest revision
+     * as per UpdateTime will be returned.
+     * 
+ */ + default void listPostures( + com.google.cloud.securityposture.v1.ListPosturesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPosturesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists revisions of a Posture in a given organization and location.
+     * 
+ */ + default void listPostureRevisions( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPostureRevisionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a posture in a given organization and location.
+     * User must provide revision_id to retrieve a specific revision of the
+     * resource.
+     * NOT_FOUND error is returned if the revision_id or the Posture name does not
+     * exist. In case revision_id is not provided then the latest Posture revision
+     * by UpdateTime is returned.
+     * 
+ */ + default void getPosture( + com.google.cloud.securityposture.v1.GetPostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPostureMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new Posture resource.
+     * If a Posture with the specified name already exists in the specified
+     * organization and location, the long running operation returns a
+     * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + default void createPosture( + com.google.cloud.securityposture.v1.CreatePostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreatePostureMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing Posture.
+     * A new revision of the posture will be created if the revision to be
+     * updated is currently deployed on a workload.
+     * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the
+     * Posture does not exist.
+     * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag
+     * supplied in the request does not match the persisted etag of the Posture.
+     * Updatable fields are state, description and policy_sets.
+     * State update operation cannot be clubbed with update of description and
+     * policy_sets.
+     * An ACTIVE posture can be updated to both DRAFT or DEPRECATED states.
+     * Postures in DRAFT or DEPRECATED states can only be updated to ACTIVE state.
+     * 
+ */ + default void updatePosture( + com.google.cloud.securityposture.v1.UpdatePostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdatePostureMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes all the revisions of a resource.
+     * A posture can only be deleted when none of the revisions are deployed to
+     * any workload.
+     * 
+ */ + default void deletePosture( + com.google.cloud.securityposture.v1.DeletePostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeletePostureMethod(), responseObserver); + } + + /** + * + * + *
+     * Extracts existing policies on a workload as a posture.
+     * If a Posture on the given workload already exists, the long running
+     * operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + default void extractPosture( + com.google.cloud.securityposture.v1.ExtractPostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getExtractPostureMethod(), responseObserver); + } + + /** + * + * + *
+     * PostureDeployments
+     * Lists PostureDeployments in a given project and location.
+     * 
+ */ + default void listPostureDeployments( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPostureDeploymentsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single PostureDeployment.
+     * 
+ */ + default void getPostureDeployment( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetPostureDeploymentMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new PostureDeployment in a given project and location.
+     * 
+ */ + default void createPostureDeployment( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreatePostureDeploymentMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single PostureDeployment.
+     * 
+ */ + default void updatePostureDeployment( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdatePostureDeploymentMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a single PostureDeployment.
+     * 
+ */ + default void deletePostureDeployment( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeletePostureDeploymentMethod(), responseObserver); + } + + /** + * + * + *
+     * PostureTemplates
+     * Lists all the PostureTemplates available to the user.
+     * 
+ */ + default void listPostureTemplates( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListPostureTemplatesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a PostureTemplate.
+     * User must provide revision_id to retrieve a specific revision of the
+     * resource.
+     * NOT_FOUND error is returned if the revision_id or the PostureTemplate name
+     * does not exist. In case revision_id is not provided then the
+     * PostureTemplate with latest revision_id is returned.
+     * 
+ */ + default void getPostureTemplate( + com.google.cloud.securityposture.v1.GetPostureTemplateRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetPostureTemplateMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SecurityPosture. + * + *
+   * Service describing handlers for resources.
+   * 
+ */ + public abstract static class SecurityPostureImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SecurityPostureGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SecurityPosture. + * + *
+   * Service describing handlers for resources.
+   * 
+ */ + public static final class SecurityPostureStub + extends io.grpc.stub.AbstractAsyncStub { + private SecurityPostureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityPostureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityPostureStub(channel, callOptions); + } + + /** + * + * + *
+     * (-- This option restricts the visibility of the API to only projects that
+     * will
+     * (-- be labeled as `PREVIEW` or `GOOGLE_INTERNAL` by the service.
+     * (-- option (google.api.api_visibility).restriction =
+     * "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in a given organization
+     * and location. In case a posture has multiple revisions, the latest revision
+     * as per UpdateTime will be returned.
+     * 
+ */ + public void listPostures( + com.google.cloud.securityposture.v1.ListPosturesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPosturesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists revisions of a Posture in a given organization and location.
+     * 
+ */ + public void listPostureRevisions( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPostureRevisionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a posture in a given organization and location.
+     * User must provide revision_id to retrieve a specific revision of the
+     * resource.
+     * NOT_FOUND error is returned if the revision_id or the Posture name does not
+     * exist. In case revision_id is not provided then the latest Posture revision
+     * by UpdateTime is returned.
+     * 
+ */ + public void getPosture( + com.google.cloud.securityposture.v1.GetPostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPostureMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a new Posture resource.
+     * If a Posture with the specified name already exists in the specified
+     * organization and location, the long running operation returns a
+     * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public void createPosture( + com.google.cloud.securityposture.v1.CreatePostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePostureMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing Posture.
+     * A new revision of the posture will be created if the revision to be
+     * updated is currently deployed on a workload.
+     * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the
+     * Posture does not exist.
+     * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag
+     * supplied in the request does not match the persisted etag of the Posture.
+     * Updatable fields are state, description and policy_sets.
+     * State update operation cannot be clubbed with update of description and
+     * policy_sets.
+     * An ACTIVE posture can be updated to both DRAFT or DEPRECATED states.
+     * Postures in DRAFT or DEPRECATED states can only be updated to ACTIVE state.
+     * 
+ */ + public void updatePosture( + com.google.cloud.securityposture.v1.UpdatePostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePostureMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes all the revisions of a resource.
+     * A posture can only be deleted when none of the revisions are deployed to
+     * any workload.
+     * 
+ */ + public void deletePosture( + com.google.cloud.securityposture.v1.DeletePostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePostureMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Extracts existing policies on a workload as a posture.
+     * If a Posture on the given workload already exists, the long running
+     * operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public void extractPosture( + com.google.cloud.securityposture.v1.ExtractPostureRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExtractPostureMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * PostureDeployments
+     * Lists PostureDeployments in a given project and location.
+     * 
+ */ + public void listPostureDeployments( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPostureDeploymentsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single PostureDeployment.
+     * 
+ */ + public void getPostureDeployment( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPostureDeploymentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new PostureDeployment in a given project and location.
+     * 
+ */ + public void createPostureDeployment( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePostureDeploymentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the parameters of a single PostureDeployment.
+     * 
+ */ + public void updatePostureDeployment( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePostureDeploymentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a single PostureDeployment.
+     * 
+ */ + public void deletePostureDeployment( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePostureDeploymentMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * PostureTemplates
+     * Lists all the PostureTemplates available to the user.
+     * 
+ */ + public void listPostureTemplates( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPostureTemplatesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a PostureTemplate.
+     * User must provide revision_id to retrieve a specific revision of the
+     * resource.
+     * NOT_FOUND error is returned if the revision_id or the PostureTemplate name
+     * does not exist. In case revision_id is not provided then the
+     * PostureTemplate with latest revision_id is returned.
+     * 
+ */ + public void getPostureTemplate( + com.google.cloud.securityposture.v1.GetPostureTemplateRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPostureTemplateMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SecurityPosture. + * + *
+   * Service describing handlers for resources.
+   * 
+ */ + public static final class SecurityPostureBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SecurityPostureBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityPostureBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityPostureBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * (-- This option restricts the visibility of the API to only projects that
+     * will
+     * (-- be labeled as `PREVIEW` or `GOOGLE_INTERNAL` by the service.
+     * (-- option (google.api.api_visibility).restriction =
+     * "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in a given organization
+     * and location. In case a posture has multiple revisions, the latest revision
+     * as per UpdateTime will be returned.
+     * 
+ */ + public com.google.cloud.securityposture.v1.ListPosturesResponse listPostures( + com.google.cloud.securityposture.v1.ListPosturesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPosturesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists revisions of a Posture in a given organization and location.
+     * 
+ */ + public com.google.cloud.securityposture.v1.ListPostureRevisionsResponse listPostureRevisions( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPostureRevisionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a posture in a given organization and location.
+     * User must provide revision_id to retrieve a specific revision of the
+     * resource.
+     * NOT_FOUND error is returned if the revision_id or the Posture name does not
+     * exist. In case revision_id is not provided then the latest Posture revision
+     * by UpdateTime is returned.
+     * 
+ */ + public com.google.cloud.securityposture.v1.Posture getPosture( + com.google.cloud.securityposture.v1.GetPostureRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPostureMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new Posture resource.
+     * If a Posture with the specified name already exists in the specified
+     * organization and location, the long running operation returns a
+     * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public com.google.longrunning.Operation createPosture( + com.google.cloud.securityposture.v1.CreatePostureRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePostureMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing Posture.
+     * A new revision of the posture will be created if the revision to be
+     * updated is currently deployed on a workload.
+     * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the
+     * Posture does not exist.
+     * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag
+     * supplied in the request does not match the persisted etag of the Posture.
+     * Updatable fields are state, description and policy_sets.
+     * State update operation cannot be clubbed with update of description and
+     * policy_sets.
+     * An ACTIVE posture can be updated to both DRAFT or DEPRECATED states.
+     * Postures in DRAFT or DEPRECATED states can only be updated to ACTIVE state.
+     * 
+ */ + public com.google.longrunning.Operation updatePosture( + com.google.cloud.securityposture.v1.UpdatePostureRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePostureMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes all the revisions of a resource.
+     * A posture can only be deleted when none of the revisions are deployed to
+     * any workload.
+     * 
+ */ + public com.google.longrunning.Operation deletePosture( + com.google.cloud.securityposture.v1.DeletePostureRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePostureMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Extracts existing policies on a workload as a posture.
+     * If a Posture on the given workload already exists, the long running
+     * operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public com.google.longrunning.Operation extractPosture( + com.google.cloud.securityposture.v1.ExtractPostureRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExtractPostureMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * PostureDeployments
+     * Lists PostureDeployments in a given project and location.
+     * 
+ */ + public com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse + listPostureDeployments( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPostureDeploymentsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single PostureDeployment.
+     * 
+ */ + public com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployment( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPostureDeploymentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new PostureDeployment in a given project and location.
+     * 
+ */ + public com.google.longrunning.Operation createPostureDeployment( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePostureDeploymentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the parameters of a single PostureDeployment.
+     * 
+ */ + public com.google.longrunning.Operation updatePostureDeployment( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePostureDeploymentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a single PostureDeployment.
+     * 
+ */ + public com.google.longrunning.Operation deletePostureDeployment( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePostureDeploymentMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * PostureTemplates
+     * Lists all the PostureTemplates available to the user.
+     * 
+ */ + public com.google.cloud.securityposture.v1.ListPostureTemplatesResponse listPostureTemplates( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPostureTemplatesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a PostureTemplate.
+     * User must provide revision_id to retrieve a specific revision of the
+     * resource.
+     * NOT_FOUND error is returned if the revision_id or the PostureTemplate name
+     * does not exist. In case revision_id is not provided then the
+     * PostureTemplate with latest revision_id is returned.
+     * 
+ */ + public com.google.cloud.securityposture.v1.PostureTemplate getPostureTemplate( + com.google.cloud.securityposture.v1.GetPostureTemplateRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPostureTemplateMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SecurityPosture. + * + *
+   * Service describing handlers for resources.
+   * 
+ */ + public static final class SecurityPostureFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SecurityPostureFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SecurityPostureFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SecurityPostureFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * (-- This option restricts the visibility of the API to only projects that
+     * will
+     * (-- be labeled as `PREVIEW` or `GOOGLE_INTERNAL` by the service.
+     * (-- option (google.api.api_visibility).restriction =
+     * "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in a given organization
+     * and location. In case a posture has multiple revisions, the latest revision
+     * as per UpdateTime will be returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securityposture.v1.ListPosturesResponse> + listPostures(com.google.cloud.securityposture.v1.ListPosturesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPosturesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists revisions of a Posture in a given organization and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse> + listPostureRevisions( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPostureRevisionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a posture in a given organization and location.
+     * User must provide revision_id to retrieve a specific revision of the
+     * resource.
+     * NOT_FOUND error is returned if the revision_id or the Posture name does not
+     * exist. In case revision_id is not provided then the latest Posture revision
+     * by UpdateTime is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securityposture.v1.Posture> + getPosture(com.google.cloud.securityposture.v1.GetPostureRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPostureMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new Posture resource.
+     * If a Posture with the specified name already exists in the specified
+     * organization and location, the long running operation returns a
+     * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createPosture(com.google.cloud.securityposture.v1.CreatePostureRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePostureMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing Posture.
+     * A new revision of the posture will be created if the revision to be
+     * updated is currently deployed on a workload.
+     * Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the
+     * Posture does not exist.
+     * Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag
+     * supplied in the request does not match the persisted etag of the Posture.
+     * Updatable fields are state, description and policy_sets.
+     * State update operation cannot be clubbed with update of description and
+     * policy_sets.
+     * An ACTIVE posture can be updated to both DRAFT or DEPRECATED states.
+     * Postures in DRAFT or DEPRECATED states can only be updated to ACTIVE state.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updatePosture(com.google.cloud.securityposture.v1.UpdatePostureRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePostureMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes all the revisions of a resource.
+     * A posture can only be deleted when none of the revisions are deployed to
+     * any workload.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deletePosture(com.google.cloud.securityposture.v1.DeletePostureRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePostureMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Extracts existing policies on a workload as a posture.
+     * If a Posture on the given workload already exists, the long running
+     * operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + extractPosture(com.google.cloud.securityposture.v1.ExtractPostureRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExtractPostureMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * PostureDeployments
+     * Lists PostureDeployments in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse> + listPostureDeployments( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPostureDeploymentsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single PostureDeployment.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securityposture.v1.PostureDeployment> + getPostureDeployment( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPostureDeploymentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new PostureDeployment in a given project and location.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createPostureDeployment( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePostureDeploymentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the parameters of a single PostureDeployment.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updatePostureDeployment( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePostureDeploymentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a single PostureDeployment.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deletePostureDeployment( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePostureDeploymentMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * PostureTemplates
+     * Lists all the PostureTemplates available to the user.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse> + listPostureTemplates( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPostureTemplatesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a PostureTemplate.
+     * User must provide revision_id to retrieve a specific revision of the
+     * resource.
+     * NOT_FOUND error is returned if the revision_id or the PostureTemplate name
+     * does not exist. In case revision_id is not provided then the
+     * PostureTemplate with latest revision_id is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.securityposture.v1.PostureTemplate> + getPostureTemplate(com.google.cloud.securityposture.v1.GetPostureTemplateRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPostureTemplateMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_POSTURES = 0; + private static final int METHODID_LIST_POSTURE_REVISIONS = 1; + private static final int METHODID_GET_POSTURE = 2; + private static final int METHODID_CREATE_POSTURE = 3; + private static final int METHODID_UPDATE_POSTURE = 4; + private static final int METHODID_DELETE_POSTURE = 5; + private static final int METHODID_EXTRACT_POSTURE = 6; + private static final int METHODID_LIST_POSTURE_DEPLOYMENTS = 7; + private static final int METHODID_GET_POSTURE_DEPLOYMENT = 8; + private static final int METHODID_CREATE_POSTURE_DEPLOYMENT = 9; + private static final int METHODID_UPDATE_POSTURE_DEPLOYMENT = 10; + private static final int METHODID_DELETE_POSTURE_DEPLOYMENT = 11; + private static final int METHODID_LIST_POSTURE_TEMPLATES = 12; + private static final int METHODID_GET_POSTURE_TEMPLATE = 13; + + 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_POSTURES: + serviceImpl.listPostures( + (com.google.cloud.securityposture.v1.ListPosturesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPosturesResponse>) + responseObserver); + break; + case METHODID_LIST_POSTURE_REVISIONS: + serviceImpl.listPostureRevisions( + (com.google.cloud.securityposture.v1.ListPostureRevisionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse>) + responseObserver); + break; + case METHODID_GET_POSTURE: + serviceImpl.getPosture( + (com.google.cloud.securityposture.v1.GetPostureRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_POSTURE: + serviceImpl.createPosture( + (com.google.cloud.securityposture.v1.CreatePostureRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_POSTURE: + serviceImpl.updatePosture( + (com.google.cloud.securityposture.v1.UpdatePostureRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_POSTURE: + serviceImpl.deletePosture( + (com.google.cloud.securityposture.v1.DeletePostureRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EXTRACT_POSTURE: + serviceImpl.extractPosture( + (com.google.cloud.securityposture.v1.ExtractPostureRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_POSTURE_DEPLOYMENTS: + serviceImpl.listPostureDeployments( + (com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse>) + responseObserver); + break; + case METHODID_GET_POSTURE_DEPLOYMENT: + serviceImpl.getPostureDeployment( + (com.google.cloud.securityposture.v1.GetPostureDeploymentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_POSTURE_DEPLOYMENT: + serviceImpl.createPostureDeployment( + (com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_POSTURE_DEPLOYMENT: + serviceImpl.updatePostureDeployment( + (com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_POSTURE_DEPLOYMENT: + serviceImpl.deletePostureDeployment( + (com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_POSTURE_TEMPLATES: + serviceImpl.listPostureTemplates( + (com.google.cloud.securityposture.v1.ListPostureTemplatesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse>) + responseObserver); + break; + case METHODID_GET_POSTURE_TEMPLATE: + serviceImpl.getPostureTemplate( + (com.google.cloud.securityposture.v1.GetPostureTemplateRequest) 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( + getListPosturesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.ListPosturesRequest, + com.google.cloud.securityposture.v1.ListPosturesResponse>( + service, METHODID_LIST_POSTURES))) + .addMethod( + getListPostureRevisionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest, + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse>( + service, METHODID_LIST_POSTURE_REVISIONS))) + .addMethod( + getGetPostureMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.GetPostureRequest, + com.google.cloud.securityposture.v1.Posture>(service, METHODID_GET_POSTURE))) + .addMethod( + getCreatePostureMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.CreatePostureRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_POSTURE))) + .addMethod( + getUpdatePostureMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.UpdatePostureRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_POSTURE))) + .addMethod( + getDeletePostureMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.DeletePostureRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_POSTURE))) + .addMethod( + getExtractPostureMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.ExtractPostureRequest, + com.google.longrunning.Operation>(service, METHODID_EXTRACT_POSTURE))) + .addMethod( + getListPostureDeploymentsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest, + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse>( + service, METHODID_LIST_POSTURE_DEPLOYMENTS))) + .addMethod( + getGetPostureDeploymentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest, + com.google.cloud.securityposture.v1.PostureDeployment>( + service, METHODID_GET_POSTURE_DEPLOYMENT))) + .addMethod( + getCreatePostureDeploymentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_POSTURE_DEPLOYMENT))) + .addMethod( + getUpdatePostureDeploymentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_POSTURE_DEPLOYMENT))) + .addMethod( + getDeletePostureDeploymentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_POSTURE_DEPLOYMENT))) + .addMethod( + getListPostureTemplatesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest, + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse>( + service, METHODID_LIST_POSTURE_TEMPLATES))) + .addMethod( + getGetPostureTemplateMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.securityposture.v1.GetPostureTemplateRequest, + com.google.cloud.securityposture.v1.PostureTemplate>( + service, METHODID_GET_POSTURE_TEMPLATE))) + .build(); + } + + private abstract static class SecurityPostureBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SecurityPostureBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SecurityPosture"); + } + } + + private static final class SecurityPostureFileDescriptorSupplier + extends SecurityPostureBaseDescriptorSupplier { + SecurityPostureFileDescriptorSupplier() {} + } + + private static final class SecurityPostureMethodDescriptorSupplier + extends SecurityPostureBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SecurityPostureMethodDescriptorSupplier(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 (SecurityPostureGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SecurityPostureFileDescriptorSupplier()) + .addMethod(getListPosturesMethod()) + .addMethod(getListPostureRevisionsMethod()) + .addMethod(getGetPostureMethod()) + .addMethod(getCreatePostureMethod()) + .addMethod(getUpdatePostureMethod()) + .addMethod(getDeletePostureMethod()) + .addMethod(getExtractPostureMethod()) + .addMethod(getListPostureDeploymentsMethod()) + .addMethod(getGetPostureDeploymentMethod()) + .addMethod(getCreatePostureDeploymentMethod()) + .addMethod(getUpdatePostureDeploymentMethod()) + .addMethod(getDeletePostureDeploymentMethod()) + .addMethod(getListPostureTemplatesMethod()) + .addMethod(getGetPostureTemplateMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-securityposture/owlbot.py b/java-securityposture/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-securityposture/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-securityposture/pom.xml b/java-securityposture/pom.xml new file mode 100644 index 000000000000..233eb8f62e93 --- /dev/null +++ b/java-securityposture/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-securityposture-parent + pom + 0.0.1-SNAPSHOT + Google Security Posture API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.30.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-securityposture-parent + + + + + + com.google.cloud + google-cloud-securityposture + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-securityposture-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-securityposture-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-securityposture + grpc-google-cloud-securityposture-v1 + proto-google-cloud-securityposture-v1 + google-cloud-securityposture-bom + + + diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/clirr-ignored-differences.xml b/java-securityposture/proto-google-cloud-securityposture-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..1ec7982c0627 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/securityposture/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/securityposture/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/securityposture/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/pom.xml b/java-securityposture/proto-google-cloud-securityposture-v1/pom.xml new file mode 100644 index 000000000000..bfa27046dedf --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-securityposture-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-securityposture-v1 + Proto library for google-cloud-securityposture + + com.google.cloud + google-cloud-securityposture-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-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Constraint.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Constraint.java new file mode 100644 index 000000000000..a6855fb4f4a7 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Constraint.java @@ -0,0 +1,1873 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Representation of a Constraint.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.Constraint} + */ +public final class Constraint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.Constraint) + ConstraintOrBuilder { + private static final long serialVersionUID = 0L; + // Use Constraint.newBuilder() to construct. + private Constraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Constraint() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Constraint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Constraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Constraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.Constraint.class, + com.google.cloud.securityposture.v1.Constraint.Builder.class); + } + + private int implementationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object implementation_; + + public enum ImplementationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SECURITY_HEALTH_ANALYTICS_MODULE(3), + SECURITY_HEALTH_ANALYTICS_CUSTOM_MODULE(4), + ORG_POLICY_CONSTRAINT(5), + ORG_POLICY_CONSTRAINT_CUSTOM(6), + IMPLEMENTATION_NOT_SET(0); + private final int value; + + private ImplementationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ImplementationCase valueOf(int value) { + return forNumber(value); + } + + public static ImplementationCase forNumber(int value) { + switch (value) { + case 3: + return SECURITY_HEALTH_ANALYTICS_MODULE; + case 4: + return SECURITY_HEALTH_ANALYTICS_CUSTOM_MODULE; + case 5: + return ORG_POLICY_CONSTRAINT; + case 6: + return ORG_POLICY_CONSTRAINT_CUSTOM; + case 0: + return IMPLEMENTATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ImplementationCase getImplementationCase() { + return ImplementationCase.forNumber(implementationCase_); + } + + public static final int SECURITY_HEALTH_ANALYTICS_MODULE_FIELD_NUMBER = 3; + /** + * + * + *
+   * Optional. SHA built-in detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the securityHealthAnalyticsModule field is set. + */ + @java.lang.Override + public boolean hasSecurityHealthAnalyticsModule() { + return implementationCase_ == 3; + } + /** + * + * + *
+   * Optional. SHA built-in detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The securityHealthAnalyticsModule. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + getSecurityHealthAnalyticsModule() { + if (implementationCase_ == 3) { + return (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) implementation_; + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. SHA built-in detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModuleOrBuilder + getSecurityHealthAnalyticsModuleOrBuilder() { + if (implementationCase_ == 3) { + return (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) implementation_; + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.getDefaultInstance(); + } + + public static final int SECURITY_HEALTH_ANALYTICS_CUSTOM_MODULE_FIELD_NUMBER = 4; + /** + * + * + *
+   * Optional. SHA custom detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the securityHealthAnalyticsCustomModule field is set. + */ + @java.lang.Override + public boolean hasSecurityHealthAnalyticsCustomModule() { + return implementationCase_ == 4; + } + /** + * + * + *
+   * Optional. SHA custom detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The securityHealthAnalyticsCustomModule. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + getSecurityHealthAnalyticsCustomModule() { + if (implementationCase_ == 4) { + return (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + implementation_; + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance(); + } + /** + * + * + *
+   * Optional. SHA custom detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModuleOrBuilder + getSecurityHealthAnalyticsCustomModuleOrBuilder() { + if (implementationCase_ == 4) { + return (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + implementation_; + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance(); + } + + public static final int ORG_POLICY_CONSTRAINT_FIELD_NUMBER = 5; + /** + * + * + *
+   * Optional. Org Policy builtin constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the orgPolicyConstraint field is set. + */ + @java.lang.Override + public boolean hasOrgPolicyConstraint() { + return implementationCase_ == 5; + } + /** + * + * + *
+   * Optional. Org Policy builtin constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The orgPolicyConstraint. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraint getOrgPolicyConstraint() { + if (implementationCase_ == 5) { + return (com.google.cloud.securityposture.v1.OrgPolicyConstraint) implementation_; + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. Org Policy builtin constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintOrBuilder + getOrgPolicyConstraintOrBuilder() { + if (implementationCase_ == 5) { + return (com.google.cloud.securityposture.v1.OrgPolicyConstraint) implementation_; + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance(); + } + + public static final int ORG_POLICY_CONSTRAINT_CUSTOM_FIELD_NUMBER = 6; + /** + * + * + *
+   * Optional. Org Policy custom constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the orgPolicyConstraintCustom field is set. + */ + @java.lang.Override + public boolean hasOrgPolicyConstraintCustom() { + return implementationCase_ == 6; + } + /** + * + * + *
+   * Optional. Org Policy custom constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The orgPolicyConstraintCustom. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom + getOrgPolicyConstraintCustom() { + if (implementationCase_ == 6) { + return (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) implementation_; + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.getDefaultInstance(); + } + /** + * + * + *
+   * Optional. Org Policy custom constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintCustomOrBuilder + getOrgPolicyConstraintCustomOrBuilder() { + if (implementationCase_ == 6) { + return (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) implementation_; + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.getDefaultInstance(); + } + + 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 (implementationCase_ == 3) { + output.writeMessage( + 3, (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) implementation_); + } + if (implementationCase_ == 4) { + output.writeMessage( + 4, + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + implementation_); + } + if (implementationCase_ == 5) { + output.writeMessage( + 5, (com.google.cloud.securityposture.v1.OrgPolicyConstraint) implementation_); + } + if (implementationCase_ == 6) { + output.writeMessage( + 6, (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) implementation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (implementationCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) implementation_); + } + if (implementationCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + implementation_); + } + if (implementationCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.securityposture.v1.OrgPolicyConstraint) implementation_); + } + if (implementationCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) implementation_); + } + 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.securityposture.v1.Constraint)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.Constraint other = + (com.google.cloud.securityposture.v1.Constraint) obj; + + if (!getImplementationCase().equals(other.getImplementationCase())) return false; + switch (implementationCase_) { + case 3: + if (!getSecurityHealthAnalyticsModule().equals(other.getSecurityHealthAnalyticsModule())) + return false; + break; + case 4: + if (!getSecurityHealthAnalyticsCustomModule() + .equals(other.getSecurityHealthAnalyticsCustomModule())) return false; + break; + case 5: + if (!getOrgPolicyConstraint().equals(other.getOrgPolicyConstraint())) return false; + break; + case 6: + if (!getOrgPolicyConstraintCustom().equals(other.getOrgPolicyConstraintCustom())) + return false; + break; + case 0: + default: + } + 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(); + switch (implementationCase_) { + case 3: + hash = (37 * hash) + SECURITY_HEALTH_ANALYTICS_MODULE_FIELD_NUMBER; + hash = (53 * hash) + getSecurityHealthAnalyticsModule().hashCode(); + break; + case 4: + hash = (37 * hash) + SECURITY_HEALTH_ANALYTICS_CUSTOM_MODULE_FIELD_NUMBER; + hash = (53 * hash) + getSecurityHealthAnalyticsCustomModule().hashCode(); + break; + case 5: + hash = (37 * hash) + ORG_POLICY_CONSTRAINT_FIELD_NUMBER; + hash = (53 * hash) + getOrgPolicyConstraint().hashCode(); + break; + case 6: + hash = (37 * hash) + ORG_POLICY_CONSTRAINT_CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + getOrgPolicyConstraintCustom().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.Constraint parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Constraint 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.securityposture.v1.Constraint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Constraint 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.securityposture.v1.Constraint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Constraint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.Constraint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Constraint 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.securityposture.v1.Constraint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Constraint 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.securityposture.v1.Constraint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Constraint 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.securityposture.v1.Constraint 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; + } + /** + * + * + *
+   * Representation of a Constraint.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.Constraint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.Constraint) + com.google.cloud.securityposture.v1.ConstraintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Constraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Constraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.Constraint.class, + com.google.cloud.securityposture.v1.Constraint.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.Constraint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (securityHealthAnalyticsModuleBuilder_ != null) { + securityHealthAnalyticsModuleBuilder_.clear(); + } + if (securityHealthAnalyticsCustomModuleBuilder_ != null) { + securityHealthAnalyticsCustomModuleBuilder_.clear(); + } + if (orgPolicyConstraintBuilder_ != null) { + orgPolicyConstraintBuilder_.clear(); + } + if (orgPolicyConstraintCustomBuilder_ != null) { + orgPolicyConstraintCustomBuilder_.clear(); + } + implementationCase_ = 0; + implementation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Constraint_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Constraint getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.Constraint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Constraint build() { + com.google.cloud.securityposture.v1.Constraint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Constraint buildPartial() { + com.google.cloud.securityposture.v1.Constraint result = + new com.google.cloud.securityposture.v1.Constraint(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.Constraint result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.securityposture.v1.Constraint result) { + result.implementationCase_ = implementationCase_; + result.implementation_ = this.implementation_; + if (implementationCase_ == 3 && securityHealthAnalyticsModuleBuilder_ != null) { + result.implementation_ = securityHealthAnalyticsModuleBuilder_.build(); + } + if (implementationCase_ == 4 && securityHealthAnalyticsCustomModuleBuilder_ != null) { + result.implementation_ = securityHealthAnalyticsCustomModuleBuilder_.build(); + } + if (implementationCase_ == 5 && orgPolicyConstraintBuilder_ != null) { + result.implementation_ = orgPolicyConstraintBuilder_.build(); + } + if (implementationCase_ == 6 && orgPolicyConstraintCustomBuilder_ != null) { + result.implementation_ = orgPolicyConstraintCustomBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securityposture.v1.Constraint) { + return mergeFrom((com.google.cloud.securityposture.v1.Constraint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.Constraint other) { + if (other == com.google.cloud.securityposture.v1.Constraint.getDefaultInstance()) return this; + switch (other.getImplementationCase()) { + case SECURITY_HEALTH_ANALYTICS_MODULE: + { + mergeSecurityHealthAnalyticsModule(other.getSecurityHealthAnalyticsModule()); + break; + } + case SECURITY_HEALTH_ANALYTICS_CUSTOM_MODULE: + { + mergeSecurityHealthAnalyticsCustomModule( + other.getSecurityHealthAnalyticsCustomModule()); + break; + } + case ORG_POLICY_CONSTRAINT: + { + mergeOrgPolicyConstraint(other.getOrgPolicyConstraint()); + break; + } + case ORG_POLICY_CONSTRAINT_CUSTOM: + { + mergeOrgPolicyConstraintCustom(other.getOrgPolicyConstraintCustom()); + break; + } + case IMPLEMENTATION_NOT_SET: + { + break; + } + } + 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 26: + { + input.readMessage( + getSecurityHealthAnalyticsModuleFieldBuilder().getBuilder(), extensionRegistry); + implementationCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + getSecurityHealthAnalyticsCustomModuleFieldBuilder().getBuilder(), + extensionRegistry); + implementationCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getOrgPolicyConstraintFieldBuilder().getBuilder(), extensionRegistry); + implementationCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + getOrgPolicyConstraintCustomFieldBuilder().getBuilder(), extensionRegistry); + implementationCase_ = 6; + 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 implementationCase_ = 0; + private java.lang.Object implementation_; + + public ImplementationCase getImplementationCase() { + return ImplementationCase.forNumber(implementationCase_); + } + + public Builder clearImplementation() { + implementationCase_ = 0; + implementation_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.Builder, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModuleOrBuilder> + securityHealthAnalyticsModuleBuilder_; + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the securityHealthAnalyticsModule field is set. + */ + @java.lang.Override + public boolean hasSecurityHealthAnalyticsModule() { + return implementationCase_ == 3; + } + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The securityHealthAnalyticsModule. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + getSecurityHealthAnalyticsModule() { + if (securityHealthAnalyticsModuleBuilder_ == null) { + if (implementationCase_ == 3) { + return (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) + implementation_; + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + .getDefaultInstance(); + } else { + if (implementationCase_ == 3) { + return securityHealthAnalyticsModuleBuilder_.getMessage(); + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSecurityHealthAnalyticsModule( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule value) { + if (securityHealthAnalyticsModuleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + implementation_ = value; + onChanged(); + } else { + securityHealthAnalyticsModuleBuilder_.setMessage(value); + } + implementationCase_ = 3; + return this; + } + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSecurityHealthAnalyticsModule( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.Builder builderForValue) { + if (securityHealthAnalyticsModuleBuilder_ == null) { + implementation_ = builderForValue.build(); + onChanged(); + } else { + securityHealthAnalyticsModuleBuilder_.setMessage(builderForValue.build()); + } + implementationCase_ = 3; + return this; + } + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSecurityHealthAnalyticsModule( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule value) { + if (securityHealthAnalyticsModuleBuilder_ == null) { + if (implementationCase_ == 3 + && implementation_ + != com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + .getDefaultInstance()) { + implementation_ = + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.newBuilder( + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) + implementation_) + .mergeFrom(value) + .buildPartial(); + } else { + implementation_ = value; + } + onChanged(); + } else { + if (implementationCase_ == 3) { + securityHealthAnalyticsModuleBuilder_.mergeFrom(value); + } else { + securityHealthAnalyticsModuleBuilder_.setMessage(value); + } + } + implementationCase_ = 3; + return this; + } + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSecurityHealthAnalyticsModule() { + if (securityHealthAnalyticsModuleBuilder_ == null) { + if (implementationCase_ == 3) { + implementationCase_ = 0; + implementation_ = null; + onChanged(); + } + } else { + if (implementationCase_ == 3) { + implementationCase_ = 0; + implementation_ = null; + } + securityHealthAnalyticsModuleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.Builder + getSecurityHealthAnalyticsModuleBuilder() { + return getSecurityHealthAnalyticsModuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModuleOrBuilder + getSecurityHealthAnalyticsModuleOrBuilder() { + if ((implementationCase_ == 3) && (securityHealthAnalyticsModuleBuilder_ != null)) { + return securityHealthAnalyticsModuleBuilder_.getMessageOrBuilder(); + } else { + if (implementationCase_ == 3) { + return (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) + implementation_; + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. SHA built-in detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.Builder, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModuleOrBuilder> + getSecurityHealthAnalyticsModuleFieldBuilder() { + if (securityHealthAnalyticsModuleBuilder_ == null) { + if (!(implementationCase_ == 3)) { + implementation_ = + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + .getDefaultInstance(); + } + securityHealthAnalyticsModuleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.Builder, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModuleOrBuilder>( + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) implementation_, + getParentForChildren(), + isClean()); + implementation_ = null; + } + implementationCase_ = 3; + onChanged(); + return securityHealthAnalyticsModuleBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.Builder, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModuleOrBuilder> + securityHealthAnalyticsCustomModuleBuilder_; + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the securityHealthAnalyticsCustomModule field is set. + */ + @java.lang.Override + public boolean hasSecurityHealthAnalyticsCustomModule() { + return implementationCase_ == 4; + } + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The securityHealthAnalyticsCustomModule. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + getSecurityHealthAnalyticsCustomModule() { + if (securityHealthAnalyticsCustomModuleBuilder_ == null) { + if (implementationCase_ == 4) { + return (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + implementation_; + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance(); + } else { + if (implementationCase_ == 4) { + return securityHealthAnalyticsCustomModuleBuilder_.getMessage(); + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSecurityHealthAnalyticsCustomModule( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule value) { + if (securityHealthAnalyticsCustomModuleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + implementation_ = value; + onChanged(); + } else { + securityHealthAnalyticsCustomModuleBuilder_.setMessage(value); + } + implementationCase_ = 4; + return this; + } + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSecurityHealthAnalyticsCustomModule( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.Builder + builderForValue) { + if (securityHealthAnalyticsCustomModuleBuilder_ == null) { + implementation_ = builderForValue.build(); + onChanged(); + } else { + securityHealthAnalyticsCustomModuleBuilder_.setMessage(builderForValue.build()); + } + implementationCase_ = 4; + return this; + } + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSecurityHealthAnalyticsCustomModule( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule value) { + if (securityHealthAnalyticsCustomModuleBuilder_ == null) { + if (implementationCase_ == 4 + && implementation_ + != com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance()) { + implementation_ = + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.newBuilder( + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + implementation_) + .mergeFrom(value) + .buildPartial(); + } else { + implementation_ = value; + } + onChanged(); + } else { + if (implementationCase_ == 4) { + securityHealthAnalyticsCustomModuleBuilder_.mergeFrom(value); + } else { + securityHealthAnalyticsCustomModuleBuilder_.setMessage(value); + } + } + implementationCase_ = 4; + return this; + } + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSecurityHealthAnalyticsCustomModule() { + if (securityHealthAnalyticsCustomModuleBuilder_ == null) { + if (implementationCase_ == 4) { + implementationCase_ = 0; + implementation_ = null; + onChanged(); + } + } else { + if (implementationCase_ == 4) { + implementationCase_ = 0; + implementation_ = null; + } + securityHealthAnalyticsCustomModuleBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.Builder + getSecurityHealthAnalyticsCustomModuleBuilder() { + return getSecurityHealthAnalyticsCustomModuleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModuleOrBuilder + getSecurityHealthAnalyticsCustomModuleOrBuilder() { + if ((implementationCase_ == 4) && (securityHealthAnalyticsCustomModuleBuilder_ != null)) { + return securityHealthAnalyticsCustomModuleBuilder_.getMessageOrBuilder(); + } else { + if (implementationCase_ == 4) { + return (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + implementation_; + } + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. SHA custom detector.
+     * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.Builder, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModuleOrBuilder> + getSecurityHealthAnalyticsCustomModuleFieldBuilder() { + if (securityHealthAnalyticsCustomModuleBuilder_ == null) { + if (!(implementationCase_ == 4)) { + implementation_ = + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance(); + } + securityHealthAnalyticsCustomModuleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.Builder, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModuleOrBuilder>( + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + implementation_, + getParentForChildren(), + isClean()); + implementation_ = null; + } + implementationCase_ = 4; + onChanged(); + return securityHealthAnalyticsCustomModuleBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.OrgPolicyConstraint, + com.google.cloud.securityposture.v1.OrgPolicyConstraint.Builder, + com.google.cloud.securityposture.v1.OrgPolicyConstraintOrBuilder> + orgPolicyConstraintBuilder_; + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the orgPolicyConstraint field is set. + */ + @java.lang.Override + public boolean hasOrgPolicyConstraint() { + return implementationCase_ == 5; + } + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The orgPolicyConstraint. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraint getOrgPolicyConstraint() { + if (orgPolicyConstraintBuilder_ == null) { + if (implementationCase_ == 5) { + return (com.google.cloud.securityposture.v1.OrgPolicyConstraint) implementation_; + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance(); + } else { + if (implementationCase_ == 5) { + return orgPolicyConstraintBuilder_.getMessage(); + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOrgPolicyConstraint( + com.google.cloud.securityposture.v1.OrgPolicyConstraint value) { + if (orgPolicyConstraintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + implementation_ = value; + onChanged(); + } else { + orgPolicyConstraintBuilder_.setMessage(value); + } + implementationCase_ = 5; + return this; + } + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOrgPolicyConstraint( + com.google.cloud.securityposture.v1.OrgPolicyConstraint.Builder builderForValue) { + if (orgPolicyConstraintBuilder_ == null) { + implementation_ = builderForValue.build(); + onChanged(); + } else { + orgPolicyConstraintBuilder_.setMessage(builderForValue.build()); + } + implementationCase_ = 5; + return this; + } + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeOrgPolicyConstraint( + com.google.cloud.securityposture.v1.OrgPolicyConstraint value) { + if (orgPolicyConstraintBuilder_ == null) { + if (implementationCase_ == 5 + && implementation_ + != com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance()) { + implementation_ = + com.google.cloud.securityposture.v1.OrgPolicyConstraint.newBuilder( + (com.google.cloud.securityposture.v1.OrgPolicyConstraint) implementation_) + .mergeFrom(value) + .buildPartial(); + } else { + implementation_ = value; + } + onChanged(); + } else { + if (implementationCase_ == 5) { + orgPolicyConstraintBuilder_.mergeFrom(value); + } else { + orgPolicyConstraintBuilder_.setMessage(value); + } + } + implementationCase_ = 5; + return this; + } + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearOrgPolicyConstraint() { + if (orgPolicyConstraintBuilder_ == null) { + if (implementationCase_ == 5) { + implementationCase_ = 0; + implementation_ = null; + onChanged(); + } + } else { + if (implementationCase_ == 5) { + implementationCase_ = 0; + implementation_ = null; + } + orgPolicyConstraintBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.OrgPolicyConstraint.Builder + getOrgPolicyConstraintBuilder() { + return getOrgPolicyConstraintFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintOrBuilder + getOrgPolicyConstraintOrBuilder() { + if ((implementationCase_ == 5) && (orgPolicyConstraintBuilder_ != null)) { + return orgPolicyConstraintBuilder_.getMessageOrBuilder(); + } else { + if (implementationCase_ == 5) { + return (com.google.cloud.securityposture.v1.OrgPolicyConstraint) implementation_; + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Org Policy builtin constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.OrgPolicyConstraint, + com.google.cloud.securityposture.v1.OrgPolicyConstraint.Builder, + com.google.cloud.securityposture.v1.OrgPolicyConstraintOrBuilder> + getOrgPolicyConstraintFieldBuilder() { + if (orgPolicyConstraintBuilder_ == null) { + if (!(implementationCase_ == 5)) { + implementation_ = + com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance(); + } + orgPolicyConstraintBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.OrgPolicyConstraint, + com.google.cloud.securityposture.v1.OrgPolicyConstraint.Builder, + com.google.cloud.securityposture.v1.OrgPolicyConstraintOrBuilder>( + (com.google.cloud.securityposture.v1.OrgPolicyConstraint) implementation_, + getParentForChildren(), + isClean()); + implementation_ = null; + } + implementationCase_ = 5; + onChanged(); + return orgPolicyConstraintBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom, + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.Builder, + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustomOrBuilder> + orgPolicyConstraintCustomBuilder_; + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the orgPolicyConstraintCustom field is set. + */ + @java.lang.Override + public boolean hasOrgPolicyConstraintCustom() { + return implementationCase_ == 6; + } + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The orgPolicyConstraintCustom. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom + getOrgPolicyConstraintCustom() { + if (orgPolicyConstraintCustomBuilder_ == null) { + if (implementationCase_ == 6) { + return (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) implementation_; + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.getDefaultInstance(); + } else { + if (implementationCase_ == 6) { + return orgPolicyConstraintCustomBuilder_.getMessage(); + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOrgPolicyConstraintCustom( + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom value) { + if (orgPolicyConstraintCustomBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + implementation_ = value; + onChanged(); + } else { + orgPolicyConstraintCustomBuilder_.setMessage(value); + } + implementationCase_ = 6; + return this; + } + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOrgPolicyConstraintCustom( + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.Builder builderForValue) { + if (orgPolicyConstraintCustomBuilder_ == null) { + implementation_ = builderForValue.build(); + onChanged(); + } else { + orgPolicyConstraintCustomBuilder_.setMessage(builderForValue.build()); + } + implementationCase_ = 6; + return this; + } + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeOrgPolicyConstraintCustom( + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom value) { + if (orgPolicyConstraintCustomBuilder_ == null) { + if (implementationCase_ == 6 + && implementation_ + != com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom + .getDefaultInstance()) { + implementation_ = + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.newBuilder( + (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) + implementation_) + .mergeFrom(value) + .buildPartial(); + } else { + implementation_ = value; + } + onChanged(); + } else { + if (implementationCase_ == 6) { + orgPolicyConstraintCustomBuilder_.mergeFrom(value); + } else { + orgPolicyConstraintCustomBuilder_.setMessage(value); + } + } + implementationCase_ = 6; + return this; + } + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearOrgPolicyConstraintCustom() { + if (orgPolicyConstraintCustomBuilder_ == null) { + if (implementationCase_ == 6) { + implementationCase_ = 0; + implementation_ = null; + onChanged(); + } + } else { + if (implementationCase_ == 6) { + implementationCase_ = 0; + implementation_ = null; + } + orgPolicyConstraintCustomBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.Builder + getOrgPolicyConstraintCustomBuilder() { + return getOrgPolicyConstraintCustomFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintCustomOrBuilder + getOrgPolicyConstraintCustomOrBuilder() { + if ((implementationCase_ == 6) && (orgPolicyConstraintCustomBuilder_ != null)) { + return orgPolicyConstraintCustomBuilder_.getMessageOrBuilder(); + } else { + if (implementationCase_ == 6) { + return (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) implementation_; + } + return com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.getDefaultInstance(); + } + } + /** + * + * + *
+     * Optional. Org Policy custom constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom, + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.Builder, + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustomOrBuilder> + getOrgPolicyConstraintCustomFieldBuilder() { + if (orgPolicyConstraintCustomBuilder_ == null) { + if (!(implementationCase_ == 6)) { + implementation_ = + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.getDefaultInstance(); + } + orgPolicyConstraintCustomBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom, + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.Builder, + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustomOrBuilder>( + (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) implementation_, + getParentForChildren(), + isClean()); + implementation_ = null; + } + implementationCase_ = 6; + onChanged(); + return orgPolicyConstraintCustomBuilder_; + } + + @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.securityposture.v1.Constraint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.Constraint) + private static final com.google.cloud.securityposture.v1.Constraint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.Constraint(); + } + + public static com.google.cloud.securityposture.v1.Constraint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Constraint 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.securityposture.v1.Constraint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ConstraintOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ConstraintOrBuilder.java new file mode 100644 index 000000000000..08b6a6cc9862 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ConstraintOrBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ConstraintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.Constraint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. SHA built-in detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the securityHealthAnalyticsModule field is set. + */ + boolean hasSecurityHealthAnalyticsModule(); + /** + * + * + *
+   * Optional. SHA built-in detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The securityHealthAnalyticsModule. + */ + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + getSecurityHealthAnalyticsModule(); + /** + * + * + *
+   * Optional. SHA built-in detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsModule security_health_analytics_module = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModuleOrBuilder + getSecurityHealthAnalyticsModuleOrBuilder(); + + /** + * + * + *
+   * Optional. SHA custom detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the securityHealthAnalyticsCustomModule field is set. + */ + boolean hasSecurityHealthAnalyticsCustomModule(); + /** + * + * + *
+   * Optional. SHA custom detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The securityHealthAnalyticsCustomModule. + */ + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + getSecurityHealthAnalyticsCustomModule(); + /** + * + * + *
+   * Optional. SHA custom detector.
+   * 
+ * + * + * .google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModuleOrBuilder + getSecurityHealthAnalyticsCustomModuleOrBuilder(); + + /** + * + * + *
+   * Optional. Org Policy builtin constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the orgPolicyConstraint field is set. + */ + boolean hasOrgPolicyConstraint(); + /** + * + * + *
+   * Optional. Org Policy builtin constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The orgPolicyConstraint. + */ + com.google.cloud.securityposture.v1.OrgPolicyConstraint getOrgPolicyConstraint(); + /** + * + * + *
+   * Optional. Org Policy builtin constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraint org_policy_constraint = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.OrgPolicyConstraintOrBuilder + getOrgPolicyConstraintOrBuilder(); + + /** + * + * + *
+   * Optional. Org Policy custom constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the orgPolicyConstraintCustom field is set. + */ + boolean hasOrgPolicyConstraintCustom(); + /** + * + * + *
+   * Optional. Org Policy custom constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The orgPolicyConstraintCustom. + */ + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom getOrgPolicyConstraintCustom(); + /** + * + * + *
+   * Optional. Org Policy custom constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.OrgPolicyConstraintCustom org_policy_constraint_custom = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustomOrBuilder + getOrgPolicyConstraintCustomOrBuilder(); + + com.google.cloud.securityposture.v1.Constraint.ImplementationCase getImplementationCase(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureDeploymentRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureDeploymentRequest.java new file mode 100644 index 000000000000..c71405cf4d08 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureDeploymentRequest.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for creating a PostureDeployment.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CreatePostureDeploymentRequest} + */ +public final class CreatePostureDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.CreatePostureDeploymentRequest) + CreatePostureDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreatePostureDeploymentRequest.newBuilder() to construct. + private CreatePostureDeploymentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreatePostureDeploymentRequest() { + parent_ = ""; + postureDeploymentId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreatePostureDeploymentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest.class, + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * Format: organizations/{org_id}/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. Value for parent.
+   * Format: organizations/{org_id}/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 POSTURE_DEPLOYMENT_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object postureDeploymentId_ = ""; + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureDeploymentId. + */ + @java.lang.Override + public java.lang.String getPostureDeploymentId() { + java.lang.Object ref = postureDeploymentId_; + 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(); + postureDeploymentId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureDeploymentId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPostureDeploymentIdBytes() { + java.lang.Object ref = postureDeploymentId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureDeploymentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POSTURE_DEPLOYMENT_FIELD_NUMBER = 3; + private com.google.cloud.securityposture.v1.PostureDeployment postureDeployment_; + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the postureDeployment field is set. + */ + @java.lang.Override + public boolean hasPostureDeployment() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The postureDeployment. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployment() { + return postureDeployment_ == null + ? com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance() + : postureDeployment_; + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder + getPostureDeploymentOrBuilder() { + return postureDeployment_ == null + ? com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance() + : postureDeployment_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureDeploymentId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, postureDeploymentId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getPostureDeployment()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureDeploymentId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, postureDeploymentId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPostureDeployment()); + } + 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.securityposture.v1.CreatePostureDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest other = + (com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPostureDeploymentId().equals(other.getPostureDeploymentId())) return false; + if (hasPostureDeployment() != other.hasPostureDeployment()) return false; + if (hasPostureDeployment()) { + if (!getPostureDeployment().equals(other.getPostureDeployment())) 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) + POSTURE_DEPLOYMENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getPostureDeploymentId().hashCode(); + if (hasPostureDeployment()) { + hash = (37 * hash) + POSTURE_DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getPostureDeployment().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest 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.securityposture.v1.CreatePostureDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest 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.securityposture.v1.CreatePostureDeploymentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest 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.securityposture.v1.CreatePostureDeploymentRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest + 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.securityposture.v1.CreatePostureDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest 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.securityposture.v1.CreatePostureDeploymentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a PostureDeployment.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CreatePostureDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.CreatePostureDeploymentRequest) + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest.class, + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPostureDeploymentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + postureDeploymentId_ = ""; + postureDeployment_ = null; + if (postureDeploymentBuilder_ != null) { + postureDeploymentBuilder_.dispose(); + postureDeploymentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest build() { + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest buildPartial() { + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest result = + new com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.postureDeploymentId_ = postureDeploymentId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.postureDeployment_ = + postureDeploymentBuilder_ == null + ? postureDeployment_ + : postureDeploymentBuilder_.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.securityposture.v1.CreatePostureDeploymentRequest) { + return mergeFrom( + (com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest other) { + if (other + == com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPostureDeploymentId().isEmpty()) { + postureDeploymentId_ = other.postureDeploymentId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPostureDeployment()) { + mergePostureDeployment(other.getPostureDeployment()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + postureDeploymentId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getPostureDeploymentFieldBuilder().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 parent_ = ""; + /** + * + * + *
+     * Required. Value for parent.
+     * Format: organizations/{org_id}/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. Value for parent.
+     * Format: organizations/{org_id}/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. Value for parent.
+     * Format: organizations/{org_id}/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. Value for parent.
+     * Format: organizations/{org_id}/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. Value for parent.
+     * Format: organizations/{org_id}/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 java.lang.Object postureDeploymentId_ = ""; + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureDeploymentId. + */ + public java.lang.String getPostureDeploymentId() { + java.lang.Object ref = postureDeploymentId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + postureDeploymentId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureDeploymentId. + */ + public com.google.protobuf.ByteString getPostureDeploymentIdBytes() { + java.lang.Object ref = postureDeploymentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureDeploymentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The postureDeploymentId to set. + * @return This builder for chaining. + */ + public Builder setPostureDeploymentId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + postureDeploymentId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPostureDeploymentId() { + postureDeploymentId_ = getDefaultInstance().getPostureDeploymentId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for postureDeploymentId to set. + * @return This builder for chaining. + */ + public Builder setPostureDeploymentIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + postureDeploymentId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.securityposture.v1.PostureDeployment postureDeployment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder> + postureDeploymentBuilder_; + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the postureDeployment field is set. + */ + public boolean hasPostureDeployment() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The postureDeployment. + */ + public com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployment() { + if (postureDeploymentBuilder_ == null) { + return postureDeployment_ == null + ? com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance() + : postureDeployment_; + } else { + return postureDeploymentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPostureDeployment( + com.google.cloud.securityposture.v1.PostureDeployment value) { + if (postureDeploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + postureDeployment_ = value; + } else { + postureDeploymentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPostureDeployment( + com.google.cloud.securityposture.v1.PostureDeployment.Builder builderForValue) { + if (postureDeploymentBuilder_ == null) { + postureDeployment_ = builderForValue.build(); + } else { + postureDeploymentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePostureDeployment( + com.google.cloud.securityposture.v1.PostureDeployment value) { + if (postureDeploymentBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && postureDeployment_ != null + && postureDeployment_ + != com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance()) { + getPostureDeploymentBuilder().mergeFrom(value); + } else { + postureDeployment_ = value; + } + } else { + postureDeploymentBuilder_.mergeFrom(value); + } + if (postureDeployment_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPostureDeployment() { + bitField0_ = (bitField0_ & ~0x00000004); + postureDeployment_ = null; + if (postureDeploymentBuilder_ != null) { + postureDeploymentBuilder_.dispose(); + postureDeploymentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PostureDeployment.Builder + getPostureDeploymentBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getPostureDeploymentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder + getPostureDeploymentOrBuilder() { + if (postureDeploymentBuilder_ != null) { + return postureDeploymentBuilder_.getMessageOrBuilder(); + } else { + return postureDeployment_ == null + ? com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance() + : postureDeployment_; + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder> + getPostureDeploymentFieldBuilder() { + if (postureDeploymentBuilder_ == null) { + postureDeploymentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder>( + getPostureDeployment(), getParentForChildren(), isClean()); + postureDeployment_ = null; + } + return postureDeploymentBuilder_; + } + + @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.securityposture.v1.CreatePostureDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.CreatePostureDeploymentRequest) + private static final com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest(); + } + + public static com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePostureDeploymentRequest 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.securityposture.v1.CreatePostureDeploymentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureDeploymentRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..3562f1ba53a1 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureDeploymentRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface CreatePostureDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.CreatePostureDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * Format: organizations/{org_id}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * Format: organizations/{org_id}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureDeploymentId. + */ + java.lang.String getPostureDeploymentId(); + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_deployment_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureDeploymentId. + */ + com.google.protobuf.ByteString getPostureDeploymentIdBytes(); + + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the postureDeployment field is set. + */ + boolean hasPostureDeployment(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The postureDeployment. + */ + com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployment(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder getPostureDeploymentOrBuilder(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureRequest.java new file mode 100644 index 000000000000..b720fb7bf49c --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureRequest.java @@ -0,0 +1,1132 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for creating a Posture.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CreatePostureRequest} + */ +public final class CreatePostureRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.CreatePostureRequest) + CreatePostureRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreatePostureRequest.newBuilder() to construct. + private CreatePostureRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreatePostureRequest() { + parent_ = ""; + postureId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreatePostureRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CreatePostureRequest.class, + com.google.cloud.securityposture.v1.CreatePostureRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * 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 POSTURE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object postureId_ = ""; + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + @java.lang.Override + public java.lang.String getPostureId() { + java.lang.Object ref = postureId_; + 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(); + postureId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPostureIdBytes() { + java.lang.Object ref = postureId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POSTURE_FIELD_NUMBER = 3; + private com.google.cloud.securityposture.v1.Posture posture_; + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the posture field is set. + */ + @java.lang.Override + public boolean hasPosture() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The posture. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture getPosture() { + return posture_ == null + ? com.google.cloud.securityposture.v1.Posture.getDefaultInstance() + : posture_; + } + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureOrBuilder getPostureOrBuilder() { + return posture_ == null + ? com.google.cloud.securityposture.v1.Posture.getDefaultInstance() + : posture_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, postureId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getPosture()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, postureId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPosture()); + } + 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.securityposture.v1.CreatePostureRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.CreatePostureRequest other = + (com.google.cloud.securityposture.v1.CreatePostureRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPostureId().equals(other.getPostureId())) return false; + if (hasPosture() != other.hasPosture()) return false; + if (hasPosture()) { + if (!getPosture().equals(other.getPosture())) 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) + POSTURE_ID_FIELD_NUMBER; + hash = (53 * hash) + getPostureId().hashCode(); + if (hasPosture()) { + hash = (37 * hash) + POSTURE_FIELD_NUMBER; + hash = (53 * hash) + getPosture().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest 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.securityposture.v1.CreatePostureRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest 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.securityposture.v1.CreatePostureRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest 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.securityposture.v1.CreatePostureRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest 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.securityposture.v1.CreatePostureRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest 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.securityposture.v1.CreatePostureRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for creating a Posture.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CreatePostureRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.CreatePostureRequest) + com.google.cloud.securityposture.v1.CreatePostureRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CreatePostureRequest.class, + com.google.cloud.securityposture.v1.CreatePostureRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.CreatePostureRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPostureFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + postureId_ = ""; + posture_ = null; + if (postureBuilder_ != null) { + postureBuilder_.dispose(); + postureBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_CreatePostureRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CreatePostureRequest getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.CreatePostureRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CreatePostureRequest build() { + com.google.cloud.securityposture.v1.CreatePostureRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CreatePostureRequest buildPartial() { + com.google.cloud.securityposture.v1.CreatePostureRequest result = + new com.google.cloud.securityposture.v1.CreatePostureRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.CreatePostureRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.postureId_ = postureId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.posture_ = postureBuilder_ == null ? posture_ : postureBuilder_.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.securityposture.v1.CreatePostureRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.CreatePostureRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.CreatePostureRequest other) { + if (other == com.google.cloud.securityposture.v1.CreatePostureRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPostureId().isEmpty()) { + postureId_ = other.postureId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasPosture()) { + mergePosture(other.getPosture()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + postureId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getPostureFieldBuilder().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 parent_ = ""; + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Value for parent.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object postureId_ = ""; + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + public java.lang.String getPostureId() { + java.lang.Object ref = postureId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + postureId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + public com.google.protobuf.ByteString getPostureIdBytes() { + java.lang.Object ref = postureId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The postureId to set. + * @return This builder for chaining. + */ + public Builder setPostureId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + postureId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPostureId() { + postureId_ = getDefaultInstance().getPostureId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for postureId to set. + * @return This builder for chaining. + */ + public Builder setPostureIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + postureId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.securityposture.v1.Posture posture_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder> + postureBuilder_; + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the posture field is set. + */ + public boolean hasPosture() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The posture. + */ + public com.google.cloud.securityposture.v1.Posture getPosture() { + if (postureBuilder_ == null) { + return posture_ == null + ? com.google.cloud.securityposture.v1.Posture.getDefaultInstance() + : posture_; + } else { + return postureBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPosture(com.google.cloud.securityposture.v1.Posture value) { + if (postureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + posture_ = value; + } else { + postureBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPosture(com.google.cloud.securityposture.v1.Posture.Builder builderForValue) { + if (postureBuilder_ == null) { + posture_ = builderForValue.build(); + } else { + postureBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePosture(com.google.cloud.securityposture.v1.Posture value) { + if (postureBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && posture_ != null + && posture_ != com.google.cloud.securityposture.v1.Posture.getDefaultInstance()) { + getPostureBuilder().mergeFrom(value); + } else { + posture_ = value; + } + } else { + postureBuilder_.mergeFrom(value); + } + if (posture_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPosture() { + bitField0_ = (bitField0_ & ~0x00000004); + posture_ = null; + if (postureBuilder_ != null) { + postureBuilder_.dispose(); + postureBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.Posture.Builder getPostureBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getPostureFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PostureOrBuilder getPostureOrBuilder() { + if (postureBuilder_ != null) { + return postureBuilder_.getMessageOrBuilder(); + } else { + return posture_ == null + ? com.google.cloud.securityposture.v1.Posture.getDefaultInstance() + : posture_; + } + } + /** + * + * + *
+     * Required. The resource being created.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder> + getPostureFieldBuilder() { + if (postureBuilder_ == null) { + postureBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder>( + getPosture(), getParentForChildren(), isClean()); + posture_ = null; + } + return postureBuilder_; + } + + @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.securityposture.v1.CreatePostureRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.CreatePostureRequest) + private static final com.google.cloud.securityposture.v1.CreatePostureRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.CreatePostureRequest(); + } + + public static com.google.cloud.securityposture.v1.CreatePostureRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePostureRequest 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.securityposture.v1.CreatePostureRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureRequestOrBuilder.java new file mode 100644 index 000000000000..c8a85108bb8a --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CreatePostureRequestOrBuilder.java @@ -0,0 +1,123 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface CreatePostureRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.CreatePostureRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Value for parent.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + java.lang.String getPostureId(); + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + com.google.protobuf.ByteString getPostureIdBytes(); + + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the posture field is set. + */ + boolean hasPosture(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The posture. + */ + com.google.cloud.securityposture.v1.Posture getPosture(); + /** + * + * + *
+   * Required. The resource being created.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PostureOrBuilder getPostureOrBuilder(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConfig.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConfig.java new file mode 100644 index 000000000000..3856c3a167ea --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConfig.java @@ -0,0 +1,5024 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/sha_custom_config.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Defines the properties in a custom module configuration for Security
+ * Health Analytics. Use the custom module configuration to create custom
+ * detectors that generate custom findings for resources that you specify.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConfig} + */ +public final class CustomConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.CustomConfig) + CustomConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomConfig.newBuilder() to construct. + private CustomConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomConfig() { + severity_ = 0; + description_ = ""; + recommendation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConfig.class, + com.google.cloud.securityposture.v1.CustomConfig.Builder.class); + } + + /** + * + * + *
+   * Defines the valid value options for the severity of a finding.
+   * 
+ * + * Protobuf enum {@code google.cloud.securityposture.v1.CustomConfig.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified severity.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
+     * Critical severity.
+     * 
+ * + * CRITICAL = 1; + */ + CRITICAL(1), + /** + * + * + *
+     * High severity.
+     * 
+ * + * HIGH = 2; + */ + HIGH(2), + /** + * + * + *
+     * Medium severity.
+     * 
+ * + * MEDIUM = 3; + */ + MEDIUM(3), + /** + * + * + *
+     * Low severity.
+     * 
+ * + * LOW = 4; + */ + LOW(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified severity.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Critical severity.
+     * 
+ * + * CRITICAL = 1; + */ + public static final int CRITICAL_VALUE = 1; + /** + * + * + *
+     * High severity.
+     * 
+ * + * HIGH = 2; + */ + public static final int HIGH_VALUE = 2; + /** + * + * + *
+     * Medium severity.
+     * 
+ * + * MEDIUM = 3; + */ + public static final int MEDIUM_VALUE = 3; + /** + * + * + *
+     * Low severity.
+     * 
+ * + * LOW = 4; + */ + public static final int LOW_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 Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return CRITICAL; + case 2: + return HIGH; + case 3: + return MEDIUM; + case 4: + return LOW; + 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 Severity findValueByNumber(int number) { + return Severity.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.securityposture.v1.CustomConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securityposture.v1.CustomConfig.Severity) + } + + public interface CustomOutputSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getPropertiesList(); + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property getProperties( + int index); + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getPropertiesCount(); + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List< + ? extends + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.PropertyOrBuilder> + getPropertiesOrBuilderList(); + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.PropertyOrBuilder + getPropertiesOrBuilder(int index); + } + /** + * + * + *
+   * A set of optional name-value pairs that define custom source properties to
+   * return with each finding that is generated by the custom module. The custom
+   * source properties that are defined here are included in the finding JSON
+   * under `sourceProperties`.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec} + */ + public static final class CustomOutputSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec) + CustomOutputSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomOutputSpec.newBuilder() to construct. + private CustomOutputSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomOutputSpec() { + properties_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomOutputSpec(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.class, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Builder.class); + } + + public interface PropertyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. Name of the property for the custom output.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+       * Required. Name of the property for the custom output.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+       * Optional. The CEL expression for the custom output. A resource property
+       * can be specified to return the value of the property or a text string
+       * enclosed in quotation marks.
+       * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the valueExpression field is set. + */ + boolean hasValueExpression(); + /** + * + * + *
+       * Optional. The CEL expression for the custom output. A resource property
+       * can be specified to return the value of the property or a text string
+       * enclosed in quotation marks.
+       * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The valueExpression. + */ + com.google.type.Expr getValueExpression(); + /** + * + * + *
+       * Optional. The CEL expression for the custom output. A resource property
+       * can be specified to return the value of the property or a text string
+       * enclosed in quotation marks.
+       * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.type.ExprOrBuilder getValueExpressionOrBuilder(); + } + /** + * + * + *
+     * An individual name-value pair that defines a custom source property.
+     * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property} + */ + public static final class Property extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property) + PropertyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Property.newBuilder() to construct. + private Property(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Property() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Property(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.class, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder + .class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+       * Required. Name of the property for the custom output.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 property for the custom output.
+       * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_EXPRESSION_FIELD_NUMBER = 2; + private com.google.type.Expr valueExpression_; + /** + * + * + *
+       * Optional. The CEL expression for the custom output. A resource property
+       * can be specified to return the value of the property or a text string
+       * enclosed in quotation marks.
+       * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the valueExpression field is set. + */ + @java.lang.Override + public boolean hasValueExpression() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Optional. The CEL expression for the custom output. A resource property
+       * can be specified to return the value of the property or a text string
+       * enclosed in quotation marks.
+       * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The valueExpression. + */ + @java.lang.Override + public com.google.type.Expr getValueExpression() { + return valueExpression_ == null + ? com.google.type.Expr.getDefaultInstance() + : valueExpression_; + } + /** + * + * + *
+       * Optional. The CEL expression for the custom output. A resource property
+       * can be specified to return the value of the property or a text string
+       * enclosed in quotation marks.
+       * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.type.ExprOrBuilder getValueExpressionOrBuilder() { + return valueExpression_ == null + ? com.google.type.Expr.getDefaultInstance() + : valueExpression_; + } + + 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, getValueExpression()); + } + 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, getValueExpression()); + } + 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.securityposture.v1.CustomConfig.CustomOutputSpec.Property)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property other = + (com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property) obj; + + if (!getName().equals(other.getName())) return false; + if (hasValueExpression() != other.hasValueExpression()) return false; + if (hasValueExpression()) { + if (!getValueExpression().equals(other.getValueExpression())) 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 (hasValueExpression()) { + hash = (37 * hash) + VALUE_EXPRESSION_FIELD_NUMBER; + hash = (53 * hash) + getValueExpression().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + 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.securityposture.v1.CustomConfig.CustomOutputSpec.Property + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + 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.securityposture.v1.CustomConfig.CustomOutputSpec.Property + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + 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.securityposture.v1.CustomConfig.CustomOutputSpec.Property + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + 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.securityposture.v1.CustomConfig.CustomOutputSpec.Property + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + 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.securityposture.v1.CustomConfig.CustomOutputSpec.Property 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; + } + /** + * + * + *
+       * An individual name-value pair that defines a custom source property.
+       * 
+ * + * Protobuf type {@code + * google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property) + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.PropertyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.class, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder + .class); + } + + // Construct using + // com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getValueExpressionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + valueExpression_ = null; + if (valueExpressionBuilder_ != null) { + valueExpressionBuilder_.dispose(); + valueExpressionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property build() { + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + buildPartial() { + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property result = + new com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.valueExpression_ = + valueExpressionBuilder_ == null + ? valueExpression_ + : valueExpressionBuilder_.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.securityposture.v1.CustomConfig.CustomOutputSpec.Property) { + return mergeFrom( + (com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property other) { + if (other + == com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasValueExpression()) { + mergeValueExpression(other.getValueExpression()); + } + 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( + getValueExpressionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+         * Required. Name of the property for the custom output.
+         * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 property for the custom output.
+         * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 property for the custom output.
+         * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 property for the custom output.
+         * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Name of the property for the custom output.
+         * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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.type.Expr valueExpression_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + valueExpressionBuilder_; + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the valueExpression field is set. + */ + public boolean hasValueExpression() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The valueExpression. + */ + public com.google.type.Expr getValueExpression() { + if (valueExpressionBuilder_ == null) { + return valueExpression_ == null + ? com.google.type.Expr.getDefaultInstance() + : valueExpression_; + } else { + return valueExpressionBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setValueExpression(com.google.type.Expr value) { + if (valueExpressionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueExpression_ = value; + } else { + valueExpressionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setValueExpression(com.google.type.Expr.Builder builderForValue) { + if (valueExpressionBuilder_ == null) { + valueExpression_ = builderForValue.build(); + } else { + valueExpressionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeValueExpression(com.google.type.Expr value) { + if (valueExpressionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && valueExpression_ != null + && valueExpression_ != com.google.type.Expr.getDefaultInstance()) { + getValueExpressionBuilder().mergeFrom(value); + } else { + valueExpression_ = value; + } + } else { + valueExpressionBuilder_.mergeFrom(value); + } + if (valueExpression_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearValueExpression() { + bitField0_ = (bitField0_ & ~0x00000002); + valueExpression_ = null; + if (valueExpressionBuilder_ != null) { + valueExpressionBuilder_.dispose(); + valueExpressionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.type.Expr.Builder getValueExpressionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getValueExpressionFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.type.ExprOrBuilder getValueExpressionOrBuilder() { + if (valueExpressionBuilder_ != null) { + return valueExpressionBuilder_.getMessageOrBuilder(); + } else { + return valueExpression_ == null + ? com.google.type.Expr.getDefaultInstance() + : valueExpression_; + } + } + /** + * + * + *
+         * Optional. The CEL expression for the custom output. A resource property
+         * can be specified to return the value of the property or a text string
+         * enclosed in quotation marks.
+         * 
+ * + * .google.type.Expr value_expression = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + getValueExpressionFieldBuilder() { + if (valueExpressionBuilder_ == null) { + valueExpressionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, + com.google.type.Expr.Builder, + com.google.type.ExprOrBuilder>( + getValueExpression(), getParentForChildren(), isClean()); + valueExpression_ = null; + } + return valueExpressionBuilder_; + } + + @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.securityposture.v1.CustomConfig.CustomOutputSpec.Property) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property) + private static final com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + .Property + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property(); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Property 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.securityposture.v1.CustomConfig.CustomOutputSpec.Property + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int PROPERTIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property> + properties_; + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property> + getPropertiesList() { + return properties_; + } + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.PropertyOrBuilder> + getPropertiesOrBuilderList() { + return properties_; + } + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getPropertiesCount() { + return properties_.size(); + } + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property getProperties( + int index) { + return properties_.get(index); + } + /** + * + * + *
+     * Optional. A list of custom output properties to add to the finding.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.PropertyOrBuilder + getPropertiesOrBuilder(int index) { + return properties_.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 < properties_.size(); i++) { + output.writeMessage(1, properties_.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 < properties_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, properties_.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.securityposture.v1.CustomConfig.CustomOutputSpec)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec other = + (com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec) obj; + + if (!getPropertiesList().equals(other.getPropertiesList())) 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 (getPropertiesCount() > 0) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getPropertiesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec 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.securityposture.v1.CustomConfig.CustomOutputSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec 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.securityposture.v1.CustomConfig.CustomOutputSpec parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec 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.securityposture.v1.CustomConfig.CustomOutputSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + 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.securityposture.v1.CustomConfig.CustomOutputSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec 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.securityposture.v1.CustomConfig.CustomOutputSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A set of optional name-value pairs that define custom source properties to
+     * return with each finding that is generated by the custom module. The custom
+     * source properties that are defined here are included in the finding JSON
+     * under `sourceProperties`.
+     * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec) + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.class, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Builder.class); + } + + // Construct using + // com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + } else { + properties_ = null; + propertiesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec build() { + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec buildPartial() { + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec result = + new com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec result) { + if (propertiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + properties_ = java.util.Collections.unmodifiableList(properties_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.properties_ = properties_; + } else { + result.properties_ = propertiesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec 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.securityposture.v1.CustomConfig.CustomOutputSpec) { + return mergeFrom( + (com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec other) { + if (other + == com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + .getDefaultInstance()) return this; + if (propertiesBuilder_ == null) { + if (!other.properties_.isEmpty()) { + if (properties_.isEmpty()) { + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePropertiesIsMutable(); + properties_.addAll(other.properties_); + } + onChanged(); + } + } else { + if (!other.properties_.isEmpty()) { + if (propertiesBuilder_.isEmpty()) { + propertiesBuilder_.dispose(); + propertiesBuilder_ = null; + properties_ = other.properties_; + bitField0_ = (bitField0_ & ~0x00000001); + propertiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPropertiesFieldBuilder() + : null; + } else { + propertiesBuilder_.addAllMessages(other.properties_); + } + } + } + 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.securityposture.v1.CustomConfig.CustomOutputSpec.Property m = + input.readMessage( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + .parser(), + extensionRegistry); + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(m); + } else { + propertiesBuilder_.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< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property> + properties_ = java.util.Collections.emptyList(); + + private void ensurePropertiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + properties_ = + new java.util.ArrayList< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property>( + properties_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.PropertyOrBuilder> + propertiesBuilder_; + + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property> + getPropertiesList() { + if (propertiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(properties_); + } else { + return propertiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getPropertiesCount() { + if (propertiesBuilder_ == null) { + return properties_.size(); + } else { + return propertiesBuilder_.getCount(); + } + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + getProperties(int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setProperties( + int index, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.set(index, value); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setProperties( + int index, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.set(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addProperties( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(value); + onChanged(); + } else { + propertiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addProperties( + int index, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property value) { + if (propertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePropertiesIsMutable(); + properties_.add(index, value); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addProperties( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addProperties( + int index, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder + builderForValue) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.add(index, builderForValue.build()); + onChanged(); + } else { + propertiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllProperties( + java.lang.Iterable< + ? extends + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property> + values) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, properties_); + onChanged(); + } else { + propertiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearProperties() { + if (propertiesBuilder_ == null) { + properties_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + propertiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeProperties(int index) { + if (propertiesBuilder_ == null) { + ensurePropertiesIsMutable(); + properties_.remove(index); + onChanged(); + } else { + propertiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder + getPropertiesBuilder(int index) { + return getPropertiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.PropertyOrBuilder + getPropertiesOrBuilder(int index) { + if (propertiesBuilder_ == null) { + return properties_.get(index); + } else { + return propertiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + .PropertyOrBuilder> + getPropertiesOrBuilderList() { + if (propertiesBuilder_ != null) { + return propertiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(properties_); + } + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder + addPropertiesBuilder() { + return getPropertiesFieldBuilder() + .addBuilder( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + .getDefaultInstance()); + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder + addPropertiesBuilder(int index) { + return getPropertiesFieldBuilder() + .addBuilder( + index, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + .getDefaultInstance()); + } + /** + * + * + *
+       * Optional. A list of custom output properties to add to the finding.
+       * 
+ * + * + * repeated .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property properties = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder> + getPropertiesBuilderList() { + return getPropertiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property.Builder, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.PropertyOrBuilder> + getPropertiesFieldBuilder() { + if (propertiesBuilder_ == null) { + propertiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Property + .Builder, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + .PropertyOrBuilder>( + properties_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + properties_ = null; + } + return propertiesBuilder_; + } + + @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.securityposture.v1.CustomConfig.CustomOutputSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec) + private static final com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec(); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomOutputSpec 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.securityposture.v1.CustomConfig.CustomOutputSpec + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ResourceSelectorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.CustomConfig.ResourceSelector) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The resource types to run the detector on.
+     * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resourceTypes. + */ + java.util.List getResourceTypesList(); + /** + * + * + *
+     * Required. The resource types to run the detector on.
+     * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resourceTypes. + */ + int getResourceTypesCount(); + /** + * + * + *
+     * Required. The resource types to run the detector on.
+     * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resourceTypes at the given index. + */ + java.lang.String getResourceTypes(int index); + /** + * + * + *
+     * Required. The resource types to run the detector on.
+     * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceTypes at the given index. + */ + com.google.protobuf.ByteString getResourceTypesBytes(int index); + } + /** + * + * + *
+   * Resource for selecting resource type.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConfig.ResourceSelector} + */ + public static final class ResourceSelector extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.CustomConfig.ResourceSelector) + ResourceSelectorOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResourceSelector.newBuilder() to construct. + private ResourceSelector(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResourceSelector() { + resourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResourceSelector(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.class, + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.Builder.class); + } + + public static final int RESOURCE_TYPES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList resourceTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * Required. The resource types to run the detector on.
+     * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resourceTypes. + */ + public com.google.protobuf.ProtocolStringList getResourceTypesList() { + return resourceTypes_; + } + /** + * + * + *
+     * Required. The resource types to run the detector on.
+     * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resourceTypes. + */ + public int getResourceTypesCount() { + return resourceTypes_.size(); + } + /** + * + * + *
+     * Required. The resource types to run the detector on.
+     * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resourceTypes at the given index. + */ + public java.lang.String getResourceTypes(int index) { + return resourceTypes_.get(index); + } + /** + * + * + *
+     * Required. The resource types to run the detector on.
+     * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceTypes at the given index. + */ + public com.google.protobuf.ByteString getResourceTypesBytes(int index) { + return resourceTypes_.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 < resourceTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceTypes_.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 < resourceTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceTypesList().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.securityposture.v1.CustomConfig.ResourceSelector)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector other = + (com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector) obj; + + if (!getResourceTypesList().equals(other.getResourceTypesList())) 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 (getResourceTypesCount() > 0) { + hash = (37 * hash) + RESOURCE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getResourceTypesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector 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.securityposture.v1.CustomConfig.ResourceSelector parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector 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.securityposture.v1.CustomConfig.ResourceSelector parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector 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.securityposture.v1.CustomConfig.ResourceSelector + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector + 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.securityposture.v1.CustomConfig.ResourceSelector parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector 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.securityposture.v1.CustomConfig.ResourceSelector 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; + } + /** + * + * + *
+     * Resource for selecting resource type.
+     * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConfig.ResourceSelector} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.CustomConfig.ResourceSelector) + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelectorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.class, + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.Builder.class); + } + + // Construct using + // com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector build() { + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector buildPartial() { + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector result = + new com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + resourceTypes_.makeImmutable(); + result.resourceTypes_ = resourceTypes_; + } + } + + @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.securityposture.v1.CustomConfig.ResourceSelector) { + return mergeFrom( + (com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector other) { + if (other + == com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector + .getDefaultInstance()) return this; + if (!other.resourceTypes_.isEmpty()) { + if (resourceTypes_.isEmpty()) { + resourceTypes_ = other.resourceTypes_; + bitField0_ |= 0x00000001; + } else { + ensureResourceTypesIsMutable(); + resourceTypes_.addAll(other.resourceTypes_); + } + 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(); + ensureResourceTypesIsMutable(); + resourceTypes_.add(s); + 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 com.google.protobuf.LazyStringArrayList resourceTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureResourceTypesIsMutable() { + if (!resourceTypes_.isModifiable()) { + resourceTypes_ = new com.google.protobuf.LazyStringArrayList(resourceTypes_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resourceTypes. + */ + public com.google.protobuf.ProtocolStringList getResourceTypesList() { + resourceTypes_.makeImmutable(); + return resourceTypes_; + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resourceTypes. + */ + public int getResourceTypesCount() { + return resourceTypes_.size(); + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resourceTypes at the given index. + */ + public java.lang.String getResourceTypes(int index) { + return resourceTypes_.get(index); + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceTypes at the given index. + */ + public com.google.protobuf.ByteString getResourceTypesBytes(int index) { + return resourceTypes_.getByteString(index); + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The resourceTypes to set. + * @return This builder for chaining. + */ + public Builder setResourceTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceTypesIsMutable(); + resourceTypes_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resourceTypes to add. + * @return This builder for chaining. + */ + public Builder addResourceTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceTypesIsMutable(); + resourceTypes_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The resourceTypes to add. + * @return This builder for chaining. + */ + public Builder addAllResourceTypes(java.lang.Iterable values) { + ensureResourceTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceTypes_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResourceTypes() { + resourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The resource types to run the detector on.
+       * 
+ * + * repeated string resource_types = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the resourceTypes to add. + * @return This builder for chaining. + */ + public Builder addResourceTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceTypesIsMutable(); + resourceTypes_.add(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.securityposture.v1.CustomConfig.ResourceSelector) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.CustomConfig.ResourceSelector) + private static final com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector(); + } + + public static com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceSelector 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.securityposture.v1.CustomConfig.ResourceSelector + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int PREDICATE_FIELD_NUMBER = 1; + private com.google.type.Expr predicate_; + /** + * + * + *
+   * Required. The CEL expression to evaluate to produce findings. When the
+   * expression evaluates to true against a resource, a finding is generated.
+   * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the predicate field is set. + */ + @java.lang.Override + public boolean hasPredicate() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The CEL expression to evaluate to produce findings. When the
+   * expression evaluates to true against a resource, a finding is generated.
+   * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The predicate. + */ + @java.lang.Override + public com.google.type.Expr getPredicate() { + return predicate_ == null ? com.google.type.Expr.getDefaultInstance() : predicate_; + } + /** + * + * + *
+   * Required. The CEL expression to evaluate to produce findings. When the
+   * expression evaluates to true against a resource, a finding is generated.
+   * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.type.ExprOrBuilder getPredicateOrBuilder() { + return predicate_ == null ? com.google.type.Expr.getDefaultInstance() : predicate_; + } + + public static final int CUSTOM_OUTPUT_FIELD_NUMBER = 2; + private com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec customOutput_; + /** + * + * + *
+   * Optional. Custom output properties.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customOutput field is set. + */ + @java.lang.Override + public boolean hasCustomOutput() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Optional. Custom output properties.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customOutput. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec getCustomOutput() { + return customOutput_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.getDefaultInstance() + : customOutput_; + } + /** + * + * + *
+   * Optional. Custom output properties.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpecOrBuilder + getCustomOutputOrBuilder() { + return customOutput_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.getDefaultInstance() + : customOutput_; + } + + public static final int RESOURCE_SELECTOR_FIELD_NUMBER = 3; + private com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector resourceSelector_; + /** + * + * + *
+   * Required. The resource types that the custom module operates on. Each
+   * custom module can specify up to 5 resource types.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the resourceSelector field is set. + */ + @java.lang.Override + public boolean hasResourceSelector() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Required. The resource types that the custom module operates on. Each
+   * custom module can specify up to 5 resource types.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The resourceSelector. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector getResourceSelector() { + return resourceSelector_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.getDefaultInstance() + : resourceSelector_; + } + /** + * + * + *
+   * Required. The resource types that the custom module operates on. Each
+   * custom module can specify up to 5 resource types.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.ResourceSelectorOrBuilder + getResourceSelectorOrBuilder() { + return resourceSelector_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.getDefaultInstance() + : resourceSelector_; + } + + public static final int SEVERITY_FIELD_NUMBER = 4; + private int severity_ = 0; + /** + * + * + *
+   * Required. The severity to assign to findings generated by the module.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+   * Required. The severity to assign to findings generated by the module.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.Severity getSeverity() { + com.google.cloud.securityposture.v1.CustomConfig.Severity result = + com.google.cloud.securityposture.v1.CustomConfig.Severity.forNumber(severity_); + return result == null + ? com.google.cloud.securityposture.v1.CustomConfig.Severity.UNRECOGNIZED + : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. Text that describes the vulnerability or misconfiguration that
+   * the custom module detects. This explanation is returned with each finding
+   * instance to help investigators understand the detected issue. The text must
+   * be enclosed in quotation marks.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Text that describes the vulnerability or misconfiguration that
+   * the custom module detects. This explanation is returned with each finding
+   * instance to help investigators understand the detected issue. The text must
+   * be enclosed in quotation marks.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 RECOMMENDATION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object recommendation_ = ""; + /** + * + * + *
+   * Optional. An explanation of the recommended steps that security teams can
+   * take to resolve the detected issue. This explanation is returned with each
+   * finding generated by this module in the `nextSteps` property of the finding
+   * JSON.
+   * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recommendation. + */ + @java.lang.Override + public java.lang.String getRecommendation() { + java.lang.Object ref = recommendation_; + 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(); + recommendation_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An explanation of the recommended steps that security teams can
+   * take to resolve the detected issue. This explanation is returned with each
+   * finding generated by this module in the `nextSteps` property of the finding
+   * JSON.
+   * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for recommendation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRecommendationBytes() { + java.lang.Object ref = recommendation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recommendation_ = 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, getPredicate()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getCustomOutput()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(3, getResourceSelector()); + } + if (severity_ + != com.google.cloud.securityposture.v1.CustomConfig.Severity.SEVERITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recommendation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, recommendation_); + } + 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, getPredicate()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCustomOutput()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResourceSelector()); + } + if (severity_ + != com.google.cloud.securityposture.v1.CustomConfig.Severity.SEVERITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recommendation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, recommendation_); + } + 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.securityposture.v1.CustomConfig)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.CustomConfig other = + (com.google.cloud.securityposture.v1.CustomConfig) obj; + + if (hasPredicate() != other.hasPredicate()) return false; + if (hasPredicate()) { + if (!getPredicate().equals(other.getPredicate())) return false; + } + if (hasCustomOutput() != other.hasCustomOutput()) return false; + if (hasCustomOutput()) { + if (!getCustomOutput().equals(other.getCustomOutput())) return false; + } + if (hasResourceSelector() != other.hasResourceSelector()) return false; + if (hasResourceSelector()) { + if (!getResourceSelector().equals(other.getResourceSelector())) return false; + } + if (severity_ != other.severity_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getRecommendation().equals(other.getRecommendation())) 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 (hasPredicate()) { + hash = (37 * hash) + PREDICATE_FIELD_NUMBER; + hash = (53 * hash) + getPredicate().hashCode(); + } + if (hasCustomOutput()) { + hash = (37 * hash) + CUSTOM_OUTPUT_FIELD_NUMBER; + hash = (53 * hash) + getCustomOutput().hashCode(); + } + if (hasResourceSelector()) { + hash = (37 * hash) + RESOURCE_SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getResourceSelector().hashCode(); + } + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + RECOMMENDATION_FIELD_NUMBER; + hash = (53 * hash) + getRecommendation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.CustomConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig 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.securityposture.v1.CustomConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig 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.securityposture.v1.CustomConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.CustomConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig 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.securityposture.v1.CustomConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig 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.securityposture.v1.CustomConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConfig 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.securityposture.v1.CustomConfig 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; + } + /** + * + * + *
+   * Defines the properties in a custom module configuration for Security
+   * Health Analytics. Use the custom module configuration to create custom
+   * detectors that generate custom findings for resources that you specify.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.CustomConfig) + com.google.cloud.securityposture.v1.CustomConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConfig.class, + com.google.cloud.securityposture.v1.CustomConfig.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.CustomConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPredicateFieldBuilder(); + getCustomOutputFieldBuilder(); + getResourceSelectorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + predicate_ = null; + if (predicateBuilder_ != null) { + predicateBuilder_.dispose(); + predicateBuilder_ = null; + } + customOutput_ = null; + if (customOutputBuilder_ != null) { + customOutputBuilder_.dispose(); + customOutputBuilder_ = null; + } + resourceSelector_ = null; + if (resourceSelectorBuilder_ != null) { + resourceSelectorBuilder_.dispose(); + resourceSelectorBuilder_ = null; + } + severity_ = 0; + description_ = ""; + recommendation_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.ShaCustomConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.CustomConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig build() { + com.google.cloud.securityposture.v1.CustomConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig buildPartial() { + com.google.cloud.securityposture.v1.CustomConfig result = + new com.google.cloud.securityposture.v1.CustomConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.CustomConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.predicate_ = predicateBuilder_ == null ? predicate_ : predicateBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.customOutput_ = + customOutputBuilder_ == null ? customOutput_ : customOutputBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.resourceSelector_ = + resourceSelectorBuilder_ == null ? resourceSelector_ : resourceSelectorBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.recommendation_ = recommendation_; + } + 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.securityposture.v1.CustomConfig) { + return mergeFrom((com.google.cloud.securityposture.v1.CustomConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.CustomConfig other) { + if (other == com.google.cloud.securityposture.v1.CustomConfig.getDefaultInstance()) + return this; + if (other.hasPredicate()) { + mergePredicate(other.getPredicate()); + } + if (other.hasCustomOutput()) { + mergeCustomOutput(other.getCustomOutput()); + } + if (other.hasResourceSelector()) { + mergeResourceSelector(other.getResourceSelector()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getRecommendation().isEmpty()) { + recommendation_ = other.recommendation_; + bitField0_ |= 0x00000020; + 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(getPredicateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getCustomOutputFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage( + getResourceSelectorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + recommendation_ = input.readStringRequireUtf8(); + 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 com.google.type.Expr predicate_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + predicateBuilder_; + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the predicate field is set. + */ + public boolean hasPredicate() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The predicate. + */ + public com.google.type.Expr getPredicate() { + if (predicateBuilder_ == null) { + return predicate_ == null ? com.google.type.Expr.getDefaultInstance() : predicate_; + } else { + return predicateBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPredicate(com.google.type.Expr value) { + if (predicateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + predicate_ = value; + } else { + predicateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPredicate(com.google.type.Expr.Builder builderForValue) { + if (predicateBuilder_ == null) { + predicate_ = builderForValue.build(); + } else { + predicateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergePredicate(com.google.type.Expr value) { + if (predicateBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && predicate_ != null + && predicate_ != com.google.type.Expr.getDefaultInstance()) { + getPredicateBuilder().mergeFrom(value); + } else { + predicate_ = value; + } + } else { + predicateBuilder_.mergeFrom(value); + } + if (predicate_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearPredicate() { + bitField0_ = (bitField0_ & ~0x00000001); + predicate_ = null; + if (predicateBuilder_ != null) { + predicateBuilder_.dispose(); + predicateBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.type.Expr.Builder getPredicateBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPredicateFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.type.ExprOrBuilder getPredicateOrBuilder() { + if (predicateBuilder_ != null) { + return predicateBuilder_.getMessageOrBuilder(); + } else { + return predicate_ == null ? com.google.type.Expr.getDefaultInstance() : predicate_; + } + } + /** + * + * + *
+     * Required. The CEL expression to evaluate to produce findings. When the
+     * expression evaluates to true against a resource, a finding is generated.
+     * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + getPredicateFieldBuilder() { + if (predicateBuilder_ == null) { + predicateBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( + getPredicate(), getParentForChildren(), isClean()); + predicate_ = null; + } + return predicateBuilder_; + } + + private com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec customOutput_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Builder, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpecOrBuilder> + customOutputBuilder_; + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customOutput field is set. + */ + public boolean hasCustomOutput() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customOutput. + */ + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec getCustomOutput() { + if (customOutputBuilder_ == null) { + return customOutput_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.getDefaultInstance() + : customOutput_; + } else { + return customOutputBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCustomOutput( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec value) { + if (customOutputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customOutput_ = value; + } else { + customOutputBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCustomOutput( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Builder builderForValue) { + if (customOutputBuilder_ == null) { + customOutput_ = builderForValue.build(); + } else { + customOutputBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCustomOutput( + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec value) { + if (customOutputBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && customOutput_ != null + && customOutput_ + != com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec + .getDefaultInstance()) { + getCustomOutputBuilder().mergeFrom(value); + } else { + customOutput_ = value; + } + } else { + customOutputBuilder_.mergeFrom(value); + } + if (customOutput_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCustomOutput() { + bitField0_ = (bitField0_ & ~0x00000002); + customOutput_ = null; + if (customOutputBuilder_ != null) { + customOutputBuilder_.dispose(); + customOutputBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Builder + getCustomOutputBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCustomOutputFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpecOrBuilder + getCustomOutputOrBuilder() { + if (customOutputBuilder_ != null) { + return customOutputBuilder_.getMessageOrBuilder(); + } else { + return customOutput_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.getDefaultInstance() + : customOutput_; + } + } + /** + * + * + *
+     * Optional. Custom output properties.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Builder, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpecOrBuilder> + getCustomOutputFieldBuilder() { + if (customOutputBuilder_ == null) { + customOutputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec.Builder, + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpecOrBuilder>( + getCustomOutput(), getParentForChildren(), isClean()); + customOutput_ = null; + } + return customOutputBuilder_; + } + + private com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector resourceSelector_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector, + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.Builder, + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelectorOrBuilder> + resourceSelectorBuilder_; + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the resourceSelector field is set. + */ + public boolean hasResourceSelector() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The resourceSelector. + */ + public com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector getResourceSelector() { + if (resourceSelectorBuilder_ == null) { + return resourceSelector_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.getDefaultInstance() + : resourceSelector_; + } else { + return resourceSelectorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setResourceSelector( + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector value) { + if (resourceSelectorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resourceSelector_ = value; + } else { + resourceSelectorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setResourceSelector( + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.Builder builderForValue) { + if (resourceSelectorBuilder_ == null) { + resourceSelector_ = builderForValue.build(); + } else { + resourceSelectorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeResourceSelector( + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector value) { + if (resourceSelectorBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && resourceSelector_ != null + && resourceSelector_ + != com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector + .getDefaultInstance()) { + getResourceSelectorBuilder().mergeFrom(value); + } else { + resourceSelector_ = value; + } + } else { + resourceSelectorBuilder_.mergeFrom(value); + } + if (resourceSelector_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearResourceSelector() { + bitField0_ = (bitField0_ & ~0x00000004); + resourceSelector_ = null; + if (resourceSelectorBuilder_ != null) { + resourceSelectorBuilder_.dispose(); + resourceSelectorBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.Builder + getResourceSelectorBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getResourceSelectorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.ResourceSelectorOrBuilder + getResourceSelectorOrBuilder() { + if (resourceSelectorBuilder_ != null) { + return resourceSelectorBuilder_.getMessageOrBuilder(); + } else { + return resourceSelector_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.getDefaultInstance() + : resourceSelector_; + } + } + /** + * + * + *
+     * Required. The resource types that the custom module operates on. Each
+     * custom module can specify up to 5 resource types.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector, + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.Builder, + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelectorOrBuilder> + getResourceSelectorFieldBuilder() { + if (resourceSelectorBuilder_ == null) { + resourceSelectorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector, + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector.Builder, + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelectorOrBuilder>( + getResourceSelector(), getParentForChildren(), isClean()); + resourceSelector_ = null; + } + return resourceSelectorBuilder_; + } + + private int severity_ = 0; + /** + * + * + *
+     * Required. The severity to assign to findings generated by the module.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * Required. The severity to assign to findings generated by the module.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + severity_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The severity to assign to findings generated by the module.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig.Severity getSeverity() { + com.google.cloud.securityposture.v1.CustomConfig.Severity result = + com.google.cloud.securityposture.v1.CustomConfig.Severity.forNumber(severity_); + return result == null + ? com.google.cloud.securityposture.v1.CustomConfig.Severity.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The severity to assign to findings generated by the module.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.cloud.securityposture.v1.CustomConfig.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The severity to assign to findings generated by the module.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000008); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Text that describes the vulnerability or misconfiguration that
+     * the custom module detects. This explanation is returned with each finding
+     * instance to help investigators understand the detected issue. The text must
+     * be enclosed in quotation marks.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Text that describes the vulnerability or misconfiguration that
+     * the custom module detects. This explanation is returned with each finding
+     * instance to help investigators understand the detected issue. The text must
+     * be enclosed in quotation marks.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Text that describes the vulnerability or misconfiguration that
+     * the custom module detects. This explanation is returned with each finding
+     * instance to help investigators understand the detected issue. The text must
+     * be enclosed in quotation marks.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Text that describes the vulnerability or misconfiguration that
+     * the custom module detects. This explanation is returned with each finding
+     * instance to help investigators understand the detected issue. The text must
+     * be enclosed in quotation marks.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Text that describes the vulnerability or misconfiguration that
+     * the custom module detects. This explanation is returned with each finding
+     * instance to help investigators understand the detected issue. The text must
+     * be enclosed in quotation marks.
+     * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object recommendation_ = ""; + /** + * + * + *
+     * Optional. An explanation of the recommended steps that security teams can
+     * take to resolve the detected issue. This explanation is returned with each
+     * finding generated by this module in the `nextSteps` property of the finding
+     * JSON.
+     * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recommendation. + */ + public java.lang.String getRecommendation() { + java.lang.Object ref = recommendation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recommendation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An explanation of the recommended steps that security teams can
+     * take to resolve the detected issue. This explanation is returned with each
+     * finding generated by this module in the `nextSteps` property of the finding
+     * JSON.
+     * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for recommendation. + */ + public com.google.protobuf.ByteString getRecommendationBytes() { + java.lang.Object ref = recommendation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + recommendation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An explanation of the recommended steps that security teams can
+     * take to resolve the detected issue. This explanation is returned with each
+     * finding generated by this module in the `nextSteps` property of the finding
+     * JSON.
+     * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The recommendation to set. + * @return This builder for chaining. + */ + public Builder setRecommendation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + recommendation_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An explanation of the recommended steps that security teams can
+     * take to resolve the detected issue. This explanation is returned with each
+     * finding generated by this module in the `nextSteps` property of the finding
+     * JSON.
+     * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRecommendation() { + recommendation_ = getDefaultInstance().getRecommendation(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An explanation of the recommended steps that security teams can
+     * take to resolve the detected issue. This explanation is returned with each
+     * finding generated by this module in the `nextSteps` property of the finding
+     * JSON.
+     * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for recommendation to set. + * @return This builder for chaining. + */ + public Builder setRecommendationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + recommendation_ = value; + bitField0_ |= 0x00000020; + 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.securityposture.v1.CustomConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.CustomConfig) + private static final com.google.cloud.securityposture.v1.CustomConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.CustomConfig(); + } + + public static com.google.cloud.securityposture.v1.CustomConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomConfig 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.securityposture.v1.CustomConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConfigOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConfigOrBuilder.java new file mode 100644 index 000000000000..f8da6c2f12d9 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConfigOrBuilder.java @@ -0,0 +1,242 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/sha_custom_config.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface CustomConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.CustomConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The CEL expression to evaluate to produce findings. When the
+   * expression evaluates to true against a resource, a finding is generated.
+   * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the predicate field is set. + */ + boolean hasPredicate(); + /** + * + * + *
+   * Required. The CEL expression to evaluate to produce findings. When the
+   * expression evaluates to true against a resource, a finding is generated.
+   * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The predicate. + */ + com.google.type.Expr getPredicate(); + /** + * + * + *
+   * Required. The CEL expression to evaluate to produce findings. When the
+   * expression evaluates to true against a resource, a finding is generated.
+   * 
+ * + * .google.type.Expr predicate = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.type.ExprOrBuilder getPredicateOrBuilder(); + + /** + * + * + *
+   * Optional. Custom output properties.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customOutput field is set. + */ + boolean hasCustomOutput(); + /** + * + * + *
+   * Optional. Custom output properties.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customOutput. + */ + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec getCustomOutput(); + /** + * + * + *
+   * Optional. Custom output properties.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.CustomOutputSpec custom_output = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.CustomConfig.CustomOutputSpecOrBuilder + getCustomOutputOrBuilder(); + + /** + * + * + *
+   * Required. The resource types that the custom module operates on. Each
+   * custom module can specify up to 5 resource types.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the resourceSelector field is set. + */ + boolean hasResourceSelector(); + /** + * + * + *
+   * Required. The resource types that the custom module operates on. Each
+   * custom module can specify up to 5 resource types.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The resourceSelector. + */ + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelector getResourceSelector(); + /** + * + * + *
+   * Required. The resource types that the custom module operates on. Each
+   * custom module can specify up to 5 resource types.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.ResourceSelector resource_selector = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.CustomConfig.ResourceSelectorOrBuilder + getResourceSelectorOrBuilder(); + + /** + * + * + *
+   * Required. The severity to assign to findings generated by the module.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+   * Required. The severity to assign to findings generated by the module.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig.Severity severity = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The severity. + */ + com.google.cloud.securityposture.v1.CustomConfig.Severity getSeverity(); + + /** + * + * + *
+   * Optional. Text that describes the vulnerability or misconfiguration that
+   * the custom module detects. This explanation is returned with each finding
+   * instance to help investigators understand the detected issue. The text must
+   * be enclosed in quotation marks.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Text that describes the vulnerability or misconfiguration that
+   * the custom module detects. This explanation is returned with each finding
+   * instance to help investigators understand the detected issue. The text must
+   * be enclosed in quotation marks.
+   * 
+ * + * string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. An explanation of the recommended steps that security teams can
+   * take to resolve the detected issue. This explanation is returned with each
+   * finding generated by this module in the `nextSteps` property of the finding
+   * JSON.
+   * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recommendation. + */ + java.lang.String getRecommendation(); + /** + * + * + *
+   * Optional. An explanation of the recommended steps that security teams can
+   * take to resolve the detected issue. This explanation is returned with each
+   * finding generated by this module in the `nextSteps` property of the finding
+   * JSON.
+   * 
+ * + * string recommendation = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for recommendation. + */ + com.google.protobuf.ByteString getRecommendationBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConstraint.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConstraint.java new file mode 100644 index 000000000000..c9d4e03e34ac --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConstraint.java @@ -0,0 +1,2841 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/org_policy_config.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * A custom constraint defined by customers which can *only* be applied to the
+ * given resource types and organization.
+ *
+ * By creating a custom constraint, customers can apply policies of this
+ * custom constraint. *Creating a custom constraint itself does NOT apply any
+ * policy enforcement*.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConstraint} + */ +public final class CustomConstraint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.CustomConstraint) + CustomConstraintOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomConstraint.newBuilder() to construct. + private CustomConstraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomConstraint() { + name_ = ""; + resourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + methodTypes_ = java.util.Collections.emptyList(); + condition_ = ""; + actionType_ = 0; + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomConstraint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConstraint.class, + com.google.cloud.securityposture.v1.CustomConstraint.Builder.class); + } + + /** + * + * + *
+   * The operation for which this constraint will be applied. To apply this
+   * constraint only when creating new VMs, the `method_types` should be
+   * `CREATE` only. To apply this constraint when creating or deleting
+   * VMs, the `method_types` should be `CREATE` and `DELETE`.
+   *
+   * `UPDATE` only custom constraints are not supported. Use `CREATE` or
+   * `CREATE, UPDATE`.
+   * 
+ * + * Protobuf enum {@code google.cloud.securityposture.v1.CustomConstraint.MethodType} + */ + public enum MethodType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified. Results in an error.
+     * 
+ * + * METHOD_TYPE_UNSPECIFIED = 0; + */ + METHOD_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Constraint applied when creating the resource.
+     * 
+ * + * CREATE = 1; + */ + CREATE(1), + /** + * + * + *
+     * Constraint applied when updating the resource.
+     * 
+ * + * UPDATE = 2; + */ + UPDATE(2), + /** + * + * + *
+     * Constraint applied when deleting the resource.
+     * Not supported yet.
+     * 
+ * + * DELETE = 3; + */ + DELETE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified. Results in an error.
+     * 
+ * + * METHOD_TYPE_UNSPECIFIED = 0; + */ + public static final int METHOD_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Constraint applied when creating the resource.
+     * 
+ * + * CREATE = 1; + */ + public static final int CREATE_VALUE = 1; + /** + * + * + *
+     * Constraint applied when updating the resource.
+     * 
+ * + * UPDATE = 2; + */ + public static final int UPDATE_VALUE = 2; + /** + * + * + *
+     * Constraint applied when deleting the resource.
+     * Not supported yet.
+     * 
+ * + * DELETE = 3; + */ + public static final int DELETE_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 MethodType 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 MethodType forNumber(int value) { + switch (value) { + case 0: + return METHOD_TYPE_UNSPECIFIED; + case 1: + return CREATE; + case 2: + return UPDATE; + case 3: + return DELETE; + 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 MethodType findValueByNumber(int number) { + return MethodType.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.securityposture.v1.CustomConstraint.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final MethodType[] VALUES = values(); + + public static MethodType 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 MethodType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securityposture.v1.CustomConstraint.MethodType) + } + + /** + * + * + *
+   * Allow or deny type.
+   * 
+ * + * Protobuf enum {@code google.cloud.securityposture.v1.CustomConstraint.ActionType} + */ + public enum ActionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified. Results in an error.
+     * 
+ * + * ACTION_TYPE_UNSPECIFIED = 0; + */ + ACTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Allowed action type.
+     * 
+ * + * ALLOW = 1; + */ + ALLOW(1), + /** + * + * + *
+     * Deny action type.
+     * 
+ * + * DENY = 2; + */ + DENY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified. Results in an error.
+     * 
+ * + * ACTION_TYPE_UNSPECIFIED = 0; + */ + public static final int ACTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Allowed action type.
+     * 
+ * + * ALLOW = 1; + */ + public static final int ALLOW_VALUE = 1; + /** + * + * + *
+     * Deny action type.
+     * 
+ * + * DENY = 2; + */ + public static final int DENY_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 ActionType 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 ActionType forNumber(int value) { + switch (value) { + case 0: + return ACTION_TYPE_UNSPECIFIED; + case 1: + return ALLOW; + case 2: + return DENY; + 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 ActionType findValueByNumber(int number) { + return ActionType.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.securityposture.v1.CustomConstraint.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final ActionType[] VALUES = values(); + + public static ActionType 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 ActionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securityposture.v1.CustomConstraint.ActionType) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Immutable. Name of the constraint. This is unique within the organization.
+   * Format of the name should be
+   *
+   * -
+   * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+   *
+   * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+   *
+   * The max length is 70 characters and the minimum length is 1. Note that the
+   * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+   * Immutable. Name of the constraint. This is unique within the organization.
+   * Format of the name should be
+   *
+   * -
+   * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+   *
+   * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+   *
+   * The max length is 70 characters and the minimum length is 1. Note that the
+   * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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 RESOURCE_TYPES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList resourceTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Immutable. The resource instance type on which this policy applies. Format
+   * will be of the form : `<canonical service name>/<type>` Example:
+   *
+   *  - `compute.googleapis.com/Instance`.
+   * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return A list containing the resourceTypes. + */ + public com.google.protobuf.ProtocolStringList getResourceTypesList() { + return resourceTypes_; + } + /** + * + * + *
+   * Immutable. The resource instance type on which this policy applies. Format
+   * will be of the form : `<canonical service name>/<type>` Example:
+   *
+   *  - `compute.googleapis.com/Instance`.
+   * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The count of resourceTypes. + */ + public int getResourceTypesCount() { + return resourceTypes_.size(); + } + /** + * + * + *
+   * Immutable. The resource instance type on which this policy applies. Format
+   * will be of the form : `<canonical service name>/<type>` Example:
+   *
+   *  - `compute.googleapis.com/Instance`.
+   * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the element to return. + * @return The resourceTypes at the given index. + */ + public java.lang.String getResourceTypes(int index) { + return resourceTypes_.get(index); + } + /** + * + * + *
+   * Immutable. The resource instance type on which this policy applies. Format
+   * will be of the form : `<canonical service name>/<type>` Example:
+   *
+   *  - `compute.googleapis.com/Instance`.
+   * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceTypes at the given index. + */ + public com.google.protobuf.ByteString getResourceTypesBytes(int index) { + return resourceTypes_.getByteString(index); + } + + public static final int METHOD_TYPES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List methodTypes_; + + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.securityposture.v1.CustomConstraint.MethodType> + methodTypes_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.cloud.securityposture.v1.CustomConstraint.MethodType>() { + public com.google.cloud.securityposture.v1.CustomConstraint.MethodType convert( + java.lang.Integer from) { + com.google.cloud.securityposture.v1.CustomConstraint.MethodType result = + com.google.cloud.securityposture.v1.CustomConstraint.MethodType.forNumber(from); + return result == null + ? com.google.cloud.securityposture.v1.CustomConstraint.MethodType.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return A list containing the methodTypes. + */ + @java.lang.Override + public java.util.List + getMethodTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.securityposture.v1.CustomConstraint.MethodType>( + methodTypes_, methodTypes_converter_); + } + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return The count of methodTypes. + */ + @java.lang.Override + public int getMethodTypesCount() { + return methodTypes_.size(); + } + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param index The index of the element to return. + * @return The methodTypes at the given index. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConstraint.MethodType getMethodTypes(int index) { + return methodTypes_converter_.convert(methodTypes_.get(index)); + } + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return A list containing the enum numeric values on the wire for methodTypes. + */ + @java.lang.Override + public java.util.List getMethodTypesValueList() { + return methodTypes_; + } + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of methodTypes at the given index. + */ + @java.lang.Override + public int getMethodTypesValue(int index) { + return methodTypes_.get(index); + } + + private int methodTypesMemoizedSerializedSize; + + public static final int CONDITION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object condition_ = ""; + /** + * + * + *
+   * Org policy condition/expression. For example:
+   * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+   * `resource.management.auto_upgrade == true`
+   *
+   * The max length of the condition is 1000 characters.
+   * 
+ * + * string condition = 4; + * + * @return The condition. + */ + @java.lang.Override + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + 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(); + condition_ = s; + return s; + } + } + /** + * + * + *
+   * Org policy condition/expression. For example:
+   * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+   * `resource.management.auto_upgrade == true`
+   *
+   * The max length of the condition is 1000 characters.
+   * 
+ * + * string condition = 4; + * + * @return The bytes for condition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_TYPE_FIELD_NUMBER = 5; + private int actionType_ = 0; + /** + * + * + *
+   * Allow or deny type.
+   * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @return The enum numeric value on the wire for actionType. + */ + @java.lang.Override + public int getActionTypeValue() { + return actionType_; + } + /** + * + * + *
+   * Allow or deny type.
+   * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @return The actionType. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConstraint.ActionType getActionType() { + com.google.cloud.securityposture.v1.CustomConstraint.ActionType result = + com.google.cloud.securityposture.v1.CustomConstraint.ActionType.forNumber(actionType_); + return result == null + ? com.google.cloud.securityposture.v1.CustomConstraint.ActionType.UNRECOGNIZED + : result; + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** + * + * + *
+   * One line display name for the UI.
+   * The max length of the display_name is 200 characters.
+   * 
+ * + * string display_name = 6; + * + * @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; + } + } + /** + * + * + *
+   * One line display name for the UI.
+   * The max length of the display_name is 200 characters.
+   * 
+ * + * string display_name = 6; + * + * @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 DESCRIPTION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Detailed information about this custom policy constraint.
+   * The max length of the description is 2000 characters.
+   * 
+ * + * string description = 7; + * + * @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; + } + } + /** + * + * + *
+   * Detailed information about this custom policy constraint.
+   * The max length of the description is 2000 characters.
+   * 
+ * + * string description = 7; + * + * @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 UPDATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last time this custom constraint was updated. This
+   * represents the last time that the `CreateCustomConstraint` or
+   * `UpdateCustomConstraint` RPC was called
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The last time this custom constraint was updated. This
+   * represents the last time that the `CreateCustomConstraint` or
+   * `UpdateCustomConstraint` RPC was called
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.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 this custom constraint was updated. This
+   * represents the last time that the `CreateCustomConstraint` or
+   * `UpdateCustomConstraint` RPC was called
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.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 { + getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < resourceTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceTypes_.getRaw(i)); + } + if (getMethodTypesList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(methodTypesMemoizedSerializedSize); + } + for (int i = 0; i < methodTypes_.size(); i++) { + output.writeEnumNoTag(methodTypes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, condition_); + } + if (actionType_ + != com.google.cloud.securityposture.v1.CustomConstraint.ActionType.ACTION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, actionType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, 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_); + } + { + int dataSize = 0; + for (int i = 0; i < resourceTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceTypesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < methodTypes_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(methodTypes_.get(i)); + } + size += dataSize; + if (!getMethodTypesList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + methodTypesMemoizedSerializedSize = dataSize; + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(condition_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, condition_); + } + if (actionType_ + != com.google.cloud.securityposture.v1.CustomConstraint.ActionType.ACTION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, actionType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, displayName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, 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.securityposture.v1.CustomConstraint)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.CustomConstraint other = + (com.google.cloud.securityposture.v1.CustomConstraint) obj; + + if (!getName().equals(other.getName())) return false; + if (!getResourceTypesList().equals(other.getResourceTypesList())) return false; + if (!methodTypes_.equals(other.methodTypes_)) return false; + if (!getCondition().equals(other.getCondition())) return false; + if (actionType_ != other.actionType_) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getDescription().equals(other.getDescription())) 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 (getResourceTypesCount() > 0) { + hash = (37 * hash) + RESOURCE_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getResourceTypesList().hashCode(); + } + if (getMethodTypesCount() > 0) { + hash = (37 * hash) + METHOD_TYPES_FIELD_NUMBER; + hash = (53 * hash) + methodTypes_.hashCode(); + } + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + hash = (37 * hash) + ACTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + actionType_; + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().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.securityposture.v1.CustomConstraint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConstraint 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.securityposture.v1.CustomConstraint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConstraint 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.securityposture.v1.CustomConstraint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.CustomConstraint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.CustomConstraint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConstraint 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.securityposture.v1.CustomConstraint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConstraint 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.securityposture.v1.CustomConstraint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.CustomConstraint 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.securityposture.v1.CustomConstraint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A custom constraint defined by customers which can *only* be applied to the
+   * given resource types and organization.
+   *
+   * By creating a custom constraint, customers can apply policies of this
+   * custom constraint. *Creating a custom constraint itself does NOT apply any
+   * policy enforcement*.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.CustomConstraint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.CustomConstraint) + com.google.cloud.securityposture.v1.CustomConstraintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.CustomConstraint.class, + com.google.cloud.securityposture.v1.CustomConstraint.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.CustomConstraint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + resourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + methodTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + condition_ = ""; + actionType_ = 0; + displayName_ = ""; + description_ = ""; + 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.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_CustomConstraint_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConstraint getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.CustomConstraint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConstraint build() { + com.google.cloud.securityposture.v1.CustomConstraint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConstraint buildPartial() { + com.google.cloud.securityposture.v1.CustomConstraint result = + new com.google.cloud.securityposture.v1.CustomConstraint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.CustomConstraint result) { + if (((bitField0_ & 0x00000004) != 0)) { + methodTypes_ = java.util.Collections.unmodifiableList(methodTypes_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.methodTypes_ = methodTypes_; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.CustomConstraint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + resourceTypes_.makeImmutable(); + result.resourceTypes_ = resourceTypes_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.condition_ = condition_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.actionType_ = actionType_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000080) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.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.securityposture.v1.CustomConstraint) { + return mergeFrom((com.google.cloud.securityposture.v1.CustomConstraint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.CustomConstraint other) { + if (other == com.google.cloud.securityposture.v1.CustomConstraint.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.resourceTypes_.isEmpty()) { + if (resourceTypes_.isEmpty()) { + resourceTypes_ = other.resourceTypes_; + bitField0_ |= 0x00000002; + } else { + ensureResourceTypesIsMutable(); + resourceTypes_.addAll(other.resourceTypes_); + } + onChanged(); + } + if (!other.methodTypes_.isEmpty()) { + if (methodTypes_.isEmpty()) { + methodTypes_ = other.methodTypes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureMethodTypesIsMutable(); + methodTypes_.addAll(other.methodTypes_); + } + onChanged(); + } + if (!other.getCondition().isEmpty()) { + condition_ = other.condition_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.actionType_ != 0) { + setActionTypeValue(other.getActionTypeValue()); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000040; + onChanged(); + } + 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 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureResourceTypesIsMutable(); + resourceTypes_.add(s); + break; + } // case 18 + case 24: + { + int tmpRaw = input.readEnum(); + ensureMethodTypesIsMutable(); + methodTypes_.add(tmpRaw); + break; + } // case 24 + case 26: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureMethodTypesIsMutable(); + methodTypes_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 26 + case 34: + { + condition_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + actionType_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. Name of the constraint. This is unique within the organization.
+     * Format of the name should be
+     *
+     * -
+     * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+     *
+     * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+     *
+     * The max length is 70 characters and the minimum length is 1. Note that the
+     * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Name of the constraint. This is unique within the organization.
+     * Format of the name should be
+     *
+     * -
+     * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+     *
+     * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+     *
+     * The max length is 70 characters and the minimum length is 1. Note that the
+     * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + } + /** + * + * + *
+     * Immutable. Name of the constraint. This is unique within the organization.
+     * Format of the name should be
+     *
+     * -
+     * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+     *
+     * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+     *
+     * The max length is 70 characters and the minimum length is 1. Note that the
+     * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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; + } + /** + * + * + *
+     * Immutable. Name of the constraint. This is unique within the organization.
+     * Format of the name should be
+     *
+     * -
+     * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+     *
+     * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+     *
+     * The max length is 70 characters and the minimum length is 1. Note that the
+     * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. Name of the constraint. This is unique within the organization.
+     * Format of the name should be
+     *
+     * -
+     * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+     *
+     * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+     *
+     * The max length is 70 characters and the minimum length is 1. Note that the
+     * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @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.LazyStringArrayList resourceTypes_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureResourceTypesIsMutable() { + if (!resourceTypes_.isModifiable()) { + resourceTypes_ = new com.google.protobuf.LazyStringArrayList(resourceTypes_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return A list containing the resourceTypes. + */ + public com.google.protobuf.ProtocolStringList getResourceTypesList() { + resourceTypes_.makeImmutable(); + return resourceTypes_; + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The count of resourceTypes. + */ + public int getResourceTypesCount() { + return resourceTypes_.size(); + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the element to return. + * @return The resourceTypes at the given index. + */ + public java.lang.String getResourceTypes(int index) { + return resourceTypes_.get(index); + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceTypes at the given index. + */ + public com.google.protobuf.ByteString getResourceTypesBytes(int index) { + return resourceTypes_.getByteString(index); + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index to set the value at. + * @param value The resourceTypes to set. + * @return This builder for chaining. + */ + public Builder setResourceTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceTypesIsMutable(); + resourceTypes_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The resourceTypes to add. + * @return This builder for chaining. + */ + public Builder addResourceTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceTypesIsMutable(); + resourceTypes_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param values The resourceTypes to add. + * @return This builder for chaining. + */ + public Builder addAllResourceTypes(java.lang.Iterable values) { + ensureResourceTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceTypes_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearResourceTypes() { + resourceTypes_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The resource instance type on which this policy applies. Format
+     * will be of the form : `<canonical service name>/<type>` Example:
+     *
+     *  - `compute.googleapis.com/Instance`.
+     * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes of the resourceTypes to add. + * @return This builder for chaining. + */ + public Builder addResourceTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceTypesIsMutable(); + resourceTypes_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.util.List methodTypes_ = java.util.Collections.emptyList(); + + private void ensureMethodTypesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + methodTypes_ = new java.util.ArrayList(methodTypes_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return A list containing the methodTypes. + */ + public java.util.List + getMethodTypesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.securityposture.v1.CustomConstraint.MethodType>( + methodTypes_, methodTypes_converter_); + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return The count of methodTypes. + */ + public int getMethodTypesCount() { + return methodTypes_.size(); + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param index The index of the element to return. + * @return The methodTypes at the given index. + */ + public com.google.cloud.securityposture.v1.CustomConstraint.MethodType getMethodTypes( + int index) { + return methodTypes_converter_.convert(methodTypes_.get(index)); + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param index The index to set the value at. + * @param value The methodTypes to set. + * @return This builder for chaining. + */ + public Builder setMethodTypes( + int index, com.google.cloud.securityposture.v1.CustomConstraint.MethodType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodTypesIsMutable(); + methodTypes_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param value The methodTypes to add. + * @return This builder for chaining. + */ + public Builder addMethodTypes( + com.google.cloud.securityposture.v1.CustomConstraint.MethodType value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMethodTypesIsMutable(); + methodTypes_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param values The methodTypes to add. + * @return This builder for chaining. + */ + public Builder addAllMethodTypes( + java.lang.Iterable< + ? extends com.google.cloud.securityposture.v1.CustomConstraint.MethodType> + values) { + ensureMethodTypesIsMutable(); + for (com.google.cloud.securityposture.v1.CustomConstraint.MethodType value : values) { + methodTypes_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return This builder for chaining. + */ + public Builder clearMethodTypes() { + methodTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return A list containing the enum numeric values on the wire for methodTypes. + */ + public java.util.List getMethodTypesValueList() { + return java.util.Collections.unmodifiableList(methodTypes_); + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of methodTypes at the given index. + */ + public int getMethodTypesValue(int index) { + return methodTypes_.get(index); + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for methodTypes to set. + * @return This builder for chaining. + */ + public Builder setMethodTypesValue(int index, int value) { + ensureMethodTypesIsMutable(); + methodTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param value The enum numeric value on the wire for methodTypes to add. + * @return This builder for chaining. + */ + public Builder addMethodTypesValue(int value) { + ensureMethodTypesIsMutable(); + methodTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * All the operations being applied for this constraint.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param values The enum numeric values on the wire for methodTypes to add. + * @return This builder for chaining. + */ + public Builder addAllMethodTypesValue(java.lang.Iterable values) { + ensureMethodTypesIsMutable(); + for (int value : values) { + methodTypes_.add(value); + } + onChanged(); + return this; + } + + private java.lang.Object condition_ = ""; + /** + * + * + *
+     * Org policy condition/expression. For example:
+     * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+     * `resource.management.auto_upgrade == true`
+     *
+     * The max length of the condition is 1000 characters.
+     * 
+ * + * string condition = 4; + * + * @return The condition. + */ + public java.lang.String getCondition() { + java.lang.Object ref = condition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + condition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Org policy condition/expression. For example:
+     * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+     * `resource.management.auto_upgrade == true`
+     *
+     * The max length of the condition is 1000 characters.
+     * 
+ * + * string condition = 4; + * + * @return The bytes for condition. + */ + public com.google.protobuf.ByteString getConditionBytes() { + java.lang.Object ref = condition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + condition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Org policy condition/expression. For example:
+     * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+     * `resource.management.auto_upgrade == true`
+     *
+     * The max length of the condition is 1000 characters.
+     * 
+ * + * string condition = 4; + * + * @param value The condition to set. + * @return This builder for chaining. + */ + public Builder setCondition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Org policy condition/expression. For example:
+     * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+     * `resource.management.auto_upgrade == true`
+     *
+     * The max length of the condition is 1000 characters.
+     * 
+ * + * string condition = 4; + * + * @return This builder for chaining. + */ + public Builder clearCondition() { + condition_ = getDefaultInstance().getCondition(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Org policy condition/expression. For example:
+     * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+     * `resource.management.auto_upgrade == true`
+     *
+     * The max length of the condition is 1000 characters.
+     * 
+ * + * string condition = 4; + * + * @param value The bytes for condition to set. + * @return This builder for chaining. + */ + public Builder setConditionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + condition_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private int actionType_ = 0; + /** + * + * + *
+     * Allow or deny type.
+     * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @return The enum numeric value on the wire for actionType. + */ + @java.lang.Override + public int getActionTypeValue() { + return actionType_; + } + /** + * + * + *
+     * Allow or deny type.
+     * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @param value The enum numeric value on the wire for actionType to set. + * @return This builder for chaining. + */ + public Builder setActionTypeValue(int value) { + actionType_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Allow or deny type.
+     * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @return The actionType. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConstraint.ActionType getActionType() { + com.google.cloud.securityposture.v1.CustomConstraint.ActionType result = + com.google.cloud.securityposture.v1.CustomConstraint.ActionType.forNumber(actionType_); + return result == null + ? com.google.cloud.securityposture.v1.CustomConstraint.ActionType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Allow or deny type.
+     * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @param value The actionType to set. + * @return This builder for chaining. + */ + public Builder setActionType( + com.google.cloud.securityposture.v1.CustomConstraint.ActionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + actionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Allow or deny type.
+     * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @return This builder for chaining. + */ + public Builder clearActionType() { + bitField0_ = (bitField0_ & ~0x00000010); + actionType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * One line display name for the UI.
+     * The max length of the display_name is 200 characters.
+     * 
+ * + * string display_name = 6; + * + * @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; + } + } + /** + * + * + *
+     * One line display name for the UI.
+     * The max length of the display_name is 200 characters.
+     * 
+ * + * string display_name = 6; + * + * @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; + } + } + /** + * + * + *
+     * One line display name for the UI.
+     * The max length of the display_name is 200 characters.
+     * 
+ * + * string display_name = 6; + * + * @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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * One line display name for the UI.
+     * The max length of the display_name is 200 characters.
+     * 
+ * + * string display_name = 6; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * One line display name for the UI.
+     * The max length of the display_name is 200 characters.
+     * 
+ * + * string display_name = 6; + * + * @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_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Detailed information about this custom policy constraint.
+     * The max length of the description is 2000 characters.
+     * 
+ * + * string description = 7; + * + * @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; + } + } + /** + * + * + *
+     * Detailed information about this custom policy constraint.
+     * The max length of the description is 2000 characters.
+     * 
+ * + * string description = 7; + * + * @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; + } + } + /** + * + * + *
+     * Detailed information about this custom policy constraint.
+     * The max length of the description is 2000 characters.
+     * 
+ * + * string description = 7; + * + * @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_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Detailed information about this custom policy constraint.
+     * The max length of the description is 2000 characters.
+     * 
+ * + * string description = 7; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Detailed information about this custom policy constraint.
+     * The max length of the description is 2000 characters.
+     * 
+ * + * string description = 7; + * + * @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_ |= 0x00000040; + onChanged(); + return this; + } + + 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 this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. The last time this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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 this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The last time this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000080); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The last time this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last time this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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 this custom constraint was updated. This
+     * represents the last time that the `CreateCustomConstraint` or
+     * `UpdateCustomConstraint` RPC was called
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 8 [(.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.securityposture.v1.CustomConstraint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.CustomConstraint) + private static final com.google.cloud.securityposture.v1.CustomConstraint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.CustomConstraint(); + } + + public static com.google.cloud.securityposture.v1.CustomConstraint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomConstraint 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.securityposture.v1.CustomConstraint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConstraintOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConstraintOrBuilder.java new file mode 100644 index 000000000000..2ec3f5d5fb65 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/CustomConstraintOrBuilder.java @@ -0,0 +1,357 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/org_policy_config.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface CustomConstraintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.CustomConstraint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. Name of the constraint. This is unique within the organization.
+   * Format of the name should be
+   *
+   * -
+   * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+   *
+   * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+   *
+   * The max length is 70 characters and the minimum length is 1. Note that the
+   * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. Name of the constraint. This is unique within the organization.
+   * Format of the name should be
+   *
+   * -
+   * `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
+   *
+   * Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
+   *
+   * The max length is 70 characters and the minimum length is 1. Note that the
+   * prefix `organizations/{organization_id}/customConstraints/` is not counted.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. The resource instance type on which this policy applies. Format
+   * will be of the form : `<canonical service name>/<type>` Example:
+   *
+   *  - `compute.googleapis.com/Instance`.
+   * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return A list containing the resourceTypes. + */ + java.util.List getResourceTypesList(); + /** + * + * + *
+   * Immutable. The resource instance type on which this policy applies. Format
+   * will be of the form : `<canonical service name>/<type>` Example:
+   *
+   *  - `compute.googleapis.com/Instance`.
+   * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The count of resourceTypes. + */ + int getResourceTypesCount(); + /** + * + * + *
+   * Immutable. The resource instance type on which this policy applies. Format
+   * will be of the form : `<canonical service name>/<type>` Example:
+   *
+   *  - `compute.googleapis.com/Instance`.
+   * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the element to return. + * @return The resourceTypes at the given index. + */ + java.lang.String getResourceTypes(int index); + /** + * + * + *
+   * Immutable. The resource instance type on which this policy applies. Format
+   * will be of the form : `<canonical service name>/<type>` Example:
+   *
+   *  - `compute.googleapis.com/Instance`.
+   * 
+ * + * repeated string resource_types = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceTypes at the given index. + */ + com.google.protobuf.ByteString getResourceTypesBytes(int index); + + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return A list containing the methodTypes. + */ + java.util.List + getMethodTypesList(); + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return The count of methodTypes. + */ + int getMethodTypesCount(); + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param index The index of the element to return. + * @return The methodTypes at the given index. + */ + com.google.cloud.securityposture.v1.CustomConstraint.MethodType getMethodTypes(int index); + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @return A list containing the enum numeric values on the wire for methodTypes. + */ + java.util.List getMethodTypesValueList(); + /** + * + * + *
+   * All the operations being applied for this constraint.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.CustomConstraint.MethodType method_types = 3; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of methodTypes at the given index. + */ + int getMethodTypesValue(int index); + + /** + * + * + *
+   * Org policy condition/expression. For example:
+   * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+   * `resource.management.auto_upgrade == true`
+   *
+   * The max length of the condition is 1000 characters.
+   * 
+ * + * string condition = 4; + * + * @return The condition. + */ + java.lang.String getCondition(); + /** + * + * + *
+   * Org policy condition/expression. For example:
+   * `resource.instanceName.matches("[production|test]_.*_(\d)+")` or,
+   * `resource.management.auto_upgrade == true`
+   *
+   * The max length of the condition is 1000 characters.
+   * 
+ * + * string condition = 4; + * + * @return The bytes for condition. + */ + com.google.protobuf.ByteString getConditionBytes(); + + /** + * + * + *
+   * Allow or deny type.
+   * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @return The enum numeric value on the wire for actionType. + */ + int getActionTypeValue(); + /** + * + * + *
+   * Allow or deny type.
+   * 
+ * + * .google.cloud.securityposture.v1.CustomConstraint.ActionType action_type = 5; + * + * @return The actionType. + */ + com.google.cloud.securityposture.v1.CustomConstraint.ActionType getActionType(); + + /** + * + * + *
+   * One line display name for the UI.
+   * The max length of the display_name is 200 characters.
+   * 
+ * + * string display_name = 6; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * One line display name for the UI.
+   * The max length of the display_name is 200 characters.
+   * 
+ * + * string display_name = 6; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Detailed information about this custom policy constraint.
+   * The max length of the description is 2000 characters.
+   * 
+ * + * string description = 7; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Detailed information about this custom policy constraint.
+   * The max length of the description is 2000 characters.
+   * 
+ * + * string description = 7; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The last time this custom constraint was updated. This
+   * represents the last time that the `CreateCustomConstraint` or
+   * `UpdateCustomConstraint` RPC was called
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last time this custom constraint was updated. This
+   * represents the last time that the `CreateCustomConstraint` or
+   * `UpdateCustomConstraint` RPC was called
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last time this custom constraint was updated. This
+   * represents the last time that the `CreateCustomConstraint` or
+   * `UpdateCustomConstraint` RPC was called
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureDeploymentRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureDeploymentRequest.java new file mode 100644 index 000000000000..28f6efae27b7 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureDeploymentRequest.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for deleting a PostureDeployment.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.DeletePostureDeploymentRequest} + */ +public final class DeletePostureDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.DeletePostureDeploymentRequest) + DeletePostureDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeletePostureDeploymentRequest.newBuilder() to construct. + private DeletePostureDeploymentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeletePostureDeploymentRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeletePostureDeploymentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest.class, + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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.
+   * 
+ * + * + * 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; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. Etag value of the PostureDeployment to be deleted.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Etag value of the PostureDeployment to be deleted.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + } + 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(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + } + 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.securityposture.v1.DeletePostureDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest other = + (com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest 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.securityposture.v1.DeletePostureDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest 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.securityposture.v1.DeletePostureDeploymentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest 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.securityposture.v1.DeletePostureDeploymentRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest + 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.securityposture.v1.DeletePostureDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest 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.securityposture.v1.DeletePostureDeploymentRequest 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 deleting a PostureDeployment.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.DeletePostureDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.DeletePostureDeploymentRequest) + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest.class, + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest build() { + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest buildPartial() { + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest result = + new com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + } + + @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.securityposture.v1.DeletePostureDeploymentRequest) { + return mergeFrom( + (com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest other) { + if (other + == com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = 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 name_ = ""; + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. Etag value of the PostureDeployment to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Etag value of the PostureDeployment to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Etag value of the PostureDeployment to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Etag value of the PostureDeployment to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Etag value of the PostureDeployment to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 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.securityposture.v1.DeletePostureDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.DeletePostureDeploymentRequest) + private static final com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest(); + } + + public static com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePostureDeploymentRequest 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.securityposture.v1.DeletePostureDeploymentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureDeploymentRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..2640c91aa981 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureDeploymentRequestOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface DeletePostureDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.DeletePostureDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Etag value of the PostureDeployment to be deleted.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. Etag value of the PostureDeployment to be deleted.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureRequest.java new file mode 100644 index 000000000000..c5ef295d26f1 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureRequest.java @@ -0,0 +1,822 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for deleting a Posture.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.DeletePostureRequest} + */ +public final class DeletePostureRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.DeletePostureRequest) + DeletePostureRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeletePostureRequest.newBuilder() to construct. + private DeletePostureRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeletePostureRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeletePostureRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.DeletePostureRequest.class, + com.google.cloud.securityposture.v1.DeletePostureRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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.
+   * 
+ * + * + * 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; + } + } + + public static final int ETAG_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. Etag value of the Posture to be deleted.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Etag value of the Posture to be deleted.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + } + 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(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + } + 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.securityposture.v1.DeletePostureRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.DeletePostureRequest other = + (com.google.cloud.securityposture.v1.DeletePostureRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) 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) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest 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.securityposture.v1.DeletePostureRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest 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.securityposture.v1.DeletePostureRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest 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.securityposture.v1.DeletePostureRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest 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.securityposture.v1.DeletePostureRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest 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.securityposture.v1.DeletePostureRequest 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 deleting a Posture.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.DeletePostureRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.DeletePostureRequest) + com.google.cloud.securityposture.v1.DeletePostureRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.DeletePostureRequest.class, + com.google.cloud.securityposture.v1.DeletePostureRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.DeletePostureRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_DeletePostureRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.DeletePostureRequest getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.DeletePostureRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.DeletePostureRequest build() { + com.google.cloud.securityposture.v1.DeletePostureRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.DeletePostureRequest buildPartial() { + com.google.cloud.securityposture.v1.DeletePostureRequest result = + new com.google.cloud.securityposture.v1.DeletePostureRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.DeletePostureRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + } + + @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.securityposture.v1.DeletePostureRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.DeletePostureRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.DeletePostureRequest other) { + if (other == com.google.cloud.securityposture.v1.DeletePostureRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + etag_ = 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 name_ = ""; + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. Etag value of the Posture to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Etag value of the Posture to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Etag value of the Posture to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Etag value of the Posture to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Etag value of the Posture to be deleted.
+     * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 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.securityposture.v1.DeletePostureRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.DeletePostureRequest) + private static final com.google.cloud.securityposture.v1.DeletePostureRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.DeletePostureRequest(); + } + + public static com.google.cloud.securityposture.v1.DeletePostureRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePostureRequest 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.securityposture.v1.DeletePostureRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureRequestOrBuilder.java new file mode 100644 index 000000000000..fe669a15fc4d --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/DeletePostureRequestOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface DeletePostureRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.DeletePostureRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Etag value of the Posture to be deleted.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. Etag value of the Posture to be deleted.
+   * 
+ * + * string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/EnablementState.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/EnablementState.java new file mode 100644 index 000000000000..8325503efeaf --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/EnablementState.java @@ -0,0 +1,179 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securityposture/v1/sha_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Possible enablement states of a service or module.
+ * 
+ * + * Protobuf enum {@code google.cloud.securityposture.v1.EnablementState} + */ +public enum EnablementState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Default value. This value is unused.
+   * 
+ * + * ENABLEMENT_STATE_UNSPECIFIED = 0; + */ + ENABLEMENT_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * State is enabled.
+   * 
+ * + * ENABLED = 1; + */ + ENABLED(1), + /** + * + * + *
+   * State is disabled.
+   * 
+ * + * DISABLED = 2; + */ + DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Default value. This value is unused.
+   * 
+ * + * ENABLEMENT_STATE_UNSPECIFIED = 0; + */ + public static final int ENABLEMENT_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * State is enabled.
+   * 
+ * + * ENABLED = 1; + */ + public static final int ENABLED_VALUE = 1; + /** + * + * + *
+   * State is disabled.
+   * 
+ * + * DISABLED = 2; + */ + public static final int DISABLED_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 EnablementState 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 EnablementState forNumber(int value) { + switch (value) { + case 0: + return ENABLEMENT_STATE_UNSPECIFIED; + case 1: + return ENABLED; + case 2: + return DISABLED; + 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 EnablementState findValueByNumber(int number) { + return EnablementState.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.securityposture.v1.ShaConstraintsProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final EnablementState[] VALUES = values(); + + public static EnablementState 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 EnablementState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.securityposture.v1.EnablementState) +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ExtractPostureRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ExtractPostureRequest.java new file mode 100644 index 000000000000..043ee2a7a7cc --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ExtractPostureRequest.java @@ -0,0 +1,1053 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for extracting existing policies on a workload as a Posture.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ExtractPostureRequest} + */ +public final class ExtractPostureRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ExtractPostureRequest) + ExtractPostureRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExtractPostureRequest.newBuilder() to construct. + private ExtractPostureRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExtractPostureRequest() { + parent_ = ""; + postureId_ = ""; + workload_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExtractPostureRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ExtractPostureRequest.class, + com.google.cloud.securityposture.v1.ExtractPostureRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource name. The format of this value is as follows:
+   * `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. The parent resource name. The format of this value is as follows:
+   * `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 POSTURE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object postureId_ = ""; + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + @java.lang.Override + public java.lang.String getPostureId() { + java.lang.Object ref = postureId_; + 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(); + postureId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPostureIdBytes() { + java.lang.Object ref = postureId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WORKLOAD_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object workload_ = ""; + /** + * + * + *
+   * Required. Workload from which the policies are to be extracted, it should
+   * belong to the same organization defined in parent. The format of this value
+   * varies depending on the scope of the request:
+   * - `folder/folderNumber`
+   * - `project/projectNumber`
+   * - `organization/organizationNumber`
+   * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workload. + */ + @java.lang.Override + public java.lang.String getWorkload() { + java.lang.Object ref = workload_; + 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(); + workload_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Workload from which the policies are to be extracted, it should
+   * belong to the same organization defined in parent. The format of this value
+   * varies depending on the scope of the request:
+   * - `folder/folderNumber`
+   * - `project/projectNumber`
+   * - `organization/organizationNumber`
+   * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkloadBytes() { + java.lang.Object ref = workload_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workload_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, postureId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workload_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, workload_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, postureId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workload_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, workload_); + } + 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.securityposture.v1.ExtractPostureRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ExtractPostureRequest other = + (com.google.cloud.securityposture.v1.ExtractPostureRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPostureId().equals(other.getPostureId())) return false; + if (!getWorkload().equals(other.getWorkload())) 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) + POSTURE_ID_FIELD_NUMBER; + hash = (53 * hash) + getPostureId().hashCode(); + hash = (37 * hash) + WORKLOAD_FIELD_NUMBER; + hash = (53 * hash) + getWorkload().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest 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.securityposture.v1.ExtractPostureRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest 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.securityposture.v1.ExtractPostureRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest 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.securityposture.v1.ExtractPostureRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest 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.securityposture.v1.ExtractPostureRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest 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.securityposture.v1.ExtractPostureRequest 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 extracting existing policies on a workload as a Posture.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ExtractPostureRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ExtractPostureRequest) + com.google.cloud.securityposture.v1.ExtractPostureRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ExtractPostureRequest.class, + com.google.cloud.securityposture.v1.ExtractPostureRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.ExtractPostureRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + postureId_ = ""; + workload_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ExtractPostureRequest getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ExtractPostureRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ExtractPostureRequest build() { + com.google.cloud.securityposture.v1.ExtractPostureRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ExtractPostureRequest buildPartial() { + com.google.cloud.securityposture.v1.ExtractPostureRequest result = + new com.google.cloud.securityposture.v1.ExtractPostureRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.ExtractPostureRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.postureId_ = postureId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.workload_ = workload_; + } + } + + @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.securityposture.v1.ExtractPostureRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.ExtractPostureRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.ExtractPostureRequest other) { + if (other == com.google.cloud.securityposture.v1.ExtractPostureRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPostureId().isEmpty()) { + postureId_ = other.postureId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getWorkload().isEmpty()) { + workload_ = other.workload_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + postureId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + workload_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name. The format of this value is as follows:
+     * `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. The parent resource name. The format of this value is as follows:
+     * `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. The parent resource name. The format of this value is as follows:
+     * `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. The parent resource name. The format of this value is as follows:
+     * `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. The parent resource name. The format of this value is as follows:
+     * `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 java.lang.Object postureId_ = ""; + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + public java.lang.String getPostureId() { + java.lang.Object ref = postureId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + postureId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + public com.google.protobuf.ByteString getPostureIdBytes() { + java.lang.Object ref = postureId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The postureId to set. + * @return This builder for chaining. + */ + public Builder setPostureId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + postureId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPostureId() { + postureId_ = getDefaultInstance().getPostureId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. User provided identifier. It should be unique in scope of an
+     * Organization and location.
+     * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for postureId to set. + * @return This builder for chaining. + */ + public Builder setPostureIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + postureId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object workload_ = ""; + /** + * + * + *
+     * Required. Workload from which the policies are to be extracted, it should
+     * belong to the same organization defined in parent. The format of this value
+     * varies depending on the scope of the request:
+     * - `folder/folderNumber`
+     * - `project/projectNumber`
+     * - `organization/organizationNumber`
+     * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workload. + */ + public java.lang.String getWorkload() { + java.lang.Object ref = workload_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workload_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Workload from which the policies are to be extracted, it should
+     * belong to the same organization defined in parent. The format of this value
+     * varies depending on the scope of the request:
+     * - `folder/folderNumber`
+     * - `project/projectNumber`
+     * - `organization/organizationNumber`
+     * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workload. + */ + public com.google.protobuf.ByteString getWorkloadBytes() { + java.lang.Object ref = workload_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workload_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Workload from which the policies are to be extracted, it should
+     * belong to the same organization defined in parent. The format of this value
+     * varies depending on the scope of the request:
+     * - `folder/folderNumber`
+     * - `project/projectNumber`
+     * - `organization/organizationNumber`
+     * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The workload to set. + * @return This builder for chaining. + */ + public Builder setWorkload(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + workload_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workload from which the policies are to be extracted, it should
+     * belong to the same organization defined in parent. The format of this value
+     * varies depending on the scope of the request:
+     * - `folder/folderNumber`
+     * - `project/projectNumber`
+     * - `organization/organizationNumber`
+     * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearWorkload() { + workload_ = getDefaultInstance().getWorkload(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Workload from which the policies are to be extracted, it should
+     * belong to the same organization defined in parent. The format of this value
+     * varies depending on the scope of the request:
+     * - `folder/folderNumber`
+     * - `project/projectNumber`
+     * - `organization/organizationNumber`
+     * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for workload to set. + * @return This builder for chaining. + */ + public Builder setWorkloadBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + workload_ = 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.securityposture.v1.ExtractPostureRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ExtractPostureRequest) + private static final com.google.cloud.securityposture.v1.ExtractPostureRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ExtractPostureRequest(); + } + + public static com.google.cloud.securityposture.v1.ExtractPostureRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExtractPostureRequest 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.securityposture.v1.ExtractPostureRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ExtractPostureRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ExtractPostureRequestOrBuilder.java new file mode 100644 index 000000000000..9bf5ea4ba42c --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ExtractPostureRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ExtractPostureRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ExtractPostureRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name. The format of this value is as follows:
+   * `organizations/{organization}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name. The format of this value is as follows:
+   * `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(); + + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + java.lang.String getPostureId(); + /** + * + * + *
+   * Required. User provided identifier. It should be unique in scope of an
+   * Organization and location.
+   * 
+ * + * string posture_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + com.google.protobuf.ByteString getPostureIdBytes(); + + /** + * + * + *
+   * Required. Workload from which the policies are to be extracted, it should
+   * belong to the same organization defined in parent. The format of this value
+   * varies depending on the scope of the request:
+   * - `folder/folderNumber`
+   * - `project/projectNumber`
+   * - `organization/organizationNumber`
+   * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workload. + */ + java.lang.String getWorkload(); + /** + * + * + *
+   * Required. Workload from which the policies are to be extracted, it should
+   * belong to the same organization defined in parent. The format of this value
+   * varies depending on the scope of the request:
+   * - `folder/folderNumber`
+   * - `project/projectNumber`
+   * - `organization/organizationNumber`
+   * 
+ * + * string workload = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workload. + */ + com.google.protobuf.ByteString getWorkloadBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureDeploymentRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureDeploymentRequest.java new file mode 100644 index 000000000000..3b98f05afed4 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureDeploymentRequest.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for getting a PostureDeployment.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.GetPostureDeploymentRequest} + */ +public final class GetPostureDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.GetPostureDeploymentRequest) + GetPostureDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPostureDeploymentRequest.newBuilder() to construct. + private GetPostureDeploymentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPostureDeploymentRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPostureDeploymentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest.class, + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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.
+   * 
+ * + * + * 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.securityposture.v1.GetPostureDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest other = + (com.google.cloud.securityposture.v1.GetPostureDeploymentRequest) 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.securityposture.v1.GetPostureDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureDeploymentRequest 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.securityposture.v1.GetPostureDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureDeploymentRequest 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.securityposture.v1.GetPostureDeploymentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.GetPostureDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureDeploymentRequest 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.securityposture.v1.GetPostureDeploymentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureDeploymentRequest 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.securityposture.v1.GetPostureDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureDeploymentRequest 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.securityposture.v1.GetPostureDeploymentRequest 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 PostureDeployment.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.GetPostureDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.GetPostureDeploymentRequest) + com.google.cloud.securityposture.v1.GetPostureDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest.class, + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.GetPostureDeploymentRequest.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.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureDeploymentRequest + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.GetPostureDeploymentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureDeploymentRequest build() { + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureDeploymentRequest buildPartial() { + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest result = + new com.google.cloud.securityposture.v1.GetPostureDeploymentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest 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.securityposture.v1.GetPostureDeploymentRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.GetPostureDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.GetPostureDeploymentRequest other) { + if (other + == com.google.cloud.securityposture.v1.GetPostureDeploymentRequest.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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.securityposture.v1.GetPostureDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.GetPostureDeploymentRequest) + private static final com.google.cloud.securityposture.v1.GetPostureDeploymentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.GetPostureDeploymentRequest(); + } + + public static com.google.cloud.securityposture.v1.GetPostureDeploymentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPostureDeploymentRequest 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.securityposture.v1.GetPostureDeploymentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureDeploymentRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..46251019485f --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureDeploymentRequestOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface GetPostureDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.GetPostureDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureRequest.java new file mode 100644 index 000000000000..355647c1f1b2 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureRequest.java @@ -0,0 +1,822 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for getting a Posture.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.GetPostureRequest} + */ +public final class GetPostureRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.GetPostureRequest) + GetPostureRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPostureRequest.newBuilder() to construct. + private GetPostureRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPostureRequest() { + name_ = ""; + revisionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPostureRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.GetPostureRequest.class, + com.google.cloud.securityposture.v1.GetPostureRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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.
+   * 
+ * + * + * 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; + } + } + + public static final int REVISION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object revisionId_ = ""; + /** + * + * + *
+   * Optional. Posture revision which needs to be retrieved.
+   * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revisionId. + */ + @java.lang.Override + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + 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(); + revisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Posture revision which needs to be retrieved.
+   * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for revisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, revisionId_); + } + 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(revisionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, revisionId_); + } + 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.securityposture.v1.GetPostureRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.GetPostureRequest other = + (com.google.cloud.securityposture.v1.GetPostureRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRevisionId().equals(other.getRevisionId())) 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) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest 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.securityposture.v1.GetPostureRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest 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.securityposture.v1.GetPostureRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest 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.securityposture.v1.GetPostureRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest 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.securityposture.v1.GetPostureRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest 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.securityposture.v1.GetPostureRequest 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 Posture.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.GetPostureRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.GetPostureRequest) + com.google.cloud.securityposture.v1.GetPostureRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.GetPostureRequest.class, + com.google.cloud.securityposture.v1.GetPostureRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.GetPostureRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + revisionId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureRequest getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.GetPostureRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureRequest build() { + com.google.cloud.securityposture.v1.GetPostureRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureRequest buildPartial() { + com.google.cloud.securityposture.v1.GetPostureRequest result = + new com.google.cloud.securityposture.v1.GetPostureRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.GetPostureRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.revisionId_ = revisionId_; + } + } + + @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.securityposture.v1.GetPostureRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.GetPostureRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.GetPostureRequest other) { + if (other == com.google.cloud.securityposture.v1.GetPostureRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + revisionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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; + } + + private java.lang.Object revisionId_ = ""; + /** + * + * + *
+     * Optional. Posture revision which needs to be retrieved.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revisionId. + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Posture revision which needs to be retrieved.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for revisionId. + */ + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Posture revision which needs to be retrieved.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Posture revision which needs to be retrieved.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRevisionId() { + revisionId_ = getDefaultInstance().getRevisionId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Posture revision which needs to be retrieved.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionId_ = 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.securityposture.v1.GetPostureRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.GetPostureRequest) + private static final com.google.cloud.securityposture.v1.GetPostureRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.GetPostureRequest(); + } + + public static com.google.cloud.securityposture.v1.GetPostureRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPostureRequest 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.securityposture.v1.GetPostureRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureRequestOrBuilder.java new file mode 100644 index 000000000000..dabd4f914ab1 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureRequestOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface GetPostureRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.GetPostureRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Posture revision which needs to be retrieved.
+   * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revisionId. + */ + java.lang.String getRevisionId(); + /** + * + * + *
+   * Optional. Posture revision which needs to be retrieved.
+   * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for revisionId. + */ + com.google.protobuf.ByteString getRevisionIdBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureTemplateRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureTemplateRequest.java new file mode 100644 index 000000000000..a34f15e6ad13 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureTemplateRequest.java @@ -0,0 +1,833 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for getting a Posture Template.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.GetPostureTemplateRequest} + */ +public final class GetPostureTemplateRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.GetPostureTemplateRequest) + GetPostureTemplateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetPostureTemplateRequest.newBuilder() to construct. + private GetPostureTemplateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetPostureTemplateRequest() { + name_ = ""; + revisionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetPostureTemplateRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.GetPostureTemplateRequest.class, + com.google.cloud.securityposture.v1.GetPostureTemplateRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * 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.
+   * 
+ * + * + * 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; + } + } + + public static final int REVISION_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object revisionId_ = ""; + /** + * + * + *
+   * Optional. Specific revision_id of a Posture Template.
+   * PostureTemplate revision_id which needs to be retrieved.
+   * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revisionId. + */ + @java.lang.Override + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + 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(); + revisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Specific revision_id of a Posture Template.
+   * PostureTemplate revision_id which needs to be retrieved.
+   * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for revisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, revisionId_); + } + 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(revisionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, revisionId_); + } + 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.securityposture.v1.GetPostureTemplateRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.GetPostureTemplateRequest other = + (com.google.cloud.securityposture.v1.GetPostureTemplateRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRevisionId().equals(other.getRevisionId())) 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) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest 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.securityposture.v1.GetPostureTemplateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest 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.securityposture.v1.GetPostureTemplateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest 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.securityposture.v1.GetPostureTemplateRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest 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.securityposture.v1.GetPostureTemplateRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest 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.securityposture.v1.GetPostureTemplateRequest 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 Posture Template.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.GetPostureTemplateRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.GetPostureTemplateRequest) + com.google.cloud.securityposture.v1.GetPostureTemplateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.GetPostureTemplateRequest.class, + com.google.cloud.securityposture.v1.GetPostureTemplateRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.GetPostureTemplateRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + revisionId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureTemplateRequest + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.GetPostureTemplateRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureTemplateRequest build() { + com.google.cloud.securityposture.v1.GetPostureTemplateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.GetPostureTemplateRequest buildPartial() { + com.google.cloud.securityposture.v1.GetPostureTemplateRequest result = + new com.google.cloud.securityposture.v1.GetPostureTemplateRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.GetPostureTemplateRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.revisionId_ = revisionId_; + } + } + + @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.securityposture.v1.GetPostureTemplateRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.GetPostureTemplateRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.GetPostureTemplateRequest other) { + if (other + == com.google.cloud.securityposture.v1.GetPostureTemplateRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + revisionId_ = 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 name_ = ""; + /** + * + * + *
+     * Required. Name of the resource.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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.
+     * 
+ * + * + * 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; + } + + private java.lang.Object revisionId_ = ""; + /** + * + * + *
+     * Optional. Specific revision_id of a Posture Template.
+     * PostureTemplate revision_id which needs to be retrieved.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revisionId. + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Specific revision_id of a Posture Template.
+     * PostureTemplate revision_id which needs to be retrieved.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for revisionId. + */ + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Specific revision_id of a Posture Template.
+     * PostureTemplate revision_id which needs to be retrieved.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specific revision_id of a Posture Template.
+     * PostureTemplate revision_id which needs to be retrieved.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRevisionId() { + revisionId_ = getDefaultInstance().getRevisionId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Specific revision_id of a Posture Template.
+     * PostureTemplate revision_id which needs to be retrieved.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionId_ = 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.securityposture.v1.GetPostureTemplateRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.GetPostureTemplateRequest) + private static final com.google.cloud.securityposture.v1.GetPostureTemplateRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.GetPostureTemplateRequest(); + } + + public static com.google.cloud.securityposture.v1.GetPostureTemplateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPostureTemplateRequest 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.securityposture.v1.GetPostureTemplateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureTemplateRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureTemplateRequestOrBuilder.java new file mode 100644 index 000000000000..61f6f78bc474 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/GetPostureTemplateRequestOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface GetPostureTemplateRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.GetPostureTemplateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the resource.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Specific revision_id of a Posture Template.
+   * PostureTemplate revision_id which needs to be retrieved.
+   * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The revisionId. + */ + java.lang.String getRevisionId(); + /** + * + * + *
+   * Optional. Specific revision_id of a Posture Template.
+   * PostureTemplate revision_id which needs to be retrieved.
+   * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for revisionId. + */ + com.google.protobuf.ByteString getRevisionIdBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsRequest.java new file mode 100644 index 000000000000..50f41d9dff6b --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsRequest.java @@ -0,0 +1,1117 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for requesting list of PostureDeployments.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureDeploymentsRequest} + */ +public final class ListPostureDeploymentsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ListPostureDeploymentsRequest) + ListPostureDeploymentsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPostureDeploymentsRequest.newBuilder() to construct. + private ListPostureDeploymentsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPostureDeploymentsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPostureDeploymentsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest.class, + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListPostureDeploymentsRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent value for ListPostureDeploymentsRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filter to be applied on the resource, defined by EBNF grammar
+   * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filter to be applied on the resource, defined by EBNF grammar
+   * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+   * 
+ * + * 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; + } + } + + 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_); + } + 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_); + } + 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.securityposture.v1.ListPostureDeploymentsRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest other = + (com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest) 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 (!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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest 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.securityposture.v1.ListPostureDeploymentsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest 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.securityposture.v1.ListPostureDeploymentsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest 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.securityposture.v1.ListPostureDeploymentsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest + 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.securityposture.v1.ListPostureDeploymentsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest 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.securityposture.v1.ListPostureDeploymentsRequest 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 PostureDeployments.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureDeploymentsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ListPostureDeploymentsRequest) + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest.class, + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest build() { + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest buildPartial() { + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest result = + new com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest 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_; + } + } + + @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.securityposture.v1.ListPostureDeploymentsRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest other) { + if (other + == com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest.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(); + } + 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListPostureDeploymentsRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListPostureDeploymentsRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListPostureDeploymentsRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListPostureDeploymentsRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListPostureDeploymentsRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * 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; + } + + @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.securityposture.v1.ListPostureDeploymentsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ListPostureDeploymentsRequest) + private static final com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest(); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPostureDeploymentsRequest 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.securityposture.v1.ListPostureDeploymentsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsRequestOrBuilder.java new file mode 100644 index 000000000000..e4a9ae3129b4 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsRequestOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ListPostureDeploymentsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ListPostureDeploymentsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListPostureDeploymentsRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListPostureDeploymentsRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filter to be applied on the resource, defined by EBNF grammar
+   * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filter to be applied on the resource, defined by EBNF grammar
+   * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsResponse.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsResponse.java new file mode 100644 index 000000000000..ae0d51a3950a --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsResponse.java @@ -0,0 +1,1451 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for response to listing PostureDeployments.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureDeploymentsResponse} + */ +public final class ListPostureDeploymentsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ListPostureDeploymentsResponse) + ListPostureDeploymentsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPostureDeploymentsResponse.newBuilder() to construct. + private ListPostureDeploymentsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPostureDeploymentsResponse() { + postureDeployments_ = 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 ListPostureDeploymentsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse.class, + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse.Builder.class); + } + + public static final int POSTURE_DEPLOYMENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List postureDeployments_; + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + @java.lang.Override + public java.util.List + getPostureDeploymentsList() { + return postureDeployments_; + } + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + @java.lang.Override + public java.util.List + getPostureDeploymentsOrBuilderList() { + return postureDeployments_; + } + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + @java.lang.Override + public int getPostureDeploymentsCount() { + return postureDeployments_.size(); + } + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployments(int index) { + return postureDeployments_.get(index); + } + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder + getPostureDeploymentsOrBuilder(int index) { + return postureDeployments_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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 < postureDeployments_.size(); i++) { + output.writeMessage(1, postureDeployments_.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 < postureDeployments_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, postureDeployments_.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.securityposture.v1.ListPostureDeploymentsResponse)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse other = + (com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse) obj; + + if (!getPostureDeploymentsList().equals(other.getPostureDeploymentsList())) 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 (getPostureDeploymentsCount() > 0) { + hash = (37 * hash) + POSTURE_DEPLOYMENTS_FIELD_NUMBER; + hash = (53 * hash) + getPostureDeploymentsList().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.securityposture.v1.ListPostureDeploymentsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse 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.securityposture.v1.ListPostureDeploymentsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse 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.securityposture.v1.ListPostureDeploymentsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse 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.securityposture.v1.ListPostureDeploymentsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse + 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.securityposture.v1.ListPostureDeploymentsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse 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.securityposture.v1.ListPostureDeploymentsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing PostureDeployments.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureDeploymentsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ListPostureDeploymentsResponse) + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse.class, + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (postureDeploymentsBuilder_ == null) { + postureDeployments_ = java.util.Collections.emptyList(); + } else { + postureDeployments_ = null; + postureDeploymentsBuilder_.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.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse build() { + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse buildPartial() { + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse result = + new com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse result) { + if (postureDeploymentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + postureDeployments_ = java.util.Collections.unmodifiableList(postureDeployments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.postureDeployments_ = postureDeployments_; + } else { + result.postureDeployments_ = postureDeploymentsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse 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.securityposture.v1.ListPostureDeploymentsResponse) { + return mergeFrom( + (com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse other) { + if (other + == com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse + .getDefaultInstance()) return this; + if (postureDeploymentsBuilder_ == null) { + if (!other.postureDeployments_.isEmpty()) { + if (postureDeployments_.isEmpty()) { + postureDeployments_ = other.postureDeployments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePostureDeploymentsIsMutable(); + postureDeployments_.addAll(other.postureDeployments_); + } + onChanged(); + } + } else { + if (!other.postureDeployments_.isEmpty()) { + if (postureDeploymentsBuilder_.isEmpty()) { + postureDeploymentsBuilder_.dispose(); + postureDeploymentsBuilder_ = null; + postureDeployments_ = other.postureDeployments_; + bitField0_ = (bitField0_ & ~0x00000001); + postureDeploymentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPostureDeploymentsFieldBuilder() + : null; + } else { + postureDeploymentsBuilder_.addAllMessages(other.postureDeployments_); + } + } + } + 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.securityposture.v1.PostureDeployment m = + input.readMessage( + com.google.cloud.securityposture.v1.PostureDeployment.parser(), + extensionRegistry); + if (postureDeploymentsBuilder_ == null) { + ensurePostureDeploymentsIsMutable(); + postureDeployments_.add(m); + } else { + postureDeploymentsBuilder_.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 + postureDeployments_ = java.util.Collections.emptyList(); + + private void ensurePostureDeploymentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + postureDeployments_ = + new java.util.ArrayList( + postureDeployments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder> + postureDeploymentsBuilder_; + + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public java.util.List + getPostureDeploymentsList() { + if (postureDeploymentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(postureDeployments_); + } else { + return postureDeploymentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public int getPostureDeploymentsCount() { + if (postureDeploymentsBuilder_ == null) { + return postureDeployments_.size(); + } else { + return postureDeploymentsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployments(int index) { + if (postureDeploymentsBuilder_ == null) { + return postureDeployments_.get(index); + } else { + return postureDeploymentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder setPostureDeployments( + int index, com.google.cloud.securityposture.v1.PostureDeployment value) { + if (postureDeploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePostureDeploymentsIsMutable(); + postureDeployments_.set(index, value); + onChanged(); + } else { + postureDeploymentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder setPostureDeployments( + int index, com.google.cloud.securityposture.v1.PostureDeployment.Builder builderForValue) { + if (postureDeploymentsBuilder_ == null) { + ensurePostureDeploymentsIsMutable(); + postureDeployments_.set(index, builderForValue.build()); + onChanged(); + } else { + postureDeploymentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder addPostureDeployments( + com.google.cloud.securityposture.v1.PostureDeployment value) { + if (postureDeploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePostureDeploymentsIsMutable(); + postureDeployments_.add(value); + onChanged(); + } else { + postureDeploymentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder addPostureDeployments( + int index, com.google.cloud.securityposture.v1.PostureDeployment value) { + if (postureDeploymentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePostureDeploymentsIsMutable(); + postureDeployments_.add(index, value); + onChanged(); + } else { + postureDeploymentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder addPostureDeployments( + com.google.cloud.securityposture.v1.PostureDeployment.Builder builderForValue) { + if (postureDeploymentsBuilder_ == null) { + ensurePostureDeploymentsIsMutable(); + postureDeployments_.add(builderForValue.build()); + onChanged(); + } else { + postureDeploymentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder addPostureDeployments( + int index, com.google.cloud.securityposture.v1.PostureDeployment.Builder builderForValue) { + if (postureDeploymentsBuilder_ == null) { + ensurePostureDeploymentsIsMutable(); + postureDeployments_.add(index, builderForValue.build()); + onChanged(); + } else { + postureDeploymentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder addAllPostureDeployments( + java.lang.Iterable + values) { + if (postureDeploymentsBuilder_ == null) { + ensurePostureDeploymentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, postureDeployments_); + onChanged(); + } else { + postureDeploymentsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder clearPostureDeployments() { + if (postureDeploymentsBuilder_ == null) { + postureDeployments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + postureDeploymentsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public Builder removePostureDeployments(int index) { + if (postureDeploymentsBuilder_ == null) { + ensurePostureDeploymentsIsMutable(); + postureDeployments_.remove(index); + onChanged(); + } else { + postureDeploymentsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public com.google.cloud.securityposture.v1.PostureDeployment.Builder + getPostureDeploymentsBuilder(int index) { + return getPostureDeploymentsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder + getPostureDeploymentsOrBuilder(int index) { + if (postureDeploymentsBuilder_ == null) { + return postureDeployments_.get(index); + } else { + return postureDeploymentsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public java.util.List + getPostureDeploymentsOrBuilderList() { + if (postureDeploymentsBuilder_ != null) { + return postureDeploymentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(postureDeployments_); + } + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public com.google.cloud.securityposture.v1.PostureDeployment.Builder + addPostureDeploymentsBuilder() { + return getPostureDeploymentsFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance()); + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public com.google.cloud.securityposture.v1.PostureDeployment.Builder + addPostureDeploymentsBuilder(int index) { + return getPostureDeploymentsFieldBuilder() + .addBuilder( + index, com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance()); + } + /** + * + * + *
+     * The list of PostureDeployment.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + public java.util.List + getPostureDeploymentsBuilderList() { + return getPostureDeploymentsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder> + getPostureDeploymentsFieldBuilder() { + if (postureDeploymentsBuilder_ == null) { + postureDeploymentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder>( + postureDeployments_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + postureDeployments_ = null; + } + return postureDeploymentsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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.securityposture.v1.ListPostureDeploymentsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ListPostureDeploymentsResponse) + private static final com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse(); + } + + public static com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPostureDeploymentsResponse 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.securityposture.v1.ListPostureDeploymentsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsResponseOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsResponseOrBuilder.java new file mode 100644 index 000000000000..981f26ae4a1b --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureDeploymentsResponseOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ListPostureDeploymentsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ListPostureDeploymentsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + java.util.List getPostureDeploymentsList(); + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployments(int index); + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + int getPostureDeploymentsCount(); + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + java.util.List + getPostureDeploymentsOrBuilderList(); + /** + * + * + *
+   * The list of PostureDeployment.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureDeployment posture_deployments = 1; + * + */ + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder getPostureDeploymentsOrBuilder( + int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsRequest.java new file mode 100644 index 000000000000..5a688e6b0e1d --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsRequest.java @@ -0,0 +1,926 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for requesting list of Posture revisions.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureRevisionsRequest} + */ +public final class ListPostureRevisionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ListPostureRevisionsRequest) + ListPostureRevisionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPostureRevisionsRequest.newBuilder() to construct. + private ListPostureRevisionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPostureRevisionsRequest() { + name_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPostureRevisionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest.class, + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name value for ListPostureRevisionsRequest.
+   * 
+ * + * + * 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 value for ListPostureRevisionsRequest.
+   * 
+ * + * + * 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; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick 100 as default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securityposture.v1.ListPostureRevisionsRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest other = + (com.google.cloud.securityposture.v1.ListPostureRevisionsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest 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.securityposture.v1.ListPostureRevisionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest 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.securityposture.v1.ListPostureRevisionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest 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.securityposture.v1.ListPostureRevisionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest 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.securityposture.v1.ListPostureRevisionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest 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.securityposture.v1.ListPostureRevisionsRequest 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 Posture revisions.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureRevisionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ListPostureRevisionsRequest) + com.google.cloud.securityposture.v1.ListPostureRevisionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest.class, + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.ListPostureRevisionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureRevisionsRequest + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ListPostureRevisionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureRevisionsRequest build() { + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureRevisionsRequest buildPartial() { + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest result = + new com.google.cloud.securityposture.v1.ListPostureRevisionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securityposture.v1.ListPostureRevisionsRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.ListPostureRevisionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.ListPostureRevisionsRequest other) { + if (other + == com.google.cloud.securityposture.v1.ListPostureRevisionsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name value for ListPostureRevisionsRequest.
+     * 
+ * + * + * 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 value for ListPostureRevisionsRequest.
+     * 
+ * + * + * 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 value for ListPostureRevisionsRequest.
+     * 
+ * + * + * 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 value for ListPostureRevisionsRequest.
+     * 
+ * + * + * 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 value for ListPostureRevisionsRequest.
+     * 
+ * + * + * 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; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick 100 as default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick 100 as default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick 100 as default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securityposture.v1.ListPostureRevisionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ListPostureRevisionsRequest) + private static final com.google.cloud.securityposture.v1.ListPostureRevisionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ListPostureRevisionsRequest(); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPostureRevisionsRequest 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.securityposture.v1.ListPostureRevisionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsRequestOrBuilder.java new file mode 100644 index 000000000000..c9aaae789ab8 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ListPostureRevisionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ListPostureRevisionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name value for ListPostureRevisionsRequest.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name value for ListPostureRevisionsRequest.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick 100 as default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsResponse.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsResponse.java new file mode 100644 index 000000000000..c3561b950ca7 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsResponse.java @@ -0,0 +1,1128 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for response to listing PostureRevisions.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureRevisionsResponse} + */ +public final class ListPostureRevisionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ListPostureRevisionsResponse) + ListPostureRevisionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPostureRevisionsResponse.newBuilder() to construct. + private ListPostureRevisionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPostureRevisionsResponse() { + revisions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPostureRevisionsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse.class, + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse.Builder.class); + } + + public static final int REVISIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List revisions_; + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + @java.lang.Override + public java.util.List getRevisionsList() { + return revisions_; + } + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + @java.lang.Override + public java.util.List + getRevisionsOrBuilderList() { + return revisions_; + } + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + @java.lang.Override + public int getRevisionsCount() { + return revisions_.size(); + } + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture getRevisions(int index) { + return revisions_.get(index); + } + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureOrBuilder getRevisionsOrBuilder(int index) { + return revisions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < revisions_.size(); i++) { + output.writeMessage(1, revisions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < revisions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, revisions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securityposture.v1.ListPostureRevisionsResponse)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse other = + (com.google.cloud.securityposture.v1.ListPostureRevisionsResponse) obj; + + if (!getRevisionsList().equals(other.getRevisionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRevisionsCount() > 0) { + hash = (37 * hash) + REVISIONS_FIELD_NUMBER; + hash = (53 * hash) + getRevisionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse 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.securityposture.v1.ListPostureRevisionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse 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.securityposture.v1.ListPostureRevisionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse 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.securityposture.v1.ListPostureRevisionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse 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.securityposture.v1.ListPostureRevisionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse 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.securityposture.v1.ListPostureRevisionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing PostureRevisions.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureRevisionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ListPostureRevisionsResponse) + com.google.cloud.securityposture.v1.ListPostureRevisionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse.class, + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.ListPostureRevisionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (revisionsBuilder_ == null) { + revisions_ = java.util.Collections.emptyList(); + } else { + revisions_ = null; + revisionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureRevisionsResponse + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ListPostureRevisionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureRevisionsResponse build() { + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureRevisionsResponse buildPartial() { + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse result = + new com.google.cloud.securityposture.v1.ListPostureRevisionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse result) { + if (revisionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + revisions_ = java.util.Collections.unmodifiableList(revisions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.revisions_ = revisions_; + } else { + result.revisions_ = revisionsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securityposture.v1.ListPostureRevisionsResponse) { + return mergeFrom((com.google.cloud.securityposture.v1.ListPostureRevisionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.ListPostureRevisionsResponse other) { + if (other + == com.google.cloud.securityposture.v1.ListPostureRevisionsResponse.getDefaultInstance()) + return this; + if (revisionsBuilder_ == null) { + if (!other.revisions_.isEmpty()) { + if (revisions_.isEmpty()) { + revisions_ = other.revisions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRevisionsIsMutable(); + revisions_.addAll(other.revisions_); + } + onChanged(); + } + } else { + if (!other.revisions_.isEmpty()) { + if (revisionsBuilder_.isEmpty()) { + revisionsBuilder_.dispose(); + revisionsBuilder_ = null; + revisions_ = other.revisions_; + bitField0_ = (bitField0_ & ~0x00000001); + revisionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRevisionsFieldBuilder() + : null; + } else { + revisionsBuilder_.addAllMessages(other.revisions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securityposture.v1.Posture m = + input.readMessage( + com.google.cloud.securityposture.v1.Posture.parser(), extensionRegistry); + if (revisionsBuilder_ == null) { + ensureRevisionsIsMutable(); + revisions_.add(m); + } else { + revisionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List revisions_ = + java.util.Collections.emptyList(); + + private void ensureRevisionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + revisions_ = + new java.util.ArrayList(revisions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder> + revisionsBuilder_; + + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public java.util.List getRevisionsList() { + if (revisionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(revisions_); + } else { + return revisionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public int getRevisionsCount() { + if (revisionsBuilder_ == null) { + return revisions_.size(); + } else { + return revisionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public com.google.cloud.securityposture.v1.Posture getRevisions(int index) { + if (revisionsBuilder_ == null) { + return revisions_.get(index); + } else { + return revisionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder setRevisions(int index, com.google.cloud.securityposture.v1.Posture value) { + if (revisionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRevisionsIsMutable(); + revisions_.set(index, value); + onChanged(); + } else { + revisionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder setRevisions( + int index, com.google.cloud.securityposture.v1.Posture.Builder builderForValue) { + if (revisionsBuilder_ == null) { + ensureRevisionsIsMutable(); + revisions_.set(index, builderForValue.build()); + onChanged(); + } else { + revisionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder addRevisions(com.google.cloud.securityposture.v1.Posture value) { + if (revisionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRevisionsIsMutable(); + revisions_.add(value); + onChanged(); + } else { + revisionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder addRevisions(int index, com.google.cloud.securityposture.v1.Posture value) { + if (revisionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRevisionsIsMutable(); + revisions_.add(index, value); + onChanged(); + } else { + revisionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder addRevisions( + com.google.cloud.securityposture.v1.Posture.Builder builderForValue) { + if (revisionsBuilder_ == null) { + ensureRevisionsIsMutable(); + revisions_.add(builderForValue.build()); + onChanged(); + } else { + revisionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder addRevisions( + int index, com.google.cloud.securityposture.v1.Posture.Builder builderForValue) { + if (revisionsBuilder_ == null) { + ensureRevisionsIsMutable(); + revisions_.add(index, builderForValue.build()); + onChanged(); + } else { + revisionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder addAllRevisions( + java.lang.Iterable values) { + if (revisionsBuilder_ == null) { + ensureRevisionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, revisions_); + onChanged(); + } else { + revisionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder clearRevisions() { + if (revisionsBuilder_ == null) { + revisions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + revisionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public Builder removeRevisions(int index) { + if (revisionsBuilder_ == null) { + ensureRevisionsIsMutable(); + revisions_.remove(index); + onChanged(); + } else { + revisionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public com.google.cloud.securityposture.v1.Posture.Builder getRevisionsBuilder(int index) { + return getRevisionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public com.google.cloud.securityposture.v1.PostureOrBuilder getRevisionsOrBuilder(int index) { + if (revisionsBuilder_ == null) { + return revisions_.get(index); + } else { + return revisionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public java.util.List + getRevisionsOrBuilderList() { + if (revisionsBuilder_ != null) { + return revisionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(revisions_); + } + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public com.google.cloud.securityposture.v1.Posture.Builder addRevisionsBuilder() { + return getRevisionsFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.Posture.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public com.google.cloud.securityposture.v1.Posture.Builder addRevisionsBuilder(int index) { + return getRevisionsFieldBuilder() + .addBuilder(index, com.google.cloud.securityposture.v1.Posture.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Posture revisions.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + public java.util.List + getRevisionsBuilderList() { + return getRevisionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder> + getRevisionsFieldBuilder() { + if (revisionsBuilder_ == null) { + revisionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder>( + revisions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + revisions_ = null; + } + return revisionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securityposture.v1.ListPostureRevisionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ListPostureRevisionsResponse) + private static final com.google.cloud.securityposture.v1.ListPostureRevisionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ListPostureRevisionsResponse(); + } + + public static com.google.cloud.securityposture.v1.ListPostureRevisionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPostureRevisionsResponse 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.securityposture.v1.ListPostureRevisionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsResponseOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsResponseOrBuilder.java new file mode 100644 index 000000000000..1eb3f49cd0c2 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureRevisionsResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ListPostureRevisionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ListPostureRevisionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + java.util.List getRevisionsList(); + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + com.google.cloud.securityposture.v1.Posture getRevisions(int index); + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + int getRevisionsCount(); + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + java.util.List + getRevisionsOrBuilderList(); + /** + * + * + *
+   * The list of Posture revisions.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture revisions = 1; + */ + com.google.cloud.securityposture.v1.PostureOrBuilder getRevisionsOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesRequest.java new file mode 100644 index 000000000000..037144aea8fb --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesRequest.java @@ -0,0 +1,1115 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for requesting list of Posture Templates.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureTemplatesRequest} + */ +public final class ListPostureTemplatesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ListPostureTemplatesRequest) + ListPostureTemplatesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPostureTemplatesRequest.newBuilder() to construct. + private ListPostureTemplatesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPostureTemplatesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPostureTemplatesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest.class, + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListPostureTemplatesRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent value for ListPostureTemplatesRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Filter to be applied on the resource, defined by EBNF grammar
+   * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filter to be applied on the resource, defined by EBNF grammar
+   * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+   * 
+ * + * 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; + } + } + + 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_); + } + 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_); + } + 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.securityposture.v1.ListPostureTemplatesRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest other = + (com.google.cloud.securityposture.v1.ListPostureTemplatesRequest) 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 (!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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest 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.securityposture.v1.ListPostureTemplatesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest 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.securityposture.v1.ListPostureTemplatesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest 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.securityposture.v1.ListPostureTemplatesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest 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.securityposture.v1.ListPostureTemplatesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest 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.securityposture.v1.ListPostureTemplatesRequest 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 Posture Templates.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureTemplatesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ListPostureTemplatesRequest) + com.google.cloud.securityposture.v1.ListPostureTemplatesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest.class, + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.ListPostureTemplatesRequest.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureTemplatesRequest + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ListPostureTemplatesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureTemplatesRequest build() { + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureTemplatesRequest buildPartial() { + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest result = + new com.google.cloud.securityposture.v1.ListPostureTemplatesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest 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_; + } + } + + @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.securityposture.v1.ListPostureTemplatesRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.ListPostureTemplatesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.ListPostureTemplatesRequest other) { + if (other + == com.google.cloud.securityposture.v1.ListPostureTemplatesRequest.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(); + } + 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListPostureTemplatesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListPostureTemplatesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListPostureTemplatesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListPostureTemplatesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListPostureTemplatesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter to be applied on the resource, defined by EBNF grammar
+     * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+     * 
+ * + * 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; + } + + @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.securityposture.v1.ListPostureTemplatesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ListPostureTemplatesRequest) + private static final com.google.cloud.securityposture.v1.ListPostureTemplatesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ListPostureTemplatesRequest(); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPostureTemplatesRequest 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.securityposture.v1.ListPostureTemplatesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesRequestOrBuilder.java new file mode 100644 index 000000000000..8184d41f4b2c --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesRequestOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ListPostureTemplatesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ListPostureTemplatesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListPostureTemplatesRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListPostureTemplatesRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filter to be applied on the resource, defined by EBNF grammar
+   * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Filter to be applied on the resource, defined by EBNF grammar
+   * https://google.aip.dev/assets/misc/ebnf-filtering.txt.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesResponse.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesResponse.java new file mode 100644 index 000000000000..76001dff37a3 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesResponse.java @@ -0,0 +1,1143 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for response to listing PostureTemplates.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureTemplatesResponse} + */ +public final class ListPostureTemplatesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ListPostureTemplatesResponse) + ListPostureTemplatesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPostureTemplatesResponse.newBuilder() to construct. + private ListPostureTemplatesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPostureTemplatesResponse() { + postureTemplates_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPostureTemplatesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse.class, + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse.Builder.class); + } + + public static final int POSTURE_TEMPLATES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List postureTemplates_; + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + @java.lang.Override + public java.util.List + getPostureTemplatesList() { + return postureTemplates_; + } + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + @java.lang.Override + public java.util.List + getPostureTemplatesOrBuilderList() { + return postureTemplates_; + } + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + @java.lang.Override + public int getPostureTemplatesCount() { + return postureTemplates_.size(); + } + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureTemplate getPostureTemplates(int index) { + return postureTemplates_.get(index); + } + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureTemplateOrBuilder getPostureTemplatesOrBuilder( + int index) { + return postureTemplates_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < postureTemplates_.size(); i++) { + output.writeMessage(1, postureTemplates_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < postureTemplates_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, postureTemplates_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securityposture.v1.ListPostureTemplatesResponse)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse other = + (com.google.cloud.securityposture.v1.ListPostureTemplatesResponse) obj; + + if (!getPostureTemplatesList().equals(other.getPostureTemplatesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPostureTemplatesCount() > 0) { + hash = (37 * hash) + POSTURE_TEMPLATES_FIELD_NUMBER; + hash = (53 * hash) + getPostureTemplatesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse 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.securityposture.v1.ListPostureTemplatesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse 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.securityposture.v1.ListPostureTemplatesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse 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.securityposture.v1.ListPostureTemplatesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse 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.securityposture.v1.ListPostureTemplatesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse 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.securityposture.v1.ListPostureTemplatesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing PostureTemplates.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPostureTemplatesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ListPostureTemplatesResponse) + com.google.cloud.securityposture.v1.ListPostureTemplatesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse.class, + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.ListPostureTemplatesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (postureTemplatesBuilder_ == null) { + postureTemplates_ = java.util.Collections.emptyList(); + } else { + postureTemplates_ = null; + postureTemplatesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureTemplatesResponse + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ListPostureTemplatesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureTemplatesResponse build() { + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPostureTemplatesResponse buildPartial() { + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse result = + new com.google.cloud.securityposture.v1.ListPostureTemplatesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse result) { + if (postureTemplatesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + postureTemplates_ = java.util.Collections.unmodifiableList(postureTemplates_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.postureTemplates_ = postureTemplates_; + } else { + result.postureTemplates_ = postureTemplatesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securityposture.v1.ListPostureTemplatesResponse) { + return mergeFrom((com.google.cloud.securityposture.v1.ListPostureTemplatesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.ListPostureTemplatesResponse other) { + if (other + == com.google.cloud.securityposture.v1.ListPostureTemplatesResponse.getDefaultInstance()) + return this; + if (postureTemplatesBuilder_ == null) { + if (!other.postureTemplates_.isEmpty()) { + if (postureTemplates_.isEmpty()) { + postureTemplates_ = other.postureTemplates_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePostureTemplatesIsMutable(); + postureTemplates_.addAll(other.postureTemplates_); + } + onChanged(); + } + } else { + if (!other.postureTemplates_.isEmpty()) { + if (postureTemplatesBuilder_.isEmpty()) { + postureTemplatesBuilder_.dispose(); + postureTemplatesBuilder_ = null; + postureTemplates_ = other.postureTemplates_; + bitField0_ = (bitField0_ & ~0x00000001); + postureTemplatesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPostureTemplatesFieldBuilder() + : null; + } else { + postureTemplatesBuilder_.addAllMessages(other.postureTemplates_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.securityposture.v1.PostureTemplate m = + input.readMessage( + com.google.cloud.securityposture.v1.PostureTemplate.parser(), + extensionRegistry); + if (postureTemplatesBuilder_ == null) { + ensurePostureTemplatesIsMutable(); + postureTemplates_.add(m); + } else { + postureTemplatesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List postureTemplates_ = + java.util.Collections.emptyList(); + + private void ensurePostureTemplatesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + postureTemplates_ = + new java.util.ArrayList( + postureTemplates_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureTemplate, + com.google.cloud.securityposture.v1.PostureTemplate.Builder, + com.google.cloud.securityposture.v1.PostureTemplateOrBuilder> + postureTemplatesBuilder_; + + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public java.util.List + getPostureTemplatesList() { + if (postureTemplatesBuilder_ == null) { + return java.util.Collections.unmodifiableList(postureTemplates_); + } else { + return postureTemplatesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public int getPostureTemplatesCount() { + if (postureTemplatesBuilder_ == null) { + return postureTemplates_.size(); + } else { + return postureTemplatesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public com.google.cloud.securityposture.v1.PostureTemplate getPostureTemplates(int index) { + if (postureTemplatesBuilder_ == null) { + return postureTemplates_.get(index); + } else { + return postureTemplatesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder setPostureTemplates( + int index, com.google.cloud.securityposture.v1.PostureTemplate value) { + if (postureTemplatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePostureTemplatesIsMutable(); + postureTemplates_.set(index, value); + onChanged(); + } else { + postureTemplatesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder setPostureTemplates( + int index, com.google.cloud.securityposture.v1.PostureTemplate.Builder builderForValue) { + if (postureTemplatesBuilder_ == null) { + ensurePostureTemplatesIsMutable(); + postureTemplates_.set(index, builderForValue.build()); + onChanged(); + } else { + postureTemplatesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder addPostureTemplates(com.google.cloud.securityposture.v1.PostureTemplate value) { + if (postureTemplatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePostureTemplatesIsMutable(); + postureTemplates_.add(value); + onChanged(); + } else { + postureTemplatesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder addPostureTemplates( + int index, com.google.cloud.securityposture.v1.PostureTemplate value) { + if (postureTemplatesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePostureTemplatesIsMutable(); + postureTemplates_.add(index, value); + onChanged(); + } else { + postureTemplatesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder addPostureTemplates( + com.google.cloud.securityposture.v1.PostureTemplate.Builder builderForValue) { + if (postureTemplatesBuilder_ == null) { + ensurePostureTemplatesIsMutable(); + postureTemplates_.add(builderForValue.build()); + onChanged(); + } else { + postureTemplatesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder addPostureTemplates( + int index, com.google.cloud.securityposture.v1.PostureTemplate.Builder builderForValue) { + if (postureTemplatesBuilder_ == null) { + ensurePostureTemplatesIsMutable(); + postureTemplates_.add(index, builderForValue.build()); + onChanged(); + } else { + postureTemplatesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder addAllPostureTemplates( + java.lang.Iterable values) { + if (postureTemplatesBuilder_ == null) { + ensurePostureTemplatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, postureTemplates_); + onChanged(); + } else { + postureTemplatesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder clearPostureTemplates() { + if (postureTemplatesBuilder_ == null) { + postureTemplates_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + postureTemplatesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public Builder removePostureTemplates(int index) { + if (postureTemplatesBuilder_ == null) { + ensurePostureTemplatesIsMutable(); + postureTemplates_.remove(index); + onChanged(); + } else { + postureTemplatesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public com.google.cloud.securityposture.v1.PostureTemplate.Builder getPostureTemplatesBuilder( + int index) { + return getPostureTemplatesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public com.google.cloud.securityposture.v1.PostureTemplateOrBuilder + getPostureTemplatesOrBuilder(int index) { + if (postureTemplatesBuilder_ == null) { + return postureTemplates_.get(index); + } else { + return postureTemplatesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public java.util.List + getPostureTemplatesOrBuilderList() { + if (postureTemplatesBuilder_ != null) { + return postureTemplatesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(postureTemplates_); + } + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public com.google.cloud.securityposture.v1.PostureTemplate.Builder + addPostureTemplatesBuilder() { + return getPostureTemplatesFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.PostureTemplate.getDefaultInstance()); + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public com.google.cloud.securityposture.v1.PostureTemplate.Builder addPostureTemplatesBuilder( + int index) { + return getPostureTemplatesFieldBuilder() + .addBuilder( + index, com.google.cloud.securityposture.v1.PostureTemplate.getDefaultInstance()); + } + /** + * + * + *
+     * The list of PostureTemplate.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + public java.util.List + getPostureTemplatesBuilderList() { + return getPostureTemplatesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureTemplate, + com.google.cloud.securityposture.v1.PostureTemplate.Builder, + com.google.cloud.securityposture.v1.PostureTemplateOrBuilder> + getPostureTemplatesFieldBuilder() { + if (postureTemplatesBuilder_ == null) { + postureTemplatesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureTemplate, + com.google.cloud.securityposture.v1.PostureTemplate.Builder, + com.google.cloud.securityposture.v1.PostureTemplateOrBuilder>( + postureTemplates_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + postureTemplates_ = null; + } + return postureTemplatesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securityposture.v1.ListPostureTemplatesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ListPostureTemplatesResponse) + private static final com.google.cloud.securityposture.v1.ListPostureTemplatesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ListPostureTemplatesResponse(); + } + + public static com.google.cloud.securityposture.v1.ListPostureTemplatesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPostureTemplatesResponse 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.securityposture.v1.ListPostureTemplatesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesResponseOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesResponseOrBuilder.java new file mode 100644 index 000000000000..bbfab36c2dde --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPostureTemplatesResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ListPostureTemplatesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ListPostureTemplatesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + java.util.List getPostureTemplatesList(); + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + com.google.cloud.securityposture.v1.PostureTemplate getPostureTemplates(int index); + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + int getPostureTemplatesCount(); + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + java.util.List + getPostureTemplatesOrBuilderList(); + /** + * + * + *
+   * The list of PostureTemplate.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.PostureTemplate posture_templates = 1; + */ + com.google.cloud.securityposture.v1.PostureTemplateOrBuilder getPostureTemplatesOrBuilder( + int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesRequest.java new file mode 100644 index 000000000000..13a916affa49 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesRequest.java @@ -0,0 +1,919 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for requesting list of Postures.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPosturesRequest} + */ +public final class ListPosturesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ListPosturesRequest) + ListPosturesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPosturesRequest.newBuilder() to construct. + private ListPosturesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPosturesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListPosturesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPosturesRequest.class, + com.google.cloud.securityposture.v1.ListPosturesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Parent value for ListPosturesRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Parent value for ListPosturesRequest.
+   * 
+ * + * + * 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; + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * 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 token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.securityposture.v1.ListPosturesRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ListPosturesRequest other = + (com.google.cloud.securityposture.v1.ListPosturesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest 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.securityposture.v1.ListPosturesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest 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.securityposture.v1.ListPosturesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest 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.securityposture.v1.ListPosturesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest 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.securityposture.v1.ListPosturesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest 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.securityposture.v1.ListPosturesRequest 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 Postures.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPosturesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ListPosturesRequest) + com.google.cloud.securityposture.v1.ListPosturesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPosturesRequest.class, + com.google.cloud.securityposture.v1.ListPosturesRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.ListPosturesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPosturesRequest getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ListPosturesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPosturesRequest build() { + com.google.cloud.securityposture.v1.ListPosturesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPosturesRequest buildPartial() { + com.google.cloud.securityposture.v1.ListPosturesRequest result = + new com.google.cloud.securityposture.v1.ListPosturesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.ListPosturesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securityposture.v1.ListPosturesRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.ListPosturesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.ListPosturesRequest other) { + if (other == com.google.cloud.securityposture.v1.ListPosturesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Parent value for ListPosturesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListPosturesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Parent value for ListPosturesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListPosturesRequest.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Parent value for ListPosturesRequest.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Requested page size. Server may return fewer items than requested.
+     * If unspecified, server will pick an appropriate default.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * 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 token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securityposture.v1.ListPosturesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ListPosturesRequest) + private static final com.google.cloud.securityposture.v1.ListPosturesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ListPosturesRequest(); + } + + public static com.google.cloud.securityposture.v1.ListPosturesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPosturesRequest 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.securityposture.v1.ListPosturesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesRequestOrBuilder.java new file mode 100644 index 000000000000..43b139097767 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ListPosturesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ListPosturesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Parent value for ListPosturesRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Parent value for ListPosturesRequest.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Requested page size. Server may return fewer items than requested.
+   * If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesResponse.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesResponse.java new file mode 100644 index 000000000000..3c05efa2b434 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesResponse.java @@ -0,0 +1,1397 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for response to listing Postures.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPosturesResponse} + */ +public final class ListPosturesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.ListPosturesResponse) + ListPosturesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListPosturesResponse.newBuilder() to construct. + private ListPosturesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListPosturesResponse() { + postures_ = 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 ListPosturesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPosturesResponse.class, + com.google.cloud.securityposture.v1.ListPosturesResponse.Builder.class); + } + + public static final int POSTURES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List postures_; + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + @java.lang.Override + public java.util.List getPosturesList() { + return postures_; + } + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + @java.lang.Override + public java.util.List + getPosturesOrBuilderList() { + return postures_; + } + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + @java.lang.Override + public int getPosturesCount() { + return postures_.size(); + } + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture getPostures(int index) { + return postures_.get(index); + } + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureOrBuilder getPosturesOrBuilder(int index) { + return postures_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * 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 identifying a page of results the server should return.
+   * 
+ * + * 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(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * 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); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * 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 < postures_.size(); i++) { + output.writeMessage(1, postures_.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 < postures_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, postures_.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.securityposture.v1.ListPosturesResponse)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.ListPosturesResponse other = + (com.google.cloud.securityposture.v1.ListPosturesResponse) obj; + + if (!getPosturesList().equals(other.getPosturesList())) 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 (getPosturesCount() > 0) { + hash = (37 * hash) + POSTURES_FIELD_NUMBER; + hash = (53 * hash) + getPosturesList().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.securityposture.v1.ListPosturesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPosturesResponse 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.securityposture.v1.ListPosturesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPosturesResponse 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.securityposture.v1.ListPosturesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.ListPosturesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.ListPosturesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPosturesResponse 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.securityposture.v1.ListPosturesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPosturesResponse 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.securityposture.v1.ListPosturesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.ListPosturesResponse 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.securityposture.v1.ListPosturesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for response to listing Postures.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.ListPosturesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.ListPosturesResponse) + com.google.cloud.securityposture.v1.ListPosturesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.ListPosturesResponse.class, + com.google.cloud.securityposture.v1.ListPosturesResponse.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.ListPosturesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (posturesBuilder_ == null) { + postures_ = java.util.Collections.emptyList(); + } else { + postures_ = null; + posturesBuilder_.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.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_ListPosturesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPosturesResponse getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.ListPosturesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPosturesResponse build() { + com.google.cloud.securityposture.v1.ListPosturesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.ListPosturesResponse buildPartial() { + com.google.cloud.securityposture.v1.ListPosturesResponse result = + new com.google.cloud.securityposture.v1.ListPosturesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.ListPosturesResponse result) { + if (posturesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + postures_ = java.util.Collections.unmodifiableList(postures_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.postures_ = postures_; + } else { + result.postures_ = posturesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securityposture.v1.ListPosturesResponse 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.securityposture.v1.ListPosturesResponse) { + return mergeFrom((com.google.cloud.securityposture.v1.ListPosturesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.ListPosturesResponse other) { + if (other == com.google.cloud.securityposture.v1.ListPosturesResponse.getDefaultInstance()) + return this; + if (posturesBuilder_ == null) { + if (!other.postures_.isEmpty()) { + if (postures_.isEmpty()) { + postures_ = other.postures_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePosturesIsMutable(); + postures_.addAll(other.postures_); + } + onChanged(); + } + } else { + if (!other.postures_.isEmpty()) { + if (posturesBuilder_.isEmpty()) { + posturesBuilder_.dispose(); + posturesBuilder_ = null; + postures_ = other.postures_; + bitField0_ = (bitField0_ & ~0x00000001); + posturesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPosturesFieldBuilder() + : null; + } else { + posturesBuilder_.addAllMessages(other.postures_); + } + } + } + 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.securityposture.v1.Posture m = + input.readMessage( + com.google.cloud.securityposture.v1.Posture.parser(), extensionRegistry); + if (posturesBuilder_ == null) { + ensurePosturesIsMutable(); + postures_.add(m); + } else { + posturesBuilder_.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 postures_ = + java.util.Collections.emptyList(); + + private void ensurePosturesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + postures_ = new java.util.ArrayList(postures_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder> + posturesBuilder_; + + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public java.util.List getPosturesList() { + if (posturesBuilder_ == null) { + return java.util.Collections.unmodifiableList(postures_); + } else { + return posturesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public int getPosturesCount() { + if (posturesBuilder_ == null) { + return postures_.size(); + } else { + return posturesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public com.google.cloud.securityposture.v1.Posture getPostures(int index) { + if (posturesBuilder_ == null) { + return postures_.get(index); + } else { + return posturesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder setPostures(int index, com.google.cloud.securityposture.v1.Posture value) { + if (posturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePosturesIsMutable(); + postures_.set(index, value); + onChanged(); + } else { + posturesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder setPostures( + int index, com.google.cloud.securityposture.v1.Posture.Builder builderForValue) { + if (posturesBuilder_ == null) { + ensurePosturesIsMutable(); + postures_.set(index, builderForValue.build()); + onChanged(); + } else { + posturesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder addPostures(com.google.cloud.securityposture.v1.Posture value) { + if (posturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePosturesIsMutable(); + postures_.add(value); + onChanged(); + } else { + posturesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder addPostures(int index, com.google.cloud.securityposture.v1.Posture value) { + if (posturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePosturesIsMutable(); + postures_.add(index, value); + onChanged(); + } else { + posturesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder addPostures( + com.google.cloud.securityposture.v1.Posture.Builder builderForValue) { + if (posturesBuilder_ == null) { + ensurePosturesIsMutable(); + postures_.add(builderForValue.build()); + onChanged(); + } else { + posturesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder addPostures( + int index, com.google.cloud.securityposture.v1.Posture.Builder builderForValue) { + if (posturesBuilder_ == null) { + ensurePosturesIsMutable(); + postures_.add(index, builderForValue.build()); + onChanged(); + } else { + posturesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder addAllPostures( + java.lang.Iterable values) { + if (posturesBuilder_ == null) { + ensurePosturesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, postures_); + onChanged(); + } else { + posturesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder clearPostures() { + if (posturesBuilder_ == null) { + postures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + posturesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public Builder removePostures(int index) { + if (posturesBuilder_ == null) { + ensurePosturesIsMutable(); + postures_.remove(index); + onChanged(); + } else { + posturesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public com.google.cloud.securityposture.v1.Posture.Builder getPosturesBuilder(int index) { + return getPosturesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public com.google.cloud.securityposture.v1.PostureOrBuilder getPosturesOrBuilder(int index) { + if (posturesBuilder_ == null) { + return postures_.get(index); + } else { + return posturesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public java.util.List + getPosturesOrBuilderList() { + if (posturesBuilder_ != null) { + return posturesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(postures_); + } + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public com.google.cloud.securityposture.v1.Posture.Builder addPosturesBuilder() { + return getPosturesFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.Posture.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public com.google.cloud.securityposture.v1.Posture.Builder addPosturesBuilder(int index) { + return getPosturesFieldBuilder() + .addBuilder(index, com.google.cloud.securityposture.v1.Posture.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Posture.
+     * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + public java.util.List + getPosturesBuilderList() { + return getPosturesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder> + getPosturesFieldBuilder() { + if (posturesBuilder_ == null) { + posturesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder>( + postures_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + postures_ = null; + } + return posturesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * 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 identifying a page of results the server should return.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results the server should return.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * 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); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * 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); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * 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.securityposture.v1.ListPosturesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.ListPosturesResponse) + private static final com.google.cloud.securityposture.v1.ListPosturesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.ListPosturesResponse(); + } + + public static com.google.cloud.securityposture.v1.ListPosturesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPosturesResponse 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.securityposture.v1.ListPosturesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesResponseOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesResponseOrBuilder.java new file mode 100644 index 000000000000..97ef48b61b33 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ListPosturesResponseOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface ListPosturesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.ListPosturesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + java.util.List getPosturesList(); + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + com.google.cloud.securityposture.v1.Posture getPostures(int index); + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + int getPosturesCount(); + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + java.util.List + getPosturesOrBuilderList(); + /** + * + * + *
+   * The list of Posture.
+   * 
+ * + * repeated .google.cloud.securityposture.v1.Posture postures = 1; + */ + com.google.cloud.securityposture.v1.PostureOrBuilder getPosturesOrBuilder(int index); + + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token identifying a page of results the server should return.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * 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); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * 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-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OperationMetadata.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OperationMetadata.java new file mode 100644 index 000000000000..5267464e8a3a --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OperationMetadata.java @@ -0,0 +1,2045 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.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_ = ""; + errorMessage_ = ""; + } + + @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.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.OperationMetadata.class, + com.google.cloud.securityposture.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; + } + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled only
+   * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+   * or CREATE_FAILED or DELETE_FAILED.
+   * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled only
+   * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+   * or CREATE_FAILED or DELETE_FAILED.
+   * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 (((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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, errorMessage_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, 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.securityposture.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.OperationMetadata other = + (com.google.cloud.securityposture.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 (!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(); + 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 = (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.securityposture.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.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.securityposture.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.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.securityposture.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.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.securityposture.v1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.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.securityposture.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.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.securityposture.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.securityposture.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.securityposture.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.securityposture.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.OperationMetadata) + com.google.cloud.securityposture.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.OperationMetadata.class, + com.google.cloud.securityposture.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.securityposture.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_ = ""; + errorMessage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OperationMetadata build() { + com.google.cloud.securityposture.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OperationMetadata buildPartial() { + com.google.cloud.securityposture.v1.OperationMetadata result = + new com.google.cloud.securityposture.v1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.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_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.errorMessage_ = errorMessage_; + } + 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.securityposture.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.securityposture.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.OperationMetadata other) { + if (other == com.google.cloud.securityposture.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(); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + bitField0_ |= 0x00000080; + 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 + case 66: + { + errorMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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; + } + + private java.lang.Object errorMessage_ = ""; + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled only
+     * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+     * or CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled only
+     * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+     * or CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled only
+     * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+     * or CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled only
+     * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+     * or CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled only
+     * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+     * or CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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_ |= 0x00000080; + 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.securityposture.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.OperationMetadata) + private static final com.google.cloud.securityposture.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.OperationMetadata(); + } + + public static com.google.cloud.securityposture.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.securityposture.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OperationMetadataOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..6a5dad89dc0b --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,248 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.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(); + + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled only
+   * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+   * or CREATE_FAILED or DELETE_FAILED.
+   * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled only
+   * in cases where PostureDeployments enter failure states like UPDATE_FAILED
+   * or CREATE_FAILED or DELETE_FAILED.
+   * 
+ * + * string error_message = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConfigProto.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConfigProto.java new file mode 100644 index 000000000000..8868201e94a1 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConfigProto.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/securityposture/v1/org_policy_config.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public final class OrgPolicyConfigProto { + private OrgPolicyConfigProto() {} + + 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_securityposture_v1_PolicyRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_PolicyRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_CustomConstraint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_CustomConstraint_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/securityposture/v1/org_po" + + "licy_config.proto\022\037google.cloud.security" + + "posture.v1\032\037google/api/field_behavior.pr" + + "oto\032\037google/protobuf/timestamp.proto\032\026go" + + "ogle/type/expr.proto\"\201\002\n\nPolicyRule\022J\n\006v" + + "alues\030\001 \001(\01328.google.cloud.securitypostu" + + "re.v1.PolicyRule.StringValuesH\000\022\023\n\tallow" + + "_all\030\002 \001(\010H\000\022\022\n\010deny_all\030\003 \001(\010H\000\022\021\n\007enfo" + + "rce\030\004 \001(\010H\000\022$\n\tcondition\030\005 \001(\0132\021.google." + + "type.Expr\032=\n\014StringValues\022\026\n\016allowed_val" + + "ues\030\001 \003(\t\022\025\n\rdenied_values\030\002 \003(\tB\006\n\004kind" + + "\"\354\003\n\020CustomConstraint\022\021\n\004name\030\001 \001(\tB\003\340A\005" + + "\022\033\n\016resource_types\030\002 \003(\tB\003\340A\005\022R\n\014method_" + + "types\030\003 \003(\0162<.google.cloud.securitypostu" + + "re.v1.CustomConstraint.MethodType\022\021\n\tcon" + + "dition\030\004 \001(\t\022Q\n\013action_type\030\005 \001(\0162<.goog" + + "le.cloud.securityposture.v1.CustomConstr" + + "aint.ActionType\022\024\n\014display_name\030\006 \001(\t\022\023\n" + + "\013description\030\007 \001(\t\0224\n\013update_time\030\010 \001(\0132" + + "\032.google.protobuf.TimestampB\003\340A\003\"M\n\nMeth" + + "odType\022\033\n\027METHOD_TYPE_UNSPECIFIED\020\000\022\n\n\006C" + + "REATE\020\001\022\n\n\006UPDATE\020\002\022\n\n\006DELETE\020\003\">\n\nActio" + + "nType\022\033\n\027ACTION_TYPE_UNSPECIFIED\020\000\022\t\n\005AL" + + "LOW\020\001\022\010\n\004DENY\020\002B\214\001\n#com.google.cloud.sec" + + "urityposture.v1B\024OrgPolicyConfigProtoP\001Z" + + "Mcloud.google.com/go/securityposture/api" + + "v1/securityposturepb;securityposturepbb\006" + + "proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.ExprProto.getDescriptor(), + }); + internal_static_google_cloud_securityposture_v1_PolicyRule_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securityposture_v1_PolicyRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_PolicyRule_descriptor, + new java.lang.String[] { + "Values", "AllowAll", "DenyAll", "Enforce", "Condition", "Kind", + }); + internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_descriptor = + internal_static_google_cloud_securityposture_v1_PolicyRule_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_descriptor, + new java.lang.String[] { + "AllowedValues", "DeniedValues", + }); + internal_static_google_cloud_securityposture_v1_CustomConstraint_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_securityposture_v1_CustomConstraint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_CustomConstraint_descriptor, + new java.lang.String[] { + "Name", + "ResourceTypes", + "MethodTypes", + "Condition", + "ActionType", + "DisplayName", + "Description", + "UpdateTime", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.ExprProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraint.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraint.java new file mode 100644 index 000000000000..46d0d7c9b324 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraint.java @@ -0,0 +1,1169 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/org_policy_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for Org Policy Canned Constraint.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.OrgPolicyConstraint} + */ +public final class OrgPolicyConstraint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.OrgPolicyConstraint) + OrgPolicyConstraintOrBuilder { + private static final long serialVersionUID = 0L; + // Use OrgPolicyConstraint.newBuilder() to construct. + private OrgPolicyConstraint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OrgPolicyConstraint() { + cannedConstraintId_ = ""; + policyRules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OrgPolicyConstraint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.OrgPolicyConstraint.class, + com.google.cloud.securityposture.v1.OrgPolicyConstraint.Builder.class); + } + + public static final int CANNED_CONSTRAINT_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object cannedConstraintId_ = ""; + /** + * + * + *
+   * Required. Org Policy Canned Constraint id.
+   * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cannedConstraintId. + */ + @java.lang.Override + public java.lang.String getCannedConstraintId() { + java.lang.Object ref = cannedConstraintId_; + 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(); + cannedConstraintId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Org Policy Canned Constraint id.
+   * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cannedConstraintId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCannedConstraintIdBytes() { + java.lang.Object ref = cannedConstraintId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cannedConstraintId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POLICY_RULES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List policyRules_; + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getPolicyRulesList() { + return policyRules_; + } + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPolicyRulesOrBuilderList() { + return policyRules_; + } + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPolicyRulesCount() { + return policyRules_.size(); + } + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule getPolicyRules(int index) { + return policyRules_.get(index); + } + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRuleOrBuilder getPolicyRulesOrBuilder( + int index) { + return policyRules_.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(cannedConstraintId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cannedConstraintId_); + } + for (int i = 0; i < policyRules_.size(); i++) { + output.writeMessage(2, policyRules_.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(cannedConstraintId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cannedConstraintId_); + } + for (int i = 0; i < policyRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, policyRules_.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.securityposture.v1.OrgPolicyConstraint)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.OrgPolicyConstraint other = + (com.google.cloud.securityposture.v1.OrgPolicyConstraint) obj; + + if (!getCannedConstraintId().equals(other.getCannedConstraintId())) return false; + if (!getPolicyRulesList().equals(other.getPolicyRulesList())) 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) + CANNED_CONSTRAINT_ID_FIELD_NUMBER; + hash = (53 * hash) + getCannedConstraintId().hashCode(); + if (getPolicyRulesCount() > 0) { + hash = (37 * hash) + POLICY_RULES_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRulesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint 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.securityposture.v1.OrgPolicyConstraint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint 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.securityposture.v1.OrgPolicyConstraint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint 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.securityposture.v1.OrgPolicyConstraint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint 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.securityposture.v1.OrgPolicyConstraint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint 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.securityposture.v1.OrgPolicyConstraint 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 Org Policy Canned Constraint.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.OrgPolicyConstraint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.OrgPolicyConstraint) + com.google.cloud.securityposture.v1.OrgPolicyConstraintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.OrgPolicyConstraint.class, + com.google.cloud.securityposture.v1.OrgPolicyConstraint.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.OrgPolicyConstraint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + cannedConstraintId_ = ""; + if (policyRulesBuilder_ == null) { + policyRules_ = java.util.Collections.emptyList(); + } else { + policyRules_ = null; + policyRulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraint_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraint getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraint build() { + com.google.cloud.securityposture.v1.OrgPolicyConstraint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraint buildPartial() { + com.google.cloud.securityposture.v1.OrgPolicyConstraint result = + new com.google.cloud.securityposture.v1.OrgPolicyConstraint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.OrgPolicyConstraint result) { + if (policyRulesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + policyRules_ = java.util.Collections.unmodifiableList(policyRules_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.policyRules_ = policyRules_; + } else { + result.policyRules_ = policyRulesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securityposture.v1.OrgPolicyConstraint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.cannedConstraintId_ = cannedConstraintId_; + } + } + + @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.securityposture.v1.OrgPolicyConstraint) { + return mergeFrom((com.google.cloud.securityposture.v1.OrgPolicyConstraint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.OrgPolicyConstraint other) { + if (other == com.google.cloud.securityposture.v1.OrgPolicyConstraint.getDefaultInstance()) + return this; + if (!other.getCannedConstraintId().isEmpty()) { + cannedConstraintId_ = other.cannedConstraintId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (policyRulesBuilder_ == null) { + if (!other.policyRules_.isEmpty()) { + if (policyRules_.isEmpty()) { + policyRules_ = other.policyRules_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePolicyRulesIsMutable(); + policyRules_.addAll(other.policyRules_); + } + onChanged(); + } + } else { + if (!other.policyRules_.isEmpty()) { + if (policyRulesBuilder_.isEmpty()) { + policyRulesBuilder_.dispose(); + policyRulesBuilder_ = null; + policyRules_ = other.policyRules_; + bitField0_ = (bitField0_ & ~0x00000002); + policyRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPolicyRulesFieldBuilder() + : null; + } else { + policyRulesBuilder_.addAllMessages(other.policyRules_); + } + } + } + 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: + { + cannedConstraintId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.securityposture.v1.PolicyRule m = + input.readMessage( + com.google.cloud.securityposture.v1.PolicyRule.parser(), extensionRegistry); + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.add(m); + } else { + policyRulesBuilder_.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 cannedConstraintId_ = ""; + /** + * + * + *
+     * Required. Org Policy Canned Constraint id.
+     * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cannedConstraintId. + */ + public java.lang.String getCannedConstraintId() { + java.lang.Object ref = cannedConstraintId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cannedConstraintId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Org Policy Canned Constraint id.
+     * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cannedConstraintId. + */ + public com.google.protobuf.ByteString getCannedConstraintIdBytes() { + java.lang.Object ref = cannedConstraintId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cannedConstraintId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Org Policy Canned Constraint id.
+     * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The cannedConstraintId to set. + * @return This builder for chaining. + */ + public Builder setCannedConstraintId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + cannedConstraintId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Org Policy Canned Constraint id.
+     * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCannedConstraintId() { + cannedConstraintId_ = getDefaultInstance().getCannedConstraintId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Org Policy Canned Constraint id.
+     * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for cannedConstraintId to set. + * @return This builder for chaining. + */ + public Builder setCannedConstraintIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + cannedConstraintId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List policyRules_ = + java.util.Collections.emptyList(); + + private void ensurePolicyRulesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + policyRules_ = + new java.util.ArrayList(policyRules_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule, + com.google.cloud.securityposture.v1.PolicyRule.Builder, + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder> + policyRulesBuilder_; + + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPolicyRulesList() { + if (policyRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRules_); + } else { + return policyRulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPolicyRulesCount() { + if (policyRulesBuilder_ == null) { + return policyRules_.size(); + } else { + return policyRulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRule getPolicyRules(int index) { + if (policyRulesBuilder_ == null) { + return policyRules_.get(index); + } else { + return policyRulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyRules(int index, com.google.cloud.securityposture.v1.PolicyRule value) { + if (policyRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyRulesIsMutable(); + policyRules_.set(index, value); + onChanged(); + } else { + policyRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyRules( + int index, com.google.cloud.securityposture.v1.PolicyRule.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.set(index, builderForValue.build()); + onChanged(); + } else { + policyRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicyRules(com.google.cloud.securityposture.v1.PolicyRule value) { + if (policyRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyRulesIsMutable(); + policyRules_.add(value); + onChanged(); + } else { + policyRulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicyRules(int index, com.google.cloud.securityposture.v1.PolicyRule value) { + if (policyRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyRulesIsMutable(); + policyRules_.add(index, value); + onChanged(); + } else { + policyRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicyRules( + com.google.cloud.securityposture.v1.PolicyRule.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.add(builderForValue.build()); + onChanged(); + } else { + policyRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicyRules( + int index, com.google.cloud.securityposture.v1.PolicyRule.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.add(index, builderForValue.build()); + onChanged(); + } else { + policyRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllPolicyRules( + java.lang.Iterable values) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyRules_); + onChanged(); + } else { + policyRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPolicyRules() { + if (policyRulesBuilder_ == null) { + policyRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + policyRulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removePolicyRules(int index) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.remove(index); + onChanged(); + } else { + policyRulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRule.Builder getPolicyRulesBuilder(int index) { + return getPolicyRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRuleOrBuilder getPolicyRulesOrBuilder( + int index) { + if (policyRulesBuilder_ == null) { + return policyRules_.get(index); + } else { + return policyRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPolicyRulesOrBuilderList() { + if (policyRulesBuilder_ != null) { + return policyRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyRules_); + } + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRule.Builder addPolicyRulesBuilder() { + return getPolicyRulesFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.PolicyRule.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRule.Builder addPolicyRulesBuilder(int index) { + return getPolicyRulesFieldBuilder() + .addBuilder(index, com.google.cloud.securityposture.v1.PolicyRule.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Org PolicySpec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPolicyRulesBuilderList() { + return getPolicyRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule, + com.google.cloud.securityposture.v1.PolicyRule.Builder, + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder> + getPolicyRulesFieldBuilder() { + if (policyRulesBuilder_ == null) { + policyRulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule, + com.google.cloud.securityposture.v1.PolicyRule.Builder, + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder>( + policyRules_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + policyRules_ = null; + } + return policyRulesBuilder_; + } + + @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.securityposture.v1.OrgPolicyConstraint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.OrgPolicyConstraint) + private static final com.google.cloud.securityposture.v1.OrgPolicyConstraint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.OrgPolicyConstraint(); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrgPolicyConstraint 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.securityposture.v1.OrgPolicyConstraint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintCustom.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintCustom.java new file mode 100644 index 000000000000..dc4b7a0200f1 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintCustom.java @@ -0,0 +1,1303 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/org_policy_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for Org Policy Custom Constraint.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.OrgPolicyConstraintCustom} + */ +public final class OrgPolicyConstraintCustom extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.OrgPolicyConstraintCustom) + OrgPolicyConstraintCustomOrBuilder { + private static final long serialVersionUID = 0L; + // Use OrgPolicyConstraintCustom.newBuilder() to construct. + private OrgPolicyConstraintCustom(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OrgPolicyConstraintCustom() { + policyRules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OrgPolicyConstraintCustom(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraintCustom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraintCustom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.class, + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.Builder.class); + } + + private int bitField0_; + public static final int CUSTOM_CONSTRAINT_FIELD_NUMBER = 1; + private com.google.cloud.securityposture.v1.CustomConstraint customConstraint_; + /** + * + * + *
+   * Required. Org Policy Custom Constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customConstraint field is set. + */ + @java.lang.Override + public boolean hasCustomConstraint() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Org Policy Custom Constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customConstraint. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConstraint getCustomConstraint() { + return customConstraint_ == null + ? com.google.cloud.securityposture.v1.CustomConstraint.getDefaultInstance() + : customConstraint_; + } + /** + * + * + *
+   * Required. Org Policy Custom Constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConstraintOrBuilder + getCustomConstraintOrBuilder() { + return customConstraint_ == null + ? com.google.cloud.securityposture.v1.CustomConstraint.getDefaultInstance() + : customConstraint_; + } + + public static final int POLICY_RULES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List policyRules_; + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getPolicyRulesList() { + return policyRules_; + } + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPolicyRulesOrBuilderList() { + return policyRules_; + } + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPolicyRulesCount() { + return policyRules_.size(); + } + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule getPolicyRules(int index) { + return policyRules_.get(index); + } + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRuleOrBuilder getPolicyRulesOrBuilder( + int index) { + return policyRules_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCustomConstraint()); + } + for (int i = 0; i < policyRules_.size(); i++) { + output.writeMessage(2, policyRules_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCustomConstraint()); + } + for (int i = 0; i < policyRules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, policyRules_.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.securityposture.v1.OrgPolicyConstraintCustom)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom other = + (com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) obj; + + if (hasCustomConstraint() != other.hasCustomConstraint()) return false; + if (hasCustomConstraint()) { + if (!getCustomConstraint().equals(other.getCustomConstraint())) return false; + } + if (!getPolicyRulesList().equals(other.getPolicyRulesList())) 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 (hasCustomConstraint()) { + hash = (37 * hash) + CUSTOM_CONSTRAINT_FIELD_NUMBER; + hash = (53 * hash) + getCustomConstraint().hashCode(); + } + if (getPolicyRulesCount() > 0) { + hash = (37 * hash) + POLICY_RULES_FIELD_NUMBER; + hash = (53 * hash) + getPolicyRulesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom 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.securityposture.v1.OrgPolicyConstraintCustom parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom 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.securityposture.v1.OrgPolicyConstraintCustom parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom 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.securityposture.v1.OrgPolicyConstraintCustom parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom 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.securityposture.v1.OrgPolicyConstraintCustom parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom 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.securityposture.v1.OrgPolicyConstraintCustom 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 Org Policy Custom Constraint.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.OrgPolicyConstraintCustom} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.OrgPolicyConstraintCustom) + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustomOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraintCustom_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraintCustom_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.class, + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCustomConstraintFieldBuilder(); + getPolicyRulesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + customConstraint_ = null; + if (customConstraintBuilder_ != null) { + customConstraintBuilder_.dispose(); + customConstraintBuilder_ = null; + } + if (policyRulesBuilder_ == null) { + policyRules_ = java.util.Collections.emptyList(); + } else { + policyRules_ = null; + policyRulesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto + .internal_static_google_cloud_securityposture_v1_OrgPolicyConstraintCustom_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom build() { + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom buildPartial() { + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom result = + new com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom result) { + if (policyRulesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + policyRules_ = java.util.Collections.unmodifiableList(policyRules_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.policyRules_ = policyRules_; + } else { + result.policyRules_ = policyRulesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.customConstraint_ = + customConstraintBuilder_ == null ? customConstraint_ : customConstraintBuilder_.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.securityposture.v1.OrgPolicyConstraintCustom) { + return mergeFrom((com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom other) { + if (other + == com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom.getDefaultInstance()) + return this; + if (other.hasCustomConstraint()) { + mergeCustomConstraint(other.getCustomConstraint()); + } + if (policyRulesBuilder_ == null) { + if (!other.policyRules_.isEmpty()) { + if (policyRules_.isEmpty()) { + policyRules_ = other.policyRules_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePolicyRulesIsMutable(); + policyRules_.addAll(other.policyRules_); + } + onChanged(); + } + } else { + if (!other.policyRules_.isEmpty()) { + if (policyRulesBuilder_.isEmpty()) { + policyRulesBuilder_.dispose(); + policyRulesBuilder_ = null; + policyRules_ = other.policyRules_; + bitField0_ = (bitField0_ & ~0x00000002); + policyRulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPolicyRulesFieldBuilder() + : null; + } else { + policyRulesBuilder_.addAllMessages(other.policyRules_); + } + } + } + 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( + getCustomConstraintFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.securityposture.v1.PolicyRule m = + input.readMessage( + com.google.cloud.securityposture.v1.PolicyRule.parser(), extensionRegistry); + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.add(m); + } else { + policyRulesBuilder_.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 com.google.cloud.securityposture.v1.CustomConstraint customConstraint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConstraint, + com.google.cloud.securityposture.v1.CustomConstraint.Builder, + com.google.cloud.securityposture.v1.CustomConstraintOrBuilder> + customConstraintBuilder_; + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customConstraint field is set. + */ + public boolean hasCustomConstraint() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customConstraint. + */ + public com.google.cloud.securityposture.v1.CustomConstraint getCustomConstraint() { + if (customConstraintBuilder_ == null) { + return customConstraint_ == null + ? com.google.cloud.securityposture.v1.CustomConstraint.getDefaultInstance() + : customConstraint_; + } else { + return customConstraintBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCustomConstraint(com.google.cloud.securityposture.v1.CustomConstraint value) { + if (customConstraintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customConstraint_ = value; + } else { + customConstraintBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCustomConstraint( + com.google.cloud.securityposture.v1.CustomConstraint.Builder builderForValue) { + if (customConstraintBuilder_ == null) { + customConstraint_ = builderForValue.build(); + } else { + customConstraintBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCustomConstraint( + com.google.cloud.securityposture.v1.CustomConstraint value) { + if (customConstraintBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && customConstraint_ != null + && customConstraint_ + != com.google.cloud.securityposture.v1.CustomConstraint.getDefaultInstance()) { + getCustomConstraintBuilder().mergeFrom(value); + } else { + customConstraint_ = value; + } + } else { + customConstraintBuilder_.mergeFrom(value); + } + if (customConstraint_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCustomConstraint() { + bitField0_ = (bitField0_ & ~0x00000001); + customConstraint_ = null; + if (customConstraintBuilder_ != null) { + customConstraintBuilder_.dispose(); + customConstraintBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.CustomConstraint.Builder + getCustomConstraintBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCustomConstraintFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.CustomConstraintOrBuilder + getCustomConstraintOrBuilder() { + if (customConstraintBuilder_ != null) { + return customConstraintBuilder_.getMessageOrBuilder(); + } else { + return customConstraint_ == null + ? com.google.cloud.securityposture.v1.CustomConstraint.getDefaultInstance() + : customConstraint_; + } + } + /** + * + * + *
+     * Required. Org Policy Custom Constraint.
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConstraint, + com.google.cloud.securityposture.v1.CustomConstraint.Builder, + com.google.cloud.securityposture.v1.CustomConstraintOrBuilder> + getCustomConstraintFieldBuilder() { + if (customConstraintBuilder_ == null) { + customConstraintBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConstraint, + com.google.cloud.securityposture.v1.CustomConstraint.Builder, + com.google.cloud.securityposture.v1.CustomConstraintOrBuilder>( + getCustomConstraint(), getParentForChildren(), isClean()); + customConstraint_ = null; + } + return customConstraintBuilder_; + } + + private java.util.List policyRules_ = + java.util.Collections.emptyList(); + + private void ensurePolicyRulesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + policyRules_ = + new java.util.ArrayList(policyRules_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule, + com.google.cloud.securityposture.v1.PolicyRule.Builder, + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder> + policyRulesBuilder_; + + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPolicyRulesList() { + if (policyRulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(policyRules_); + } else { + return policyRulesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPolicyRulesCount() { + if (policyRulesBuilder_ == null) { + return policyRules_.size(); + } else { + return policyRulesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRule getPolicyRules(int index) { + if (policyRulesBuilder_ == null) { + return policyRules_.get(index); + } else { + return policyRulesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyRules(int index, com.google.cloud.securityposture.v1.PolicyRule value) { + if (policyRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyRulesIsMutable(); + policyRules_.set(index, value); + onChanged(); + } else { + policyRulesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicyRules( + int index, com.google.cloud.securityposture.v1.PolicyRule.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.set(index, builderForValue.build()); + onChanged(); + } else { + policyRulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicyRules(com.google.cloud.securityposture.v1.PolicyRule value) { + if (policyRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyRulesIsMutable(); + policyRules_.add(value); + onChanged(); + } else { + policyRulesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicyRules(int index, com.google.cloud.securityposture.v1.PolicyRule value) { + if (policyRulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicyRulesIsMutable(); + policyRules_.add(index, value); + onChanged(); + } else { + policyRulesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicyRules( + com.google.cloud.securityposture.v1.PolicyRule.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.add(builderForValue.build()); + onChanged(); + } else { + policyRulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicyRules( + int index, com.google.cloud.securityposture.v1.PolicyRule.Builder builderForValue) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.add(index, builderForValue.build()); + onChanged(); + } else { + policyRulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllPolicyRules( + java.lang.Iterable values) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policyRules_); + onChanged(); + } else { + policyRulesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPolicyRules() { + if (policyRulesBuilder_ == null) { + policyRules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + policyRulesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removePolicyRules(int index) { + if (policyRulesBuilder_ == null) { + ensurePolicyRulesIsMutable(); + policyRules_.remove(index); + onChanged(); + } else { + policyRulesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRule.Builder getPolicyRulesBuilder(int index) { + return getPolicyRulesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRuleOrBuilder getPolicyRulesOrBuilder( + int index) { + if (policyRulesBuilder_ == null) { + return policyRules_.get(index); + } else { + return policyRulesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPolicyRulesOrBuilderList() { + if (policyRulesBuilder_ != null) { + return policyRulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policyRules_); + } + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRule.Builder addPolicyRulesBuilder() { + return getPolicyRulesFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.PolicyRule.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyRule.Builder addPolicyRulesBuilder(int index) { + return getPolicyRulesFieldBuilder() + .addBuilder(index, com.google.cloud.securityposture.v1.PolicyRule.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Org Policyspec rules.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPolicyRulesBuilderList() { + return getPolicyRulesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule, + com.google.cloud.securityposture.v1.PolicyRule.Builder, + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder> + getPolicyRulesFieldBuilder() { + if (policyRulesBuilder_ == null) { + policyRulesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule, + com.google.cloud.securityposture.v1.PolicyRule.Builder, + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder>( + policyRules_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + policyRules_ = null; + } + return policyRulesBuilder_; + } + + @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.securityposture.v1.OrgPolicyConstraintCustom) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.OrgPolicyConstraintCustom) + private static final com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom(); + } + + public static com.google.cloud.securityposture.v1.OrgPolicyConstraintCustom getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OrgPolicyConstraintCustom 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.securityposture.v1.OrgPolicyConstraintCustom getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintCustomOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintCustomOrBuilder.java new file mode 100644 index 000000000000..52940f7497a1 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintCustomOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/org_policy_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface OrgPolicyConstraintCustomOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.OrgPolicyConstraintCustom) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Org Policy Custom Constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the customConstraint field is set. + */ + boolean hasCustomConstraint(); + /** + * + * + *
+   * Required. Org Policy Custom Constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The customConstraint. + */ + com.google.cloud.securityposture.v1.CustomConstraint getCustomConstraint(); + /** + * + * + *
+   * Required. Org Policy Custom Constraint.
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConstraint custom_constraint = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.CustomConstraintOrBuilder getCustomConstraintOrBuilder(); + + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPolicyRulesList(); + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PolicyRule getPolicyRules(int index); + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPolicyRulesCount(); + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPolicyRulesOrBuilderList(); + /** + * + * + *
+   * Required. Org Policyspec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder getPolicyRulesOrBuilder(int index); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintOrBuilder.java new file mode 100644 index 000000000000..adcf61182780 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securityposture/v1/org_policy_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface OrgPolicyConstraintOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.OrgPolicyConstraint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Org Policy Canned Constraint id.
+   * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The cannedConstraintId. + */ + java.lang.String getCannedConstraintId(); + /** + * + * + *
+   * Required. Org Policy Canned Constraint id.
+   * 
+ * + * string canned_constraint_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for cannedConstraintId. + */ + com.google.protobuf.ByteString getCannedConstraintIdBytes(); + + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPolicyRulesList(); + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PolicyRule getPolicyRules(int index); + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPolicyRulesCount(); + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPolicyRulesOrBuilderList(); + /** + * + * + *
+   * Required. Org PolicySpec rules.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicyRule policy_rules = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder getPolicyRulesOrBuilder(int index); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintsProto.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintsProto.java new file mode 100644 index 000000000000..5f8f79eefd9b --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/OrgPolicyConstraintsProto.java @@ -0,0 +1,99 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/org_policy_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public final class OrgPolicyConstraintsProto { + private OrgPolicyConstraintsProto() {} + + 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_securityposture_v1_OrgPolicyConstraint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_OrgPolicyConstraint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_OrgPolicyConstraintCustom_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_OrgPolicyConstraintCustom_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 fieldValuesMap; + private final String organization; + private final String location; + + @Deprecated + protected OrganizationName() { + organization = null; + location = null; + } + + private OrganizationName(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 OrganizationName 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 OrganizationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION.validatedMatch( + formattedString, "OrganizationName.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 (OrganizationName 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()) { + OrganizationName that = ((OrganizationName) 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(OrganizationName organizationName) { + this.organization = organizationName.organization; + this.location = organizationName.location; + } + + public OrganizationName build() { + return new OrganizationName(this); + } + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Policy.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Policy.java new file mode 100644 index 000000000000..b121d1137d4f --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Policy.java @@ -0,0 +1,2541 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Policy representation.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.Policy} + */ +public final class Policy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.Policy) + PolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Policy.newBuilder() to construct. + private Policy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Policy() { + policyId_ = ""; + complianceStandards_ = java.util.Collections.emptyList(); + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Policy(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.Policy.class, + com.google.cloud.securityposture.v1.Policy.Builder.class); + } + + public interface ComplianceStandardOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.Policy.ComplianceStandard) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+     * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The standard. + */ + java.lang.String getStandard(); + /** + * + * + *
+     * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+     * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for standard. + */ + com.google.protobuf.ByteString getStandardBytes(); + + /** + * + * + *
+     * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+     * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The control. + */ + java.lang.String getControl(); + /** + * + * + *
+     * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+     * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for control. + */ + com.google.protobuf.ByteString getControlBytes(); + } + /** + * + * + *
+   * Mapping for a Policy to standard and control.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.Policy.ComplianceStandard} + */ + public static final class ComplianceStandard extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.Policy.ComplianceStandard) + ComplianceStandardOrBuilder { + private static final long serialVersionUID = 0L; + // Use ComplianceStandard.newBuilder() to construct. + private ComplianceStandard(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ComplianceStandard() { + standard_ = ""; + control_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ComplianceStandard(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.class, + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder.class); + } + + public static final int STANDARD_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object standard_ = ""; + /** + * + * + *
+     * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+     * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The standard. + */ + @java.lang.Override + public java.lang.String getStandard() { + java.lang.Object ref = standard_; + 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(); + standard_ = s; + return s; + } + } + /** + * + * + *
+     * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+     * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for standard. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStandardBytes() { + java.lang.Object ref = standard_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + standard_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTROL_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object control_ = ""; + /** + * + * + *
+     * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+     * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The control. + */ + @java.lang.Override + public java.lang.String getControl() { + java.lang.Object ref = control_; + 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(); + control_ = s; + return s; + } + } + /** + * + * + *
+     * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+     * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for control. + */ + @java.lang.Override + public com.google.protobuf.ByteString getControlBytes() { + java.lang.Object ref = control_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + control_ = 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(standard_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, standard_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(control_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, control_); + } + 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(standard_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, standard_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(control_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, control_); + } + 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.securityposture.v1.Policy.ComplianceStandard)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.Policy.ComplianceStandard other = + (com.google.cloud.securityposture.v1.Policy.ComplianceStandard) obj; + + if (!getStandard().equals(other.getStandard())) return false; + if (!getControl().equals(other.getControl())) 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) + STANDARD_FIELD_NUMBER; + hash = (53 * hash) + getStandard().hashCode(); + hash = (37 * hash) + CONTROL_FIELD_NUMBER; + hash = (53 * hash) + getControl().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard 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.securityposture.v1.Policy.ComplianceStandard parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard 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.securityposture.v1.Policy.ComplianceStandard parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard 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.securityposture.v1.Policy.ComplianceStandard parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard 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.securityposture.v1.Policy.ComplianceStandard parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard 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.securityposture.v1.Policy.ComplianceStandard 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; + } + /** + * + * + *
+     * Mapping for a Policy to standard and control.
+     * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.Policy.ComplianceStandard} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.Policy.ComplianceStandard) + com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.class, + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.Policy.ComplianceStandard.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + standard_ = ""; + control_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy.ComplianceStandard + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.Policy.ComplianceStandard.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy.ComplianceStandard build() { + com.google.cloud.securityposture.v1.Policy.ComplianceStandard result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy.ComplianceStandard buildPartial() { + com.google.cloud.securityposture.v1.Policy.ComplianceStandard result = + new com.google.cloud.securityposture.v1.Policy.ComplianceStandard(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.Policy.ComplianceStandard result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.standard_ = standard_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.control_ = control_; + } + } + + @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.securityposture.v1.Policy.ComplianceStandard) { + return mergeFrom((com.google.cloud.securityposture.v1.Policy.ComplianceStandard) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.Policy.ComplianceStandard other) { + if (other + == com.google.cloud.securityposture.v1.Policy.ComplianceStandard.getDefaultInstance()) + return this; + if (!other.getStandard().isEmpty()) { + standard_ = other.standard_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getControl().isEmpty()) { + control_ = other.control_; + 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: + { + standard_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + control_ = 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 standard_ = ""; + /** + * + * + *
+       * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+       * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The standard. + */ + public java.lang.String getStandard() { + java.lang.Object ref = standard_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + standard_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+       * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for standard. + */ + public com.google.protobuf.ByteString getStandardBytes() { + java.lang.Object ref = standard_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + standard_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+       * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The standard to set. + * @return This builder for chaining. + */ + public Builder setStandard(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + standard_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+       * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearStandard() { + standard_ = getDefaultInstance().getStandard(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0.
+       * 
+ * + * string standard = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for standard to set. + * @return This builder for chaining. + */ + public Builder setStandardBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + standard_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object control_ = ""; + /** + * + * + *
+       * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+       * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The control. + */ + public java.lang.String getControl() { + java.lang.Object ref = control_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + control_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+       * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for control. + */ + public com.google.protobuf.ByteString getControlBytes() { + java.lang.Object ref = control_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + control_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+       * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The control to set. + * @return This builder for chaining. + */ + public Builder setControl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + control_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+       * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearControl() { + control_ = getDefaultInstance().getControl(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Control mapping provided by user for this Policy. e.g.: 1.5.
+       * 
+ * + * string control = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for control to set. + * @return This builder for chaining. + */ + public Builder setControlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + control_ = 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.securityposture.v1.Policy.ComplianceStandard) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.Policy.ComplianceStandard) + private static final com.google.cloud.securityposture.v1.Policy.ComplianceStandard + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.Policy.ComplianceStandard(); + } + + public static com.google.cloud.securityposture.v1.Policy.ComplianceStandard + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ComplianceStandard 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.securityposture.v1.Policy.ComplianceStandard + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int POLICY_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object policyId_ = ""; + /** + * + * + *
+   * Required. ID of the Policy that is user generated, immutable and unique
+   * within the scope of a policy set.
+   * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyId. + */ + @java.lang.Override + public java.lang.String getPolicyId() { + java.lang.Object ref = policyId_; + 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(); + policyId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the Policy that is user generated, immutable and unique
+   * within the scope of a policy set.
+   * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicyIdBytes() { + java.lang.Object ref = policyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMPLIANCE_STANDARDS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + complianceStandards_; + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getComplianceStandardsList() { + return complianceStandards_; + } + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder> + getComplianceStandardsOrBuilderList() { + return complianceStandards_; + } + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getComplianceStandardsCount() { + return complianceStandards_.size(); + } + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy.ComplianceStandard getComplianceStandards( + int index) { + return complianceStandards_.get(index); + } + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder + getComplianceStandardsOrBuilder(int index) { + return complianceStandards_.get(index); + } + + public static final int CONSTRAINT_FIELD_NUMBER = 3; + private com.google.cloud.securityposture.v1.Constraint constraint_; + /** + * + * + *
+   * Required. Constraint details.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the constraint field is set. + */ + @java.lang.Override + public boolean hasConstraint() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Constraint details.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The constraint. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Constraint getConstraint() { + return constraint_ == null + ? com.google.cloud.securityposture.v1.Constraint.getDefaultInstance() + : constraint_; + } + /** + * + * + *
+   * Required. Constraint details.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.ConstraintOrBuilder getConstraintOrBuilder() { + return constraint_ == null + ? com.google.cloud.securityposture.v1.Constraint.getDefaultInstance() + : constraint_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. Description of the Policy.
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Description of the Policy.
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + 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(policyId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, policyId_); + } + for (int i = 0; i < complianceStandards_.size(); i++) { + output.writeMessage(2, complianceStandards_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getConstraint()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); + } + 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(policyId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, policyId_); + } + for (int i = 0; i < complianceStandards_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, complianceStandards_.get(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getConstraint()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); + } + 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.securityposture.v1.Policy)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.Policy other = + (com.google.cloud.securityposture.v1.Policy) obj; + + if (!getPolicyId().equals(other.getPolicyId())) return false; + if (!getComplianceStandardsList().equals(other.getComplianceStandardsList())) return false; + if (hasConstraint() != other.hasConstraint()) return false; + if (hasConstraint()) { + if (!getConstraint().equals(other.getConstraint())) return false; + } + if (!getDescription().equals(other.getDescription())) 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) + POLICY_ID_FIELD_NUMBER; + hash = (53 * hash) + getPolicyId().hashCode(); + if (getComplianceStandardsCount() > 0) { + hash = (37 * hash) + COMPLIANCE_STANDARDS_FIELD_NUMBER; + hash = (53 * hash) + getComplianceStandardsList().hashCode(); + } + if (hasConstraint()) { + hash = (37 * hash) + CONSTRAINT_FIELD_NUMBER; + hash = (53 * hash) + getConstraint().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.Policy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Policy 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.securityposture.v1.Policy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Policy 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.securityposture.v1.Policy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Policy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.Policy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Policy 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.securityposture.v1.Policy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Policy 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.securityposture.v1.Policy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Policy 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.securityposture.v1.Policy 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; + } + /** + * + * + *
+   * Policy representation.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.Policy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.Policy) + com.google.cloud.securityposture.v1.PolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.Policy.class, + com.google.cloud.securityposture.v1.Policy.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.Policy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getComplianceStandardsFieldBuilder(); + getConstraintFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + policyId_ = ""; + if (complianceStandardsBuilder_ == null) { + complianceStandards_ = java.util.Collections.emptyList(); + } else { + complianceStandards_ = null; + complianceStandardsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + constraint_ = null; + if (constraintBuilder_ != null) { + constraintBuilder_.dispose(); + constraintBuilder_ = null; + } + description_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Policy_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.Policy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy build() { + com.google.cloud.securityposture.v1.Policy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy buildPartial() { + com.google.cloud.securityposture.v1.Policy result = + new com.google.cloud.securityposture.v1.Policy(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.securityposture.v1.Policy result) { + if (complianceStandardsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + complianceStandards_ = java.util.Collections.unmodifiableList(complianceStandards_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.complianceStandards_ = complianceStandards_; + } else { + result.complianceStandards_ = complianceStandardsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securityposture.v1.Policy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.policyId_ = policyId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.constraint_ = constraintBuilder_ == null ? constraint_ : constraintBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.description_ = description_; + } + 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.securityposture.v1.Policy) { + return mergeFrom((com.google.cloud.securityposture.v1.Policy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.Policy other) { + if (other == com.google.cloud.securityposture.v1.Policy.getDefaultInstance()) return this; + if (!other.getPolicyId().isEmpty()) { + policyId_ = other.policyId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (complianceStandardsBuilder_ == null) { + if (!other.complianceStandards_.isEmpty()) { + if (complianceStandards_.isEmpty()) { + complianceStandards_ = other.complianceStandards_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureComplianceStandardsIsMutable(); + complianceStandards_.addAll(other.complianceStandards_); + } + onChanged(); + } + } else { + if (!other.complianceStandards_.isEmpty()) { + if (complianceStandardsBuilder_.isEmpty()) { + complianceStandardsBuilder_.dispose(); + complianceStandardsBuilder_ = null; + complianceStandards_ = other.complianceStandards_; + bitField0_ = (bitField0_ & ~0x00000002); + complianceStandardsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getComplianceStandardsFieldBuilder() + : null; + } else { + complianceStandardsBuilder_.addAllMessages(other.complianceStandards_); + } + } + } + if (other.hasConstraint()) { + mergeConstraint(other.getConstraint()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + policyId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.cloud.securityposture.v1.Policy.ComplianceStandard m = + input.readMessage( + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.parser(), + extensionRegistry); + if (complianceStandardsBuilder_ == null) { + ensureComplianceStandardsIsMutable(); + complianceStandards_.add(m); + } else { + complianceStandardsBuilder_.addMessage(m); + } + break; + } // case 18 + case 26: + { + input.readMessage(getConstraintFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object policyId_ = ""; + /** + * + * + *
+     * Required. ID of the Policy that is user generated, immutable and unique
+     * within the scope of a policy set.
+     * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyId. + */ + public java.lang.String getPolicyId() { + java.lang.Object ref = policyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the Policy that is user generated, immutable and unique
+     * within the scope of a policy set.
+     * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyId. + */ + public com.google.protobuf.ByteString getPolicyIdBytes() { + java.lang.Object ref = policyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the Policy that is user generated, immutable and unique
+     * within the scope of a policy set.
+     * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The policyId to set. + * @return This builder for chaining. + */ + public Builder setPolicyId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policyId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the Policy that is user generated, immutable and unique
+     * within the scope of a policy set.
+     * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPolicyId() { + policyId_ = getDefaultInstance().getPolicyId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the Policy that is user generated, immutable and unique
+     * within the scope of a policy set.
+     * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for policyId to set. + * @return This builder for chaining. + */ + public Builder setPolicyIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policyId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.util.List + complianceStandards_ = java.util.Collections.emptyList(); + + private void ensureComplianceStandardsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + complianceStandards_ = + new java.util.ArrayList( + complianceStandards_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Policy.ComplianceStandard, + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder, + com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder> + complianceStandardsBuilder_; + + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getComplianceStandardsList() { + if (complianceStandardsBuilder_ == null) { + return java.util.Collections.unmodifiableList(complianceStandards_); + } else { + return complianceStandardsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getComplianceStandardsCount() { + if (complianceStandardsBuilder_ == null) { + return complianceStandards_.size(); + } else { + return complianceStandardsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.Policy.ComplianceStandard getComplianceStandards( + int index) { + if (complianceStandardsBuilder_ == null) { + return complianceStandards_.get(index); + } else { + return complianceStandardsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setComplianceStandards( + int index, com.google.cloud.securityposture.v1.Policy.ComplianceStandard value) { + if (complianceStandardsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComplianceStandardsIsMutable(); + complianceStandards_.set(index, value); + onChanged(); + } else { + complianceStandardsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setComplianceStandards( + int index, + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder builderForValue) { + if (complianceStandardsBuilder_ == null) { + ensureComplianceStandardsIsMutable(); + complianceStandards_.set(index, builderForValue.build()); + onChanged(); + } else { + complianceStandardsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addComplianceStandards( + com.google.cloud.securityposture.v1.Policy.ComplianceStandard value) { + if (complianceStandardsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComplianceStandardsIsMutable(); + complianceStandards_.add(value); + onChanged(); + } else { + complianceStandardsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addComplianceStandards( + int index, com.google.cloud.securityposture.v1.Policy.ComplianceStandard value) { + if (complianceStandardsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureComplianceStandardsIsMutable(); + complianceStandards_.add(index, value); + onChanged(); + } else { + complianceStandardsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addComplianceStandards( + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder builderForValue) { + if (complianceStandardsBuilder_ == null) { + ensureComplianceStandardsIsMutable(); + complianceStandards_.add(builderForValue.build()); + onChanged(); + } else { + complianceStandardsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addComplianceStandards( + int index, + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder builderForValue) { + if (complianceStandardsBuilder_ == null) { + ensureComplianceStandardsIsMutable(); + complianceStandards_.add(index, builderForValue.build()); + onChanged(); + } else { + complianceStandardsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllComplianceStandards( + java.lang.Iterable + values) { + if (complianceStandardsBuilder_ == null) { + ensureComplianceStandardsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, complianceStandards_); + onChanged(); + } else { + complianceStandardsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearComplianceStandards() { + if (complianceStandardsBuilder_ == null) { + complianceStandards_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + complianceStandardsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeComplianceStandards(int index) { + if (complianceStandardsBuilder_ == null) { + ensureComplianceStandardsIsMutable(); + complianceStandards_.remove(index); + onChanged(); + } else { + complianceStandardsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder + getComplianceStandardsBuilder(int index) { + return getComplianceStandardsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder + getComplianceStandardsOrBuilder(int index) { + if (complianceStandardsBuilder_ == null) { + return complianceStandards_.get(index); + } else { + return complianceStandardsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder> + getComplianceStandardsOrBuilderList() { + if (complianceStandardsBuilder_ != null) { + return complianceStandardsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(complianceStandards_); + } + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder + addComplianceStandardsBuilder() { + return getComplianceStandardsFieldBuilder() + .addBuilder( + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder + addComplianceStandardsBuilder(int index) { + return getComplianceStandardsFieldBuilder() + .addBuilder( + index, + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Contains list of mapping for a Policy to a standard and control.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getComplianceStandardsBuilderList() { + return getComplianceStandardsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Policy.ComplianceStandard, + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder, + com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder> + getComplianceStandardsFieldBuilder() { + if (complianceStandardsBuilder_ == null) { + complianceStandardsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Policy.ComplianceStandard, + com.google.cloud.securityposture.v1.Policy.ComplianceStandard.Builder, + com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder>( + complianceStandards_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + complianceStandards_ = null; + } + return complianceStandardsBuilder_; + } + + private com.google.cloud.securityposture.v1.Constraint constraint_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Constraint, + com.google.cloud.securityposture.v1.Constraint.Builder, + com.google.cloud.securityposture.v1.ConstraintOrBuilder> + constraintBuilder_; + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the constraint field is set. + */ + public boolean hasConstraint() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The constraint. + */ + public com.google.cloud.securityposture.v1.Constraint getConstraint() { + if (constraintBuilder_ == null) { + return constraint_ == null + ? com.google.cloud.securityposture.v1.Constraint.getDefaultInstance() + : constraint_; + } else { + return constraintBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConstraint(com.google.cloud.securityposture.v1.Constraint value) { + if (constraintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + constraint_ = value; + } else { + constraintBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConstraint( + com.google.cloud.securityposture.v1.Constraint.Builder builderForValue) { + if (constraintBuilder_ == null) { + constraint_ = builderForValue.build(); + } else { + constraintBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConstraint(com.google.cloud.securityposture.v1.Constraint value) { + if (constraintBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && constraint_ != null + && constraint_ != com.google.cloud.securityposture.v1.Constraint.getDefaultInstance()) { + getConstraintBuilder().mergeFrom(value); + } else { + constraint_ = value; + } + } else { + constraintBuilder_.mergeFrom(value); + } + if (constraint_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConstraint() { + bitField0_ = (bitField0_ & ~0x00000004); + constraint_ = null; + if (constraintBuilder_ != null) { + constraintBuilder_.dispose(); + constraintBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.Constraint.Builder getConstraintBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getConstraintFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.ConstraintOrBuilder getConstraintOrBuilder() { + if (constraintBuilder_ != null) { + return constraintBuilder_.getMessageOrBuilder(); + } else { + return constraint_ == null + ? com.google.cloud.securityposture.v1.Constraint.getDefaultInstance() + : constraint_; + } + } + /** + * + * + *
+     * Required. Constraint details.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Constraint, + com.google.cloud.securityposture.v1.Constraint.Builder, + com.google.cloud.securityposture.v1.ConstraintOrBuilder> + getConstraintFieldBuilder() { + if (constraintBuilder_ == null) { + constraintBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Constraint, + com.google.cloud.securityposture.v1.Constraint.Builder, + com.google.cloud.securityposture.v1.ConstraintOrBuilder>( + getConstraint(), getParentForChildren(), isClean()); + constraint_ = null; + } + return constraintBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Description of the Policy.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Description of the Policy.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Description of the Policy.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the Policy.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the Policy.
+     * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.securityposture.v1.Policy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.Policy) + private static final com.google.cloud.securityposture.v1.Policy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.Policy(); + } + + public static com.google.cloud.securityposture.v1.Policy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Policy 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.securityposture.v1.Policy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyOrBuilder.java new file mode 100644 index 000000000000..6722ba8f9c09 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface PolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.Policy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. ID of the Policy that is user generated, immutable and unique
+   * within the scope of a policy set.
+   * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policyId. + */ + java.lang.String getPolicyId(); + /** + * + * + *
+   * Required. ID of the Policy that is user generated, immutable and unique
+   * within the scope of a policy set.
+   * 
+ * + * string policy_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policyId. + */ + com.google.protobuf.ByteString getPolicyIdBytes(); + + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getComplianceStandardsList(); + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.Policy.ComplianceStandard getComplianceStandards(int index); + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getComplianceStandardsCount(); + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getComplianceStandardsOrBuilderList(); + /** + * + * + *
+   * Optional. Contains list of mapping for a Policy to a standard and control.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy.ComplianceStandard compliance_standards = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.securityposture.v1.Policy.ComplianceStandardOrBuilder + getComplianceStandardsOrBuilder(int index); + + /** + * + * + *
+   * Required. Constraint details.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the constraint field is set. + */ + boolean hasConstraint(); + /** + * + * + *
+   * Required. Constraint details.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The constraint. + */ + com.google.cloud.securityposture.v1.Constraint getConstraint(); + /** + * + * + *
+   * Required. Constraint details.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Constraint constraint = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.ConstraintOrBuilder getConstraintOrBuilder(); + + /** + * + * + *
+   * Optional. Description of the Policy.
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Description of the Policy.
+   * 
+ * + * string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyRule.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyRule.java new file mode 100644 index 000000000000..e443847b1598 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyRule.java @@ -0,0 +1,2781 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/org_policy_config.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * A rule used to express this policy.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PolicyRule} + */ +public final class PolicyRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.PolicyRule) + PolicyRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicyRule.newBuilder() to construct. + private PolicyRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PolicyRule() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PolicyRule(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PolicyRule.class, + com.google.cloud.securityposture.v1.PolicyRule.Builder.class); + } + + public interface StringValuesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.PolicyRule.StringValues) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * List of values allowed at this resource.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + java.util.List getAllowedValuesList(); + /** + * + * + *
+     * List of values allowed at this resource.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + int getAllowedValuesCount(); + /** + * + * + *
+     * List of values allowed at this resource.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + java.lang.String getAllowedValues(int index); + /** + * + * + *
+     * List of values allowed at this resource.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + com.google.protobuf.ByteString getAllowedValuesBytes(int index); + + /** + * + * + *
+     * List of values denied at this resource.
+     * 
+ * + * repeated string denied_values = 2; + * + * @return A list containing the deniedValues. + */ + java.util.List getDeniedValuesList(); + /** + * + * + *
+     * List of values denied at this resource.
+     * 
+ * + * repeated string denied_values = 2; + * + * @return The count of deniedValues. + */ + int getDeniedValuesCount(); + /** + * + * + *
+     * List of values denied at this resource.
+     * 
+ * + * repeated string denied_values = 2; + * + * @param index The index of the element to return. + * @return The deniedValues at the given index. + */ + java.lang.String getDeniedValues(int index); + /** + * + * + *
+     * List of values denied at this resource.
+     * 
+ * + * repeated string denied_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the deniedValues at the given index. + */ + com.google.protobuf.ByteString getDeniedValuesBytes(int index); + } + /** + * + * + *
+   * A message that holds specific allowed and denied values.
+   * This message can define specific values and subtrees of the Resource
+   * Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that
+   * are allowed or denied. This is achieved by using the `under:` and
+   * optional `is:` prefixes.
+   * The `under:` prefix is used to denote resource subtree values.
+   * The `is:` prefix is used to denote specific values, and is required only
+   * if the value contains a ":". Values prefixed with "is:" are treated the
+   * same as values with no prefix.
+   * Ancestry subtrees must be in one of the following formats:
+   *
+   * - `projects/<project-id>` (for example, `projects/tokyo-rain-123`)
+   * - `folders/<folder-id>` (for example, `folders/1234`)
+   * - `organizations/<organization-id>` (for example, `organizations/1234`)
+   *
+   * The `supports_under` field of the associated `Constraint`  defines
+   * whether ancestry prefixes can be used.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PolicyRule.StringValues} + */ + public static final class StringValues extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.PolicyRule.StringValues) + StringValuesOrBuilder { + private static final long serialVersionUID = 0L; + // Use StringValues.newBuilder() to construct. + private StringValues(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StringValues() { + allowedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deniedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StringValues(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PolicyRule.StringValues.class, + com.google.cloud.securityposture.v1.PolicyRule.StringValues.Builder.class); + } + + public static final int ALLOWED_VALUES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList allowedValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of values allowed at this resource.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedValuesList() { + return allowedValues_; + } + /** + * + * + *
+     * List of values allowed at this resource.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+     * List of values allowed at this resource.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + public java.lang.String getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+     * List of values allowed at this resource.
+     * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedValuesBytes(int index) { + return allowedValues_.getByteString(index); + } + + public static final int DENIED_VALUES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList deniedValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of values denied at this resource.
+     * 
+ * + * repeated string denied_values = 2; + * + * @return A list containing the deniedValues. + */ + public com.google.protobuf.ProtocolStringList getDeniedValuesList() { + return deniedValues_; + } + /** + * + * + *
+     * List of values denied at this resource.
+     * 
+ * + * repeated string denied_values = 2; + * + * @return The count of deniedValues. + */ + public int getDeniedValuesCount() { + return deniedValues_.size(); + } + /** + * + * + *
+     * List of values denied at this resource.
+     * 
+ * + * repeated string denied_values = 2; + * + * @param index The index of the element to return. + * @return The deniedValues at the given index. + */ + public java.lang.String getDeniedValues(int index) { + return deniedValues_.get(index); + } + /** + * + * + *
+     * List of values denied at this resource.
+     * 
+ * + * repeated string denied_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the deniedValues at the given index. + */ + public com.google.protobuf.ByteString getDeniedValuesBytes(int index) { + return deniedValues_.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 < allowedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedValues_.getRaw(i)); + } + for (int i = 0; i < deniedValues_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deniedValues_.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 < allowedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedValuesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < deniedValues_.size(); i++) { + dataSize += computeStringSizeNoTag(deniedValues_.getRaw(i)); + } + size += dataSize; + size += 1 * getDeniedValuesList().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.securityposture.v1.PolicyRule.StringValues)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.PolicyRule.StringValues other = + (com.google.cloud.securityposture.v1.PolicyRule.StringValues) obj; + + if (!getAllowedValuesList().equals(other.getAllowedValuesList())) return false; + if (!getDeniedValuesList().equals(other.getDeniedValuesList())) 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 (getAllowedValuesCount() > 0) { + hash = (37 * hash) + ALLOWED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedValuesList().hashCode(); + } + if (getDeniedValuesCount() > 0) { + hash = (37 * hash) + DENIED_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getDeniedValuesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues 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.securityposture.v1.PolicyRule.StringValues parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues 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.securityposture.v1.PolicyRule.StringValues parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues 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.securityposture.v1.PolicyRule.StringValues parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues 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.securityposture.v1.PolicyRule.StringValues parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues 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.securityposture.v1.PolicyRule.StringValues prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * A message that holds specific allowed and denied values.
+     * This message can define specific values and subtrees of the Resource
+     * Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that
+     * are allowed or denied. This is achieved by using the `under:` and
+     * optional `is:` prefixes.
+     * The `under:` prefix is used to denote resource subtree values.
+     * The `is:` prefix is used to denote specific values, and is required only
+     * if the value contains a ":". Values prefixed with "is:" are treated the
+     * same as values with no prefix.
+     * Ancestry subtrees must be in one of the following formats:
+     *
+     * - `projects/<project-id>` (for example, `projects/tokyo-rain-123`)
+     * - `folders/<folder-id>` (for example, `folders/1234`)
+     * - `organizations/<organization-id>` (for example, `organizations/1234`)
+     *
+     * The `supports_under` field of the associated `Constraint`  defines
+     * whether ancestry prefixes can be used.
+     * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PolicyRule.StringValues} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.PolicyRule.StringValues) + com.google.cloud.securityposture.v1.PolicyRule.StringValuesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PolicyRule.StringValues.class, + com.google.cloud.securityposture.v1.PolicyRule.StringValues.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.PolicyRule.StringValues.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + allowedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + deniedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_StringValues_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule.StringValues + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.PolicyRule.StringValues.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule.StringValues build() { + com.google.cloud.securityposture.v1.PolicyRule.StringValues result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule.StringValues buildPartial() { + com.google.cloud.securityposture.v1.PolicyRule.StringValues result = + new com.google.cloud.securityposture.v1.PolicyRule.StringValues(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.PolicyRule.StringValues result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + allowedValues_.makeImmutable(); + result.allowedValues_ = allowedValues_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + deniedValues_.makeImmutable(); + result.deniedValues_ = deniedValues_; + } + } + + @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.securityposture.v1.PolicyRule.StringValues) { + return mergeFrom((com.google.cloud.securityposture.v1.PolicyRule.StringValues) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.PolicyRule.StringValues other) { + if (other + == com.google.cloud.securityposture.v1.PolicyRule.StringValues.getDefaultInstance()) + return this; + if (!other.allowedValues_.isEmpty()) { + if (allowedValues_.isEmpty()) { + allowedValues_ = other.allowedValues_; + bitField0_ |= 0x00000001; + } else { + ensureAllowedValuesIsMutable(); + allowedValues_.addAll(other.allowedValues_); + } + onChanged(); + } + if (!other.deniedValues_.isEmpty()) { + if (deniedValues_.isEmpty()) { + deniedValues_ = other.deniedValues_; + bitField0_ |= 0x00000002; + } else { + ensureDeniedValuesIsMutable(); + deniedValues_.addAll(other.deniedValues_); + } + 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(); + ensureAllowedValuesIsMutable(); + allowedValues_.add(s); + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureDeniedValuesIsMutable(); + deniedValues_.add(s); + 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.protobuf.LazyStringArrayList allowedValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureAllowedValuesIsMutable() { + if (!allowedValues_.isModifiable()) { + allowedValues_ = new com.google.protobuf.LazyStringArrayList(allowedValues_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return A list containing the allowedValues. + */ + public com.google.protobuf.ProtocolStringList getAllowedValuesList() { + allowedValues_.makeImmutable(); + return allowedValues_; + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return The count of allowedValues. + */ + public int getAllowedValuesCount() { + return allowedValues_.size(); + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the element to return. + * @return The allowedValues at the given index. + */ + public java.lang.String getAllowedValues(int index) { + return allowedValues_.get(index); + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index of the value to return. + * @return The bytes of the allowedValues at the given index. + */ + public com.google.protobuf.ByteString getAllowedValuesBytes(int index) { + return allowedValues_.getByteString(index); + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param index The index to set the value at. + * @param value The allowedValues to set. + * @return This builder for chaining. + */ + public Builder setAllowedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param value The allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedValuesIsMutable(); + allowedValues_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param values The allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllAllowedValues(java.lang.Iterable values) { + ensureAllowedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedValues_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @return This builder for chaining. + */ + public Builder clearAllowedValues() { + allowedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of values allowed at this resource.
+       * 
+ * + * repeated string allowed_values = 1; + * + * @param value The bytes of the allowedValues to add. + * @return This builder for chaining. + */ + public Builder addAllowedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedValuesIsMutable(); + allowedValues_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList deniedValues_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDeniedValuesIsMutable() { + if (!deniedValues_.isModifiable()) { + deniedValues_ = new com.google.protobuf.LazyStringArrayList(deniedValues_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @return A list containing the deniedValues. + */ + public com.google.protobuf.ProtocolStringList getDeniedValuesList() { + deniedValues_.makeImmutable(); + return deniedValues_; + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @return The count of deniedValues. + */ + public int getDeniedValuesCount() { + return deniedValues_.size(); + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @param index The index of the element to return. + * @return The deniedValues at the given index. + */ + public java.lang.String getDeniedValues(int index) { + return deniedValues_.get(index); + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @param index The index of the value to return. + * @return The bytes of the deniedValues at the given index. + */ + public com.google.protobuf.ByteString getDeniedValuesBytes(int index) { + return deniedValues_.getByteString(index); + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @param index The index to set the value at. + * @param value The deniedValues to set. + * @return This builder for chaining. + */ + public Builder setDeniedValues(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeniedValuesIsMutable(); + deniedValues_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @param value The deniedValues to add. + * @return This builder for chaining. + */ + public Builder addDeniedValues(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeniedValuesIsMutable(); + deniedValues_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @param values The deniedValues to add. + * @return This builder for chaining. + */ + public Builder addAllDeniedValues(java.lang.Iterable values) { + ensureDeniedValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deniedValues_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @return This builder for chaining. + */ + public Builder clearDeniedValues() { + deniedValues_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of values denied at this resource.
+       * 
+ * + * repeated string denied_values = 2; + * + * @param value The bytes of the deniedValues to add. + * @return This builder for chaining. + */ + public Builder addDeniedValuesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDeniedValuesIsMutable(); + deniedValues_.add(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.securityposture.v1.PolicyRule.StringValues) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.PolicyRule.StringValues) + private static final com.google.cloud.securityposture.v1.PolicyRule.StringValues + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.PolicyRule.StringValues(); + } + + public static com.google.cloud.securityposture.v1.PolicyRule.StringValues getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringValues 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.securityposture.v1.PolicyRule.StringValues getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int kindCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object kind_; + + public enum KindCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VALUES(1), + ALLOW_ALL(2), + DENY_ALL(3), + ENFORCE(4), + KIND_NOT_SET(0); + private final int value; + + private KindCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KindCase valueOf(int value) { + return forNumber(value); + } + + public static KindCase forNumber(int value) { + switch (value) { + case 1: + return VALUES; + case 2: + return ALLOW_ALL; + case 3: + return DENY_ALL; + case 4: + return ENFORCE; + case 0: + return KIND_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public static final int VALUES_FIELD_NUMBER = 1; + /** + * + * + *
+   * List of values to be used for this policy rule. This field can be set
+   * only in policies for list constraints.
+   * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + * + * @return Whether the values field is set. + */ + @java.lang.Override + public boolean hasValues() { + return kindCase_ == 1; + } + /** + * + * + *
+   * List of values to be used for this policy rule. This field can be set
+   * only in policies for list constraints.
+   * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + * + * @return The values. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule.StringValues getValues() { + if (kindCase_ == 1) { + return (com.google.cloud.securityposture.v1.PolicyRule.StringValues) kind_; + } + return com.google.cloud.securityposture.v1.PolicyRule.StringValues.getDefaultInstance(); + } + /** + * + * + *
+   * List of values to be used for this policy rule. This field can be set
+   * only in policies for list constraints.
+   * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule.StringValuesOrBuilder getValuesOrBuilder() { + if (kindCase_ == 1) { + return (com.google.cloud.securityposture.v1.PolicyRule.StringValues) kind_; + } + return com.google.cloud.securityposture.v1.PolicyRule.StringValues.getDefaultInstance(); + } + + public static final int ALLOW_ALL_FIELD_NUMBER = 2; + /** + * + * + *
+   * Setting this to true means that all values are allowed. This field can
+   * be set only in policies for list constraints.
+   * 
+ * + * bool allow_all = 2; + * + * @return Whether the allowAll field is set. + */ + @java.lang.Override + public boolean hasAllowAll() { + return kindCase_ == 2; + } + /** + * + * + *
+   * Setting this to true means that all values are allowed. This field can
+   * be set only in policies for list constraints.
+   * 
+ * + * bool allow_all = 2; + * + * @return The allowAll. + */ + @java.lang.Override + public boolean getAllowAll() { + if (kindCase_ == 2) { + return (java.lang.Boolean) kind_; + } + return false; + } + + public static final int DENY_ALL_FIELD_NUMBER = 3; + /** + * + * + *
+   * Setting this to true means that all values are denied. This field can
+   * be set only in policies for list constraints.
+   * 
+ * + * bool deny_all = 3; + * + * @return Whether the denyAll field is set. + */ + @java.lang.Override + public boolean hasDenyAll() { + return kindCase_ == 3; + } + /** + * + * + *
+   * Setting this to true means that all values are denied. This field can
+   * be set only in policies for list constraints.
+   * 
+ * + * bool deny_all = 3; + * + * @return The denyAll. + */ + @java.lang.Override + public boolean getDenyAll() { + if (kindCase_ == 3) { + return (java.lang.Boolean) kind_; + } + return false; + } + + public static final int ENFORCE_FIELD_NUMBER = 4; + /** + * + * + *
+   * If `true`, then the policy is enforced. If `false`, then any
+   * configuration is acceptable.
+   * This field can be set only in policies for boolean constraints.
+   * 
+ * + * bool enforce = 4; + * + * @return Whether the enforce field is set. + */ + @java.lang.Override + public boolean hasEnforce() { + return kindCase_ == 4; + } + /** + * + * + *
+   * If `true`, then the policy is enforced. If `false`, then any
+   * configuration is acceptable.
+   * This field can be set only in policies for boolean constraints.
+   * 
+ * + * bool enforce = 4; + * + * @return The enforce. + */ + @java.lang.Override + public boolean getEnforce() { + if (kindCase_ == 4) { + return (java.lang.Boolean) kind_; + } + return false; + } + + public static final int CONDITION_FIELD_NUMBER = 5; + private com.google.type.Expr condition_; + /** + * + * + *
+   * A condition which determines whether this rule is used
+   * in the evaluation of the policy. When set, the `expression` field in
+   * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+   * or "&&" operators. Each subexpression must be of the form
+   * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+   * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+   * 'tagValues/value_id')" where key_name and value_name are the resource
+   * names for Label Keys and Values. These names are available from the Tag
+   * Manager Service. An example expression is:
+   * "resource.matchTag('123456789/environment,
+   * 'prod')" or "resource.matchTagId('tagKeys/123',
+   * 'tagValues/456')".
+   * 
+ * + * .google.type.Expr condition = 5; + * + * @return Whether the condition field is set. + */ + @java.lang.Override + public boolean hasCondition() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * A condition which determines whether this rule is used
+   * in the evaluation of the policy. When set, the `expression` field in
+   * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+   * or "&&" operators. Each subexpression must be of the form
+   * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+   * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+   * 'tagValues/value_id')" where key_name and value_name are the resource
+   * names for Label Keys and Values. These names are available from the Tag
+   * Manager Service. An example expression is:
+   * "resource.matchTag('123456789/environment,
+   * 'prod')" or "resource.matchTagId('tagKeys/123',
+   * 'tagValues/456')".
+   * 
+ * + * .google.type.Expr condition = 5; + * + * @return The condition. + */ + @java.lang.Override + public com.google.type.Expr getCondition() { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + /** + * + * + *
+   * A condition which determines whether this rule is used
+   * in the evaluation of the policy. When set, the `expression` field in
+   * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+   * or "&&" operators. Each subexpression must be of the form
+   * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+   * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+   * 'tagValues/value_id')" where key_name and value_name are the resource
+   * names for Label Keys and Values. These names are available from the Tag
+   * Manager Service. An example expression is:
+   * "resource.matchTag('123456789/environment,
+   * 'prod')" or "resource.matchTagId('tagKeys/123',
+   * 'tagValues/456')".
+   * 
+ * + * .google.type.Expr condition = 5; + */ + @java.lang.Override + public com.google.type.ExprOrBuilder getConditionOrBuilder() { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + + 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 (kindCase_ == 1) { + output.writeMessage(1, (com.google.cloud.securityposture.v1.PolicyRule.StringValues) kind_); + } + if (kindCase_ == 2) { + output.writeBool(2, (boolean) ((java.lang.Boolean) kind_)); + } + if (kindCase_ == 3) { + output.writeBool(3, (boolean) ((java.lang.Boolean) kind_)); + } + if (kindCase_ == 4) { + output.writeBool(4, (boolean) ((java.lang.Boolean) kind_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getCondition()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kindCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.securityposture.v1.PolicyRule.StringValues) kind_); + } + if (kindCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 2, (boolean) ((java.lang.Boolean) kind_)); + } + if (kindCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, (boolean) ((java.lang.Boolean) kind_)); + } + if (kindCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 4, (boolean) ((java.lang.Boolean) kind_)); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCondition()); + } + 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.securityposture.v1.PolicyRule)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.PolicyRule other = + (com.google.cloud.securityposture.v1.PolicyRule) obj; + + if (hasCondition() != other.hasCondition()) return false; + if (hasCondition()) { + if (!getCondition().equals(other.getCondition())) return false; + } + if (!getKindCase().equals(other.getKindCase())) return false; + switch (kindCase_) { + case 1: + if (!getValues().equals(other.getValues())) return false; + break; + case 2: + if (getAllowAll() != other.getAllowAll()) return false; + break; + case 3: + if (getDenyAll() != other.getDenyAll()) return false; + break; + case 4: + if (getEnforce() != other.getEnforce()) return false; + break; + case 0: + default: + } + 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 (hasCondition()) { + hash = (37 * hash) + CONDITION_FIELD_NUMBER; + hash = (53 * hash) + getCondition().hashCode(); + } + switch (kindCase_) { + case 1: + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValues().hashCode(); + break; + case 2: + hash = (37 * hash) + ALLOW_ALL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowAll()); + break; + case 3: + hash = (37 * hash) + DENY_ALL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDenyAll()); + break; + case 4: + hash = (37 * hash) + ENFORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnforce()); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.PolicyRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicyRule 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.securityposture.v1.PolicyRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicyRule 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.securityposture.v1.PolicyRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicyRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.PolicyRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicyRule 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.securityposture.v1.PolicyRule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicyRule 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.securityposture.v1.PolicyRule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicyRule 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.securityposture.v1.PolicyRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A rule used to express this policy.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PolicyRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.PolicyRule) + com.google.cloud.securityposture.v1.PolicyRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PolicyRule.class, + com.google.cloud.securityposture.v1.PolicyRule.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.PolicyRule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConditionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (valuesBuilder_ != null) { + valuesBuilder_.clear(); + } + condition_ = null; + if (conditionBuilder_ != null) { + conditionBuilder_.dispose(); + conditionBuilder_ = null; + } + kindCase_ = 0; + kind_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.OrgPolicyConfigProto + .internal_static_google_cloud_securityposture_v1_PolicyRule_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.PolicyRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule build() { + com.google.cloud.securityposture.v1.PolicyRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule buildPartial() { + com.google.cloud.securityposture.v1.PolicyRule result = + new com.google.cloud.securityposture.v1.PolicyRule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.PolicyRule result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.condition_ = conditionBuilder_ == null ? condition_ : conditionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.securityposture.v1.PolicyRule result) { + result.kindCase_ = kindCase_; + result.kind_ = this.kind_; + if (kindCase_ == 1 && valuesBuilder_ != null) { + result.kind_ = valuesBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.securityposture.v1.PolicyRule) { + return mergeFrom((com.google.cloud.securityposture.v1.PolicyRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.PolicyRule other) { + if (other == com.google.cloud.securityposture.v1.PolicyRule.getDefaultInstance()) return this; + if (other.hasCondition()) { + mergeCondition(other.getCondition()); + } + switch (other.getKindCase()) { + case VALUES: + { + mergeValues(other.getValues()); + break; + } + case ALLOW_ALL: + { + setAllowAll(other.getAllowAll()); + break; + } + case DENY_ALL: + { + setDenyAll(other.getDenyAll()); + break; + } + case ENFORCE: + { + setEnforce(other.getEnforce()); + break; + } + case KIND_NOT_SET: + { + break; + } + } + 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(getValuesFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 1; + break; + } // case 10 + case 16: + { + kind_ = input.readBool(); + kindCase_ = 2; + break; + } // case 16 + case 24: + { + kind_ = input.readBool(); + kindCase_ = 3; + break; + } // case 24 + case 32: + { + kind_ = input.readBool(); + kindCase_ = 4; + break; + } // case 32 + case 42: + { + input.readMessage(getConditionFieldBuilder().getBuilder(), extensionRegistry); + 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 kindCase_ = 0; + private java.lang.Object kind_; + + public KindCase getKindCase() { + return KindCase.forNumber(kindCase_); + } + + public Builder clearKind() { + kindCase_ = 0; + kind_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule.StringValues, + com.google.cloud.securityposture.v1.PolicyRule.StringValues.Builder, + com.google.cloud.securityposture.v1.PolicyRule.StringValuesOrBuilder> + valuesBuilder_; + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + * + * @return Whether the values field is set. + */ + @java.lang.Override + public boolean hasValues() { + return kindCase_ == 1; + } + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + * + * @return The values. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule.StringValues getValues() { + if (valuesBuilder_ == null) { + if (kindCase_ == 1) { + return (com.google.cloud.securityposture.v1.PolicyRule.StringValues) kind_; + } + return com.google.cloud.securityposture.v1.PolicyRule.StringValues.getDefaultInstance(); + } else { + if (kindCase_ == 1) { + return valuesBuilder_.getMessage(); + } + return com.google.cloud.securityposture.v1.PolicyRule.StringValues.getDefaultInstance(); + } + } + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + public Builder setValues(com.google.cloud.securityposture.v1.PolicyRule.StringValues value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + kind_ = value; + onChanged(); + } else { + valuesBuilder_.setMessage(value); + } + kindCase_ = 1; + return this; + } + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + public Builder setValues( + com.google.cloud.securityposture.v1.PolicyRule.StringValues.Builder builderForValue) { + if (valuesBuilder_ == null) { + kind_ = builderForValue.build(); + onChanged(); + } else { + valuesBuilder_.setMessage(builderForValue.build()); + } + kindCase_ = 1; + return this; + } + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + public Builder mergeValues(com.google.cloud.securityposture.v1.PolicyRule.StringValues value) { + if (valuesBuilder_ == null) { + if (kindCase_ == 1 + && kind_ + != com.google.cloud.securityposture.v1.PolicyRule.StringValues + .getDefaultInstance()) { + kind_ = + com.google.cloud.securityposture.v1.PolicyRule.StringValues.newBuilder( + (com.google.cloud.securityposture.v1.PolicyRule.StringValues) kind_) + .mergeFrom(value) + .buildPartial(); + } else { + kind_ = value; + } + onChanged(); + } else { + if (kindCase_ == 1) { + valuesBuilder_.mergeFrom(value); + } else { + valuesBuilder_.setMessage(value); + } + } + kindCase_ = 1; + return this; + } + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + } else { + if (kindCase_ == 1) { + kindCase_ = 0; + kind_ = null; + } + valuesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + public com.google.cloud.securityposture.v1.PolicyRule.StringValues.Builder getValuesBuilder() { + return getValuesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyRule.StringValuesOrBuilder + getValuesOrBuilder() { + if ((kindCase_ == 1) && (valuesBuilder_ != null)) { + return valuesBuilder_.getMessageOrBuilder(); + } else { + if (kindCase_ == 1) { + return (com.google.cloud.securityposture.v1.PolicyRule.StringValues) kind_; + } + return com.google.cloud.securityposture.v1.PolicyRule.StringValues.getDefaultInstance(); + } + } + /** + * + * + *
+     * List of values to be used for this policy rule. This field can be set
+     * only in policies for list constraints.
+     * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule.StringValues, + com.google.cloud.securityposture.v1.PolicyRule.StringValues.Builder, + com.google.cloud.securityposture.v1.PolicyRule.StringValuesOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + if (!(kindCase_ == 1)) { + kind_ = com.google.cloud.securityposture.v1.PolicyRule.StringValues.getDefaultInstance(); + } + valuesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicyRule.StringValues, + com.google.cloud.securityposture.v1.PolicyRule.StringValues.Builder, + com.google.cloud.securityposture.v1.PolicyRule.StringValuesOrBuilder>( + (com.google.cloud.securityposture.v1.PolicyRule.StringValues) kind_, + getParentForChildren(), + isClean()); + kind_ = null; + } + kindCase_ = 1; + onChanged(); + return valuesBuilder_; + } + + /** + * + * + *
+     * Setting this to true means that all values are allowed. This field can
+     * be set only in policies for list constraints.
+     * 
+ * + * bool allow_all = 2; + * + * @return Whether the allowAll field is set. + */ + public boolean hasAllowAll() { + return kindCase_ == 2; + } + /** + * + * + *
+     * Setting this to true means that all values are allowed. This field can
+     * be set only in policies for list constraints.
+     * 
+ * + * bool allow_all = 2; + * + * @return The allowAll. + */ + public boolean getAllowAll() { + if (kindCase_ == 2) { + return (java.lang.Boolean) kind_; + } + return false; + } + /** + * + * + *
+     * Setting this to true means that all values are allowed. This field can
+     * be set only in policies for list constraints.
+     * 
+ * + * bool allow_all = 2; + * + * @param value The allowAll to set. + * @return This builder for chaining. + */ + public Builder setAllowAll(boolean value) { + + kindCase_ = 2; + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Setting this to true means that all values are allowed. This field can
+     * be set only in policies for list constraints.
+     * 
+ * + * bool allow_all = 2; + * + * @return This builder for chaining. + */ + public Builder clearAllowAll() { + if (kindCase_ == 2) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Setting this to true means that all values are denied. This field can
+     * be set only in policies for list constraints.
+     * 
+ * + * bool deny_all = 3; + * + * @return Whether the denyAll field is set. + */ + public boolean hasDenyAll() { + return kindCase_ == 3; + } + /** + * + * + *
+     * Setting this to true means that all values are denied. This field can
+     * be set only in policies for list constraints.
+     * 
+ * + * bool deny_all = 3; + * + * @return The denyAll. + */ + public boolean getDenyAll() { + if (kindCase_ == 3) { + return (java.lang.Boolean) kind_; + } + return false; + } + /** + * + * + *
+     * Setting this to true means that all values are denied. This field can
+     * be set only in policies for list constraints.
+     * 
+ * + * bool deny_all = 3; + * + * @param value The denyAll to set. + * @return This builder for chaining. + */ + public Builder setDenyAll(boolean value) { + + kindCase_ = 3; + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Setting this to true means that all values are denied. This field can
+     * be set only in policies for list constraints.
+     * 
+ * + * bool deny_all = 3; + * + * @return This builder for chaining. + */ + public Builder clearDenyAll() { + if (kindCase_ == 3) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * If `true`, then the policy is enforced. If `false`, then any
+     * configuration is acceptable.
+     * This field can be set only in policies for boolean constraints.
+     * 
+ * + * bool enforce = 4; + * + * @return Whether the enforce field is set. + */ + public boolean hasEnforce() { + return kindCase_ == 4; + } + /** + * + * + *
+     * If `true`, then the policy is enforced. If `false`, then any
+     * configuration is acceptable.
+     * This field can be set only in policies for boolean constraints.
+     * 
+ * + * bool enforce = 4; + * + * @return The enforce. + */ + public boolean getEnforce() { + if (kindCase_ == 4) { + return (java.lang.Boolean) kind_; + } + return false; + } + /** + * + * + *
+     * If `true`, then the policy is enforced. If `false`, then any
+     * configuration is acceptable.
+     * This field can be set only in policies for boolean constraints.
+     * 
+ * + * bool enforce = 4; + * + * @param value The enforce to set. + * @return This builder for chaining. + */ + public Builder setEnforce(boolean value) { + + kindCase_ = 4; + kind_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If `true`, then the policy is enforced. If `false`, then any
+     * configuration is acceptable.
+     * This field can be set only in policies for boolean constraints.
+     * 
+ * + * bool enforce = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnforce() { + if (kindCase_ == 4) { + kindCase_ = 0; + kind_ = null; + onChanged(); + } + return this; + } + + private com.google.type.Expr condition_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + conditionBuilder_; + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + * + * @return Whether the condition field is set. + */ + public boolean hasCondition() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + * + * @return The condition. + */ + public com.google.type.Expr getCondition() { + if (conditionBuilder_ == null) { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } else { + return conditionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + */ + public Builder setCondition(com.google.type.Expr value) { + if (conditionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + condition_ = value; + } else { + conditionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + */ + public Builder setCondition(com.google.type.Expr.Builder builderForValue) { + if (conditionBuilder_ == null) { + condition_ = builderForValue.build(); + } else { + conditionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + */ + public Builder mergeCondition(com.google.type.Expr value) { + if (conditionBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && condition_ != null + && condition_ != com.google.type.Expr.getDefaultInstance()) { + getConditionBuilder().mergeFrom(value); + } else { + condition_ = value; + } + } else { + conditionBuilder_.mergeFrom(value); + } + if (condition_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + */ + public Builder clearCondition() { + bitField0_ = (bitField0_ & ~0x00000010); + condition_ = null; + if (conditionBuilder_ != null) { + conditionBuilder_.dispose(); + conditionBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + */ + public com.google.type.Expr.Builder getConditionBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getConditionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + */ + public com.google.type.ExprOrBuilder getConditionOrBuilder() { + if (conditionBuilder_ != null) { + return conditionBuilder_.getMessageOrBuilder(); + } else { + return condition_ == null ? com.google.type.Expr.getDefaultInstance() : condition_; + } + } + /** + * + * + *
+     * A condition which determines whether this rule is used
+     * in the evaluation of the policy. When set, the `expression` field in
+     * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+     * or "&&" operators. Each subexpression must be of the form
+     * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+     * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+     * 'tagValues/value_id')" where key_name and value_name are the resource
+     * names for Label Keys and Values. These names are available from the Tag
+     * Manager Service. An example expression is:
+     * "resource.matchTag('123456789/environment,
+     * 'prod')" or "resource.matchTagId('tagKeys/123',
+     * 'tagValues/456')".
+     * 
+ * + * .google.type.Expr condition = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder> + getConditionFieldBuilder() { + if (conditionBuilder_ == null) { + conditionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.type.Expr, com.google.type.Expr.Builder, com.google.type.ExprOrBuilder>( + getCondition(), getParentForChildren(), isClean()); + condition_ = null; + } + return conditionBuilder_; + } + + @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.securityposture.v1.PolicyRule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.PolicyRule) + private static final com.google.cloud.securityposture.v1.PolicyRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.PolicyRule(); + } + + public static com.google.cloud.securityposture.v1.PolicyRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicyRule 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.securityposture.v1.PolicyRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyRuleOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyRuleOrBuilder.java new file mode 100644 index 000000000000..f8b82d0b5d82 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicyRuleOrBuilder.java @@ -0,0 +1,217 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securityposture/v1/org_policy_config.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface PolicyRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.PolicyRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of values to be used for this policy rule. This field can be set
+   * only in policies for list constraints.
+   * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + * + * @return Whether the values field is set. + */ + boolean hasValues(); + /** + * + * + *
+   * List of values to be used for this policy rule. This field can be set
+   * only in policies for list constraints.
+   * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + * + * @return The values. + */ + com.google.cloud.securityposture.v1.PolicyRule.StringValues getValues(); + /** + * + * + *
+   * List of values to be used for this policy rule. This field can be set
+   * only in policies for list constraints.
+   * 
+ * + * .google.cloud.securityposture.v1.PolicyRule.StringValues values = 1; + */ + com.google.cloud.securityposture.v1.PolicyRule.StringValuesOrBuilder getValuesOrBuilder(); + + /** + * + * + *
+   * Setting this to true means that all values are allowed. This field can
+   * be set only in policies for list constraints.
+   * 
+ * + * bool allow_all = 2; + * + * @return Whether the allowAll field is set. + */ + boolean hasAllowAll(); + /** + * + * + *
+   * Setting this to true means that all values are allowed. This field can
+   * be set only in policies for list constraints.
+   * 
+ * + * bool allow_all = 2; + * + * @return The allowAll. + */ + boolean getAllowAll(); + + /** + * + * + *
+   * Setting this to true means that all values are denied. This field can
+   * be set only in policies for list constraints.
+   * 
+ * + * bool deny_all = 3; + * + * @return Whether the denyAll field is set. + */ + boolean hasDenyAll(); + /** + * + * + *
+   * Setting this to true means that all values are denied. This field can
+   * be set only in policies for list constraints.
+   * 
+ * + * bool deny_all = 3; + * + * @return The denyAll. + */ + boolean getDenyAll(); + + /** + * + * + *
+   * If `true`, then the policy is enforced. If `false`, then any
+   * configuration is acceptable.
+   * This field can be set only in policies for boolean constraints.
+   * 
+ * + * bool enforce = 4; + * + * @return Whether the enforce field is set. + */ + boolean hasEnforce(); + /** + * + * + *
+   * If `true`, then the policy is enforced. If `false`, then any
+   * configuration is acceptable.
+   * This field can be set only in policies for boolean constraints.
+   * 
+ * + * bool enforce = 4; + * + * @return The enforce. + */ + boolean getEnforce(); + + /** + * + * + *
+   * A condition which determines whether this rule is used
+   * in the evaluation of the policy. When set, the `expression` field in
+   * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+   * or "&&" operators. Each subexpression must be of the form
+   * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+   * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+   * 'tagValues/value_id')" where key_name and value_name are the resource
+   * names for Label Keys and Values. These names are available from the Tag
+   * Manager Service. An example expression is:
+   * "resource.matchTag('123456789/environment,
+   * 'prod')" or "resource.matchTagId('tagKeys/123',
+   * 'tagValues/456')".
+   * 
+ * + * .google.type.Expr condition = 5; + * + * @return Whether the condition field is set. + */ + boolean hasCondition(); + /** + * + * + *
+   * A condition which determines whether this rule is used
+   * in the evaluation of the policy. When set, the `expression` field in
+   * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+   * or "&&" operators. Each subexpression must be of the form
+   * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+   * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+   * 'tagValues/value_id')" where key_name and value_name are the resource
+   * names for Label Keys and Values. These names are available from the Tag
+   * Manager Service. An example expression is:
+   * "resource.matchTag('123456789/environment,
+   * 'prod')" or "resource.matchTagId('tagKeys/123',
+   * 'tagValues/456')".
+   * 
+ * + * .google.type.Expr condition = 5; + * + * @return The condition. + */ + com.google.type.Expr getCondition(); + /** + * + * + *
+   * A condition which determines whether this rule is used
+   * in the evaluation of the policy. When set, the `expression` field in
+   * the `Expr' must include from 1 to 10 subexpressions, joined by the "||"
+   * or "&&" operators. Each subexpression must be of the form
+   * "resource.matchTag('<ORG_ID>/tag_key_short_name,
+   * 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id',
+   * 'tagValues/value_id')" where key_name and value_name are the resource
+   * names for Label Keys and Values. These names are available from the Tag
+   * Manager Service. An example expression is:
+   * "resource.matchTag('123456789/environment,
+   * 'prod')" or "resource.matchTagId('tagKeys/123',
+   * 'tagValues/456')".
+   * 
+ * + * .google.type.Expr condition = 5; + */ + com.google.type.ExprOrBuilder getConditionOrBuilder(); + + com.google.cloud.securityposture.v1.PolicyRule.KindCase getKindCase(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicySet.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicySet.java new file mode 100644 index 000000000000..34804fc5e4b8 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicySet.java @@ -0,0 +1,1344 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * PolicySet representation.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PolicySet} + */ +public final class PolicySet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.PolicySet) + PolicySetOrBuilder { + private static final long serialVersionUID = 0L; + // Use PolicySet.newBuilder() to construct. + private PolicySet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PolicySet() { + policySetId_ = ""; + description_ = ""; + policies_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PolicySet(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PolicySet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PolicySet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PolicySet.class, + com.google.cloud.securityposture.v1.PolicySet.Builder.class); + } + + public static final int POLICY_SET_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object policySetId_ = ""; + /** + * + * + *
+   * Required. ID of the Policy set.
+   * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policySetId. + */ + @java.lang.Override + public java.lang.String getPolicySetId() { + java.lang.Object ref = policySetId_; + 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(); + policySetId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. ID of the Policy set.
+   * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policySetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPolicySetIdBytes() { + java.lang.Object ref = policySetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policySetId_ = 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_ = ""; + /** + * + * + *
+   * Optional. Description of the Policy set.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. Description of the Policy set.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 POLICIES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private java.util.List policies_; + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getPoliciesList() { + return policies_; + } + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPoliciesOrBuilderList() { + return policies_; + } + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPoliciesCount() { + return policies_.size(); + } + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Policy getPolicies(int index) { + return policies_.get(index); + } + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicyOrBuilder getPoliciesOrBuilder(int index) { + return policies_.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(policySetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, policySetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + for (int i = 0; i < policies_.size(); i++) { + output.writeMessage(3, policies_.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(policySetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, policySetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + for (int i = 0; i < policies_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, policies_.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.securityposture.v1.PolicySet)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.PolicySet other = + (com.google.cloud.securityposture.v1.PolicySet) obj; + + if (!getPolicySetId().equals(other.getPolicySetId())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getPoliciesList().equals(other.getPoliciesList())) 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) + POLICY_SET_ID_FIELD_NUMBER; + hash = (53 * hash) + getPolicySetId().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getPoliciesCount() > 0) { + hash = (37 * hash) + POLICIES_FIELD_NUMBER; + hash = (53 * hash) + getPoliciesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.PolicySet parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicySet 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.securityposture.v1.PolicySet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicySet 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.securityposture.v1.PolicySet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PolicySet parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.PolicySet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicySet 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.securityposture.v1.PolicySet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicySet 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.securityposture.v1.PolicySet parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PolicySet 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.securityposture.v1.PolicySet 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; + } + /** + * + * + *
+   * PolicySet representation.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PolicySet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.PolicySet) + com.google.cloud.securityposture.v1.PolicySetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PolicySet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PolicySet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PolicySet.class, + com.google.cloud.securityposture.v1.PolicySet.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.PolicySet.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + policySetId_ = ""; + description_ = ""; + if (policiesBuilder_ == null) { + policies_ = java.util.Collections.emptyList(); + } else { + policies_ = null; + policiesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PolicySet_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicySet getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.PolicySet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicySet build() { + com.google.cloud.securityposture.v1.PolicySet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicySet buildPartial() { + com.google.cloud.securityposture.v1.PolicySet result = + new com.google.cloud.securityposture.v1.PolicySet(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.securityposture.v1.PolicySet result) { + if (policiesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + policies_ = java.util.Collections.unmodifiableList(policies_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.policies_ = policies_; + } else { + result.policies_ = policiesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securityposture.v1.PolicySet result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.policySetId_ = policySetId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + } + + @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.securityposture.v1.PolicySet) { + return mergeFrom((com.google.cloud.securityposture.v1.PolicySet) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.PolicySet other) { + if (other == com.google.cloud.securityposture.v1.PolicySet.getDefaultInstance()) return this; + if (!other.getPolicySetId().isEmpty()) { + policySetId_ = other.policySetId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (policiesBuilder_ == null) { + if (!other.policies_.isEmpty()) { + if (policies_.isEmpty()) { + policies_ = other.policies_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePoliciesIsMutable(); + policies_.addAll(other.policies_); + } + onChanged(); + } + } else { + if (!other.policies_.isEmpty()) { + if (policiesBuilder_.isEmpty()) { + policiesBuilder_.dispose(); + policiesBuilder_ = null; + policies_ = other.policies_; + bitField0_ = (bitField0_ & ~0x00000004); + policiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPoliciesFieldBuilder() + : null; + } else { + policiesBuilder_.addAllMessages(other.policies_); + } + } + } + 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: + { + policySetId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.cloud.securityposture.v1.Policy m = + input.readMessage( + com.google.cloud.securityposture.v1.Policy.parser(), extensionRegistry); + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(m); + } else { + policiesBuilder_.addMessage(m); + } + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object policySetId_ = ""; + /** + * + * + *
+     * Required. ID of the Policy set.
+     * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policySetId. + */ + public java.lang.String getPolicySetId() { + java.lang.Object ref = policySetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + policySetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. ID of the Policy set.
+     * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policySetId. + */ + public com.google.protobuf.ByteString getPolicySetIdBytes() { + java.lang.Object ref = policySetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + policySetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. ID of the Policy set.
+     * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The policySetId to set. + * @return This builder for chaining. + */ + public Builder setPolicySetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + policySetId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the Policy set.
+     * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPolicySetId() { + policySetId_ = getDefaultInstance().getPolicySetId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. ID of the Policy set.
+     * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for policySetId to set. + * @return This builder for chaining. + */ + public Builder setPolicySetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + policySetId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. Description of the Policy set.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Description of the Policy set.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. Description of the Policy set.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. Description of the Policy set.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Description of the Policy set.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 java.util.List policies_ = + java.util.Collections.emptyList(); + + private void ensurePoliciesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + policies_ = new java.util.ArrayList(policies_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Policy, + com.google.cloud.securityposture.v1.Policy.Builder, + com.google.cloud.securityposture.v1.PolicyOrBuilder> + policiesBuilder_; + + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPoliciesList() { + if (policiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(policies_); + } else { + return policiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPoliciesCount() { + if (policiesBuilder_ == null) { + return policies_.size(); + } else { + return policiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.Policy getPolicies(int index) { + if (policiesBuilder_ == null) { + return policies_.get(index); + } else { + return policiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicies(int index, com.google.cloud.securityposture.v1.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.set(index, value); + onChanged(); + } else { + policiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicies( + int index, com.google.cloud.securityposture.v1.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.set(index, builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicies(com.google.cloud.securityposture.v1.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.add(value); + onChanged(); + } else { + policiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicies(int index, com.google.cloud.securityposture.v1.Policy value) { + if (policiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePoliciesIsMutable(); + policies_.add(index, value); + onChanged(); + } else { + policiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicies(com.google.cloud.securityposture.v1.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicies( + int index, com.google.cloud.securityposture.v1.Policy.Builder builderForValue) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.add(index, builderForValue.build()); + onChanged(); + } else { + policiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllPolicies( + java.lang.Iterable values) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policies_); + onChanged(); + } else { + policiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPolicies() { + if (policiesBuilder_ == null) { + policies_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + policiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removePolicies(int index) { + if (policiesBuilder_ == null) { + ensurePoliciesIsMutable(); + policies_.remove(index); + onChanged(); + } else { + policiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.Policy.Builder getPoliciesBuilder(int index) { + return getPoliciesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicyOrBuilder getPoliciesOrBuilder(int index) { + if (policiesBuilder_ == null) { + return policies_.get(index); + } else { + return policiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPoliciesOrBuilderList() { + if (policiesBuilder_ != null) { + return policiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policies_); + } + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.Policy.Builder addPoliciesBuilder() { + return getPoliciesFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.Policy.getDefaultInstance()); + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.Policy.Builder addPoliciesBuilder(int index) { + return getPoliciesFieldBuilder() + .addBuilder(index, com.google.cloud.securityposture.v1.Policy.getDefaultInstance()); + } + /** + * + * + *
+     * Required. List of policies.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPoliciesBuilderList() { + return getPoliciesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Policy, + com.google.cloud.securityposture.v1.Policy.Builder, + com.google.cloud.securityposture.v1.PolicyOrBuilder> + getPoliciesFieldBuilder() { + if (policiesBuilder_ == null) { + policiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.Policy, + com.google.cloud.securityposture.v1.Policy.Builder, + com.google.cloud.securityposture.v1.PolicyOrBuilder>( + policies_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + policies_ = null; + } + return policiesBuilder_; + } + + @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.securityposture.v1.PolicySet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.PolicySet) + private static final com.google.cloud.securityposture.v1.PolicySet DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.PolicySet(); + } + + public static com.google.cloud.securityposture.v1.PolicySet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PolicySet 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.securityposture.v1.PolicySet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicySetOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicySetOrBuilder.java new file mode 100644 index 000000000000..d00ee3992809 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PolicySetOrBuilder.java @@ -0,0 +1,138 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface PolicySetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.PolicySet) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. ID of the Policy set.
+   * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The policySetId. + */ + java.lang.String getPolicySetId(); + /** + * + * + *
+   * Required. ID of the Policy set.
+   * 
+ * + * string policy_set_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for policySetId. + */ + com.google.protobuf.ByteString getPolicySetIdBytes(); + + /** + * + * + *
+   * Optional. Description of the Policy set.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. Description of the Policy set.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPoliciesList(); + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.Policy getPolicies(int index); + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPoliciesCount(); + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPoliciesOrBuilderList(); + /** + * + * + *
+   * Required. List of policies.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.Policy policies = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PolicyOrBuilder getPoliciesOrBuilder(int index); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Posture.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Posture.java new file mode 100644 index 000000000000..fa9c6793ef32 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/Posture.java @@ -0,0 +1,3219 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Postures
+ * Definition of a Posture.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.Posture} + */ +public final class Posture extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.Posture) + PostureOrBuilder { + private static final long serialVersionUID = 0L; + // Use Posture.newBuilder() to construct. + private Posture(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Posture() { + name_ = ""; + state_ = 0; + revisionId_ = ""; + description_ = ""; + policySets_ = java.util.Collections.emptyList(); + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Posture(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Posture_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Posture_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.Posture.class, + com.google.cloud.securityposture.v1.Posture.Builder.class); + } + + /** + * + * + *
+   * State of a Posture.
+   * 
+ * + * Protobuf enum {@code google.cloud.securityposture.v1.Posture.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified operation state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The Posture is marked deprecated when it is not in use by the user.
+     * 
+ * + * DEPRECATED = 1; + */ + DEPRECATED(1), + /** + * + * + *
+     * The Posture is created successfully but is not yet ready for usage.
+     * 
+ * + * DRAFT = 2; + */ + DRAFT(2), + /** + * + * + *
+     * The Posture state is active. Ready for use/deployments.
+     * 
+ * + * ACTIVE = 3; + */ + ACTIVE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified operation state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The Posture is marked deprecated when it is not in use by the user.
+     * 
+ * + * DEPRECATED = 1; + */ + public static final int DEPRECATED_VALUE = 1; + /** + * + * + *
+     * The Posture is created successfully but is not yet ready for usage.
+     * 
+ * + * DRAFT = 2; + */ + public static final int DRAFT_VALUE = 2; + /** + * + * + *
+     * The Posture state is active. Ready for use/deployments.
+     * 
+ * + * ACTIVE = 3; + */ + public static final int ACTIVE_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 DEPRECATED; + case 2: + return DRAFT; + case 3: + return ACTIVE; + 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.securityposture.v1.Posture.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.securityposture.v1.Posture.State) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Identifier. The name of this Posture resource, in the format of
+   * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + /** + * + * + *
+   * Required. Identifier. The name of this Posture resource, in the format of
+   * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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 STATE_FIELD_NUMBER = 2; + private int state_ = 0; + /** + * + * + *
+   * Required. State of Posture resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Required. State of Posture resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture.State getState() { + com.google.cloud.securityposture.v1.Posture.State result = + com.google.cloud.securityposture.v1.Posture.State.forNumber(state_); + return result == null ? com.google.cloud.securityposture.v1.Posture.State.UNRECOGNIZED : result; + } + + public static final int REVISION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object revisionId_ = ""; + /** + * + * + *
+   * Output only. Immutable. The revision ID of the posture.
+   * The format is an 8-character hexadecimal string.
+   * https://google.aip.dev/162
+   * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The revisionId. + */ + @java.lang.Override + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + 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(); + revisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Immutable. The revision ID of the posture.
+   * The format is an 8-character hexadecimal string.
+   * https://google.aip.dev/162
+   * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for revisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp that the posture was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 timestamp that the posture was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 timestamp that the posture was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp that the posture was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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 timestamp that the posture was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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 timestamp that the posture was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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 DESCRIPTION_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. User provided description of the posture.
+   * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. User provided description of the posture.
+   * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 POLICY_SETS_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private java.util.List policySets_; + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getPolicySetsList() { + return policySets_; + } + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPolicySetsOrBuilderList() { + return policySets_; + } + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPolicySetsCount() { + return policySets_.size(); + } + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicySet getPolicySets(int index) { + return policySets_.get(index); + } + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicySetOrBuilder getPolicySetsOrBuilder(int index) { + return policySets_.get(index); + } + + public static final int ETAG_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. An opaque tag indicating the current version of the Posture, used
+   * for concurrency control. When the `Posture` is returned from either a
+   * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+   * of the current `Posture` to use when executing a read-modify-write loop.
+   *
+   * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+   * value that was returned from a `GetPosture` request as part of a
+   * read-modify-write loop for concurrency control. Not setting the `etag` in a
+   * `UpdatePosture` request will result in an unconditional write of the
+   * `Posture`.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An opaque tag indicating the current version of the Posture, used
+   * for concurrency control. When the `Posture` is returned from either a
+   * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+   * of the current `Posture` to use when executing a read-modify-write loop.
+   *
+   * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+   * value that was returned from a `GetPosture` request as part of a
+   * read-modify-write loop for concurrency control. Not setting the `etag` in a
+   * `UpdatePosture` request will result in an unconditional write of the
+   * `Posture`.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 9; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Posture_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RECONCILING_FIELD_NUMBER = 10; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Whether or not this Posture is in the process of being
+   * updated.
+   * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + 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 (state_ != com.google.cloud.securityposture.v1.Posture.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, revisionId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + } + for (int i = 0; i < policySets_.size(); i++) { + output.writeMessage(7, policySets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 9); + if (reconciling_ != false) { + output.writeBool(10, reconciling_); + } + 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 (state_ != com.google.cloud.securityposture.v1.Posture.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, revisionId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + } + for (int i = 0; i < policySets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, policySets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, etag_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, annotations__); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, reconciling_); + } + 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.securityposture.v1.Posture)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.Posture other = + (com.google.cloud.securityposture.v1.Posture) obj; + + if (!getName().equals(other.getName())) return false; + if (state_ != other.state_) return false; + if (!getRevisionId().equals(other.getRevisionId())) 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 (!getDescription().equals(other.getDescription())) return false; + if (!getPolicySetsList().equals(other.getPolicySetsList())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (getReconciling() != other.getReconciling()) 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) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getPolicySetsCount() > 0) { + hash = (37 * hash) + POLICY_SETS_FIELD_NUMBER; + hash = (53 * hash) + getPolicySetsList().hashCode(); + } + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.Posture parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Posture 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.securityposture.v1.Posture parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Posture 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.securityposture.v1.Posture parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.Posture parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.Posture parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Posture 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.securityposture.v1.Posture parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Posture 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.securityposture.v1.Posture parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.Posture 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.securityposture.v1.Posture 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; + } + /** + * + * + *
+   * Postures
+   * Definition of a Posture.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.Posture} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.Posture) + com.google.cloud.securityposture.v1.PostureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Posture_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Posture_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.Posture.class, + com.google.cloud.securityposture.v1.Posture.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.Posture.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(); + getUpdateTimeFieldBuilder(); + getPolicySetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + state_ = 0; + revisionId_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + description_ = ""; + if (policySetsBuilder_ == null) { + policySets_ = java.util.Collections.emptyList(); + } else { + policySets_ = null; + policySetsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000040); + etag_ = ""; + internalGetMutableAnnotations().clear(); + reconciling_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_Posture_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.Posture.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture build() { + com.google.cloud.securityposture.v1.Posture result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture buildPartial() { + com.google.cloud.securityposture.v1.Posture result = + new com.google.cloud.securityposture.v1.Posture(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.securityposture.v1.Posture result) { + if (policySetsBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0)) { + policySets_ = java.util.Collections.unmodifiableList(policySets_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.policySets_ = policySets_; + } else { + result.policySets_ = policySetsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securityposture.v1.Posture result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.revisionId_ = revisionId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.reconciling_ = reconciling_; + } + 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.securityposture.v1.Posture) { + return mergeFrom((com.google.cloud.securityposture.v1.Posture) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.Posture other) { + if (other == com.google.cloud.securityposture.v1.Posture.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (policySetsBuilder_ == null) { + if (!other.policySets_.isEmpty()) { + if (policySets_.isEmpty()) { + policySets_ = other.policySets_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensurePolicySetsIsMutable(); + policySets_.addAll(other.policySets_); + } + onChanged(); + } + } else { + if (!other.policySets_.isEmpty()) { + if (policySetsBuilder_.isEmpty()) { + policySetsBuilder_.dispose(); + policySetsBuilder_ = null; + policySets_ = other.policySets_; + bitField0_ = (bitField0_ & ~0x00000040); + policySetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPolicySetsFieldBuilder() + : null; + } else { + policySetsBuilder_.addAllMessages(other.policySets_); + } + } + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000080; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000100; + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + 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: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + revisionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + com.google.cloud.securityposture.v1.PolicySet m = + input.readMessage( + com.google.cloud.securityposture.v1.PolicySet.parser(), extensionRegistry); + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.add(m); + } else { + policySetsBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 74: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000100; + break; + } // case 74 + case 80: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00000200; + break; + } // case 80 + 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. Identifier. The name of this Posture resource, in the format of
+     * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + /** + * + * + *
+     * Required. Identifier. The name of this Posture resource, in the format of
+     * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + } + /** + * + * + *
+     * Required. Identifier. The name of this Posture resource, in the format of
+     * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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; + } + /** + * + * + *
+     * Required. Identifier. The name of this Posture resource, in the format of
+     * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Identifier. The name of this Posture resource, in the format of
+     * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.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 int state_ = 0; + /** + * + * + *
+     * Required. State of Posture resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Required. State of Posture resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. State of Posture resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture.State getState() { + com.google.cloud.securityposture.v1.Posture.State result = + com.google.cloud.securityposture.v1.Posture.State.forNumber(state_); + return result == null + ? com.google.cloud.securityposture.v1.Posture.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. State of Posture resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.securityposture.v1.Posture.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. State of Posture resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000002); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object revisionId_ = ""; + /** + * + * + *
+     * Output only. Immutable. The revision ID of the posture.
+     * The format is an 8-character hexadecimal string.
+     * https://google.aip.dev/162
+     * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The revisionId. + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The revision ID of the posture.
+     * The format is an 8-character hexadecimal string.
+     * https://google.aip.dev/162
+     * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for revisionId. + */ + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Immutable. The revision ID of the posture.
+     * The format is an 8-character hexadecimal string.
+     * https://google.aip.dev/162
+     * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The revision ID of the posture.
+     * The format is an 8-character hexadecimal string.
+     * https://google.aip.dev/162
+     * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearRevisionId() { + revisionId_ = getDefaultInstance().getRevisionId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The revision ID of the posture.
+     * The format is an 8-character hexadecimal string.
+     * https://google.aip.dev/162
+     * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionId_ = value; + bitField0_ |= 0x00000004; + 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. The timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 timestamp that the posture was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + 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 timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. The timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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 timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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 timestamp that the posture was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. User provided description of the posture.
+     * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. User provided description of the posture.
+     * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. User provided description of the posture.
+     * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User provided description of the posture.
+     * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User provided description of the posture.
+     * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ |= 0x00000020; + onChanged(); + return this; + } + + private java.util.List policySets_ = + java.util.Collections.emptyList(); + + private void ensurePolicySetsIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + policySets_ = + new java.util.ArrayList(policySets_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicySet, + com.google.cloud.securityposture.v1.PolicySet.Builder, + com.google.cloud.securityposture.v1.PolicySetOrBuilder> + policySetsBuilder_; + + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPolicySetsList() { + if (policySetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(policySets_); + } else { + return policySetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPolicySetsCount() { + if (policySetsBuilder_ == null) { + return policySets_.size(); + } else { + return policySetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicySet getPolicySets(int index) { + if (policySetsBuilder_ == null) { + return policySets_.get(index); + } else { + return policySetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicySets(int index, com.google.cloud.securityposture.v1.PolicySet value) { + if (policySetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicySetsIsMutable(); + policySets_.set(index, value); + onChanged(); + } else { + policySetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPolicySets( + int index, com.google.cloud.securityposture.v1.PolicySet.Builder builderForValue) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.set(index, builderForValue.build()); + onChanged(); + } else { + policySetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicySets(com.google.cloud.securityposture.v1.PolicySet value) { + if (policySetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicySetsIsMutable(); + policySets_.add(value); + onChanged(); + } else { + policySetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicySets(int index, com.google.cloud.securityposture.v1.PolicySet value) { + if (policySetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicySetsIsMutable(); + policySets_.add(index, value); + onChanged(); + } else { + policySetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicySets( + com.google.cloud.securityposture.v1.PolicySet.Builder builderForValue) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.add(builderForValue.build()); + onChanged(); + } else { + policySetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPolicySets( + int index, com.google.cloud.securityposture.v1.PolicySet.Builder builderForValue) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.add(index, builderForValue.build()); + onChanged(); + } else { + policySetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllPolicySets( + java.lang.Iterable values) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policySets_); + onChanged(); + } else { + policySetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPolicySets() { + if (policySetsBuilder_ == null) { + policySets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + policySetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removePolicySets(int index) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.remove(index); + onChanged(); + } else { + policySetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicySet.Builder getPolicySetsBuilder(int index) { + return getPolicySetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicySetOrBuilder getPolicySetsOrBuilder( + int index) { + if (policySetsBuilder_ == null) { + return policySets_.get(index); + } else { + return policySetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPolicySetsOrBuilderList() { + if (policySetsBuilder_ != null) { + return policySetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policySets_); + } + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicySet.Builder addPolicySetsBuilder() { + return getPolicySetsFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.PolicySet.getDefaultInstance()); + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PolicySet.Builder addPolicySetsBuilder(int index) { + return getPolicySetsFieldBuilder() + .addBuilder(index, com.google.cloud.securityposture.v1.PolicySet.getDefaultInstance()); + } + /** + * + * + *
+     * Required. List of Policy sets.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPolicySetsBuilderList() { + return getPolicySetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicySet, + com.google.cloud.securityposture.v1.PolicySet.Builder, + com.google.cloud.securityposture.v1.PolicySetOrBuilder> + getPolicySetsFieldBuilder() { + if (policySetsBuilder_ == null) { + policySetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicySet, + com.google.cloud.securityposture.v1.PolicySet.Builder, + com.google.cloud.securityposture.v1.PolicySetOrBuilder>( + policySets_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + policySets_ = null; + } + return policySetsBuilder_; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the Posture, used
+     * for concurrency control. When the `Posture` is returned from either a
+     * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+     * of the current `Posture` to use when executing a read-modify-write loop.
+     *
+     * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+     * value that was returned from a `GetPosture` request as part of a
+     * read-modify-write loop for concurrency control. Not setting the `etag` in a
+     * `UpdatePosture` request will result in an unconditional write of the
+     * `Posture`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the Posture, used
+     * for concurrency control. When the `Posture` is returned from either a
+     * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+     * of the current `Posture` to use when executing a read-modify-write loop.
+     *
+     * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+     * value that was returned from a `GetPosture` request as part of a
+     * read-modify-write loop for concurrency control. Not setting the `etag` in a
+     * `UpdatePosture` request will result in an unconditional write of the
+     * `Posture`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the Posture, used
+     * for concurrency control. When the `Posture` is returned from either a
+     * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+     * of the current `Posture` to use when executing a read-modify-write loop.
+     *
+     * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+     * value that was returned from a `GetPosture` request as part of a
+     * read-modify-write loop for concurrency control. Not setting the `etag` in a
+     * `UpdatePosture` request will result in an unconditional write of the
+     * `Posture`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the Posture, used
+     * for concurrency control. When the `Posture` is returned from either a
+     * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+     * of the current `Posture` to use when executing a read-modify-write loop.
+     *
+     * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+     * value that was returned from a `GetPosture` request as part of a
+     * read-modify-write loop for concurrency control. Not setting the `etag` in a
+     * `UpdatePosture` request will result in an unconditional write of the
+     * `Posture`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the Posture, used
+     * for concurrency control. When the `Posture` is returned from either a
+     * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+     * of the current `Posture` to use when executing a read-modify-write loop.
+     *
+     * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+     * value that was returned from a `GetPosture` request as part of a
+     * read-modify-write loop for concurrency control. Not setting the `etag` in a
+     * `UpdatePosture` request will result in an unconditional write of the
+     * `Posture`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000100; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000100); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000100; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000100; + return this; + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000100; + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Whether or not this Posture is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Whether or not this Posture is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Whether or not this Posture is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000200); + reconciling_ = 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.securityposture.v1.Posture) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.Posture) + private static final com.google.cloud.securityposture.v1.Posture DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.Posture(); + } + + public static com.google.cloud.securityposture.v1.Posture getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Posture 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.securityposture.v1.Posture getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeployment.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeployment.java new file mode 100644 index 000000000000..184119c3e909 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeployment.java @@ -0,0 +1,3735 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * ========================== PostureDeployments ==========================
+ * Message describing PostureDeployment resource.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PostureDeployment} + */ +public final class PostureDeployment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.PostureDeployment) + PostureDeploymentOrBuilder { + private static final long serialVersionUID = 0L; + // Use PostureDeployment.newBuilder() to construct. + private PostureDeployment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PostureDeployment() { + name_ = ""; + targetResource_ = ""; + state_ = 0; + postureId_ = ""; + postureRevisionId_ = ""; + description_ = ""; + etag_ = ""; + desiredPostureId_ = ""; + desiredPostureRevisionId_ = ""; + failureMessage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PostureDeployment(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureDeployment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureDeployment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PostureDeployment.class, + com.google.cloud.securityposture.v1.PostureDeployment.Builder.class); + } + + /** + * + * + *
+   * State of a PostureDeployment.
+   * 
+ * + * Protobuf enum {@code google.cloud.securityposture.v1.PostureDeployment.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified operation state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The PostureDeployment is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * The PostureDeployment is being deleted.
+     * 
+ * + * DELETING = 2; + */ + DELETING(2), + /** + * + * + *
+     * The PostureDeployment state is being updated.
+     * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + * + * + *
+     * The PostureDeployment state is active and in use.
+     * 
+ * + * ACTIVE = 4; + */ + ACTIVE(4), + /** + * + * + *
+     * The PostureDeployment creation failed.
+     * 
+ * + * CREATE_FAILED = 5; + */ + CREATE_FAILED(5), + /** + * + * + *
+     * The PostureDeployment update failed.
+     * 
+ * + * UPDATE_FAILED = 6; + */ + UPDATE_FAILED(6), + /** + * + * + *
+     * The PostureDeployment deletion failed.
+     * 
+ * + * DELETE_FAILED = 7; + */ + DELETE_FAILED(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified operation state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The PostureDeployment is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * The PostureDeployment is being deleted.
+     * 
+ * + * DELETING = 2; + */ + public static final int DELETING_VALUE = 2; + /** + * + * + *
+     * The PostureDeployment state is being updated.
+     * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + /** + * + * + *
+     * The PostureDeployment state is active and in use.
+     * 
+ * + * ACTIVE = 4; + */ + public static final int ACTIVE_VALUE = 4; + /** + * + * + *
+     * The PostureDeployment creation failed.
+     * 
+ * + * CREATE_FAILED = 5; + */ + public static final int CREATE_FAILED_VALUE = 5; + /** + * + * + *
+     * The PostureDeployment update failed.
+     * 
+ * + * UPDATE_FAILED = 6; + */ + public static final int UPDATE_FAILED_VALUE = 6; + /** + * + * + *
+     * The PostureDeployment deletion failed.
+     * 
+ * + * DELETE_FAILED = 7; + */ + public static final int DELETE_FAILED_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 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 CREATING; + case 2: + return DELETING; + case 3: + return UPDATING; + case 4: + return ACTIVE; + case 5: + return CREATE_FAILED; + case 6: + return UPDATE_FAILED; + case 7: + return DELETE_FAILED; + 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.securityposture.v1.PostureDeployment.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.securityposture.v1.PostureDeployment.State) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of this PostureDeployment resource, in the format of
+   * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of this PostureDeployment resource, in the format of
+   * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 TARGET_RESOURCE_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object targetResource_ = ""; + /** + * + * + *
+   * Required. Target resource where the Posture will be deployed. Currently
+   * supported resources are of types: projects/projectNumber,
+   * folders/folderNumber, organizations/organizationNumber.
+   * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetResource. + */ + @java.lang.Override + public java.lang.String getTargetResource() { + java.lang.Object ref = targetResource_; + 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(); + targetResource_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Target resource where the Posture will be deployed. Currently
+   * supported resources are of types: projects/projectNumber,
+   * folders/folderNumber, organizations/organizationNumber.
+   * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetResource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetResourceBytes() { + java.lang.Object ref = targetResource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 2; + private int state_ = 0; + /** + * + * + *
+   * Output only. State of PostureDeployment resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.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 PostureDeployment resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeployment.State getState() { + com.google.cloud.securityposture.v1.PostureDeployment.State result = + com.google.cloud.securityposture.v1.PostureDeployment.State.forNumber(state_); + return result == null + ? com.google.cloud.securityposture.v1.PostureDeployment.State.UNRECOGNIZED + : result; + } + + public static final int POSTURE_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object postureId_ = ""; + /** + * + * + *
+   * Required. Posture that needs to be deployed.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/postures/<posture>
+   * Example:
+   * organizations/99/locations/global/postures/les-miserables.
+   * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + @java.lang.Override + public java.lang.String getPostureId() { + java.lang.Object ref = postureId_; + 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(); + postureId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Posture that needs to be deployed.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/postures/<posture>
+   * Example:
+   * organizations/99/locations/global/postures/les-miserables.
+   * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPostureIdBytes() { + java.lang.Object ref = postureId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POSTURE_REVISION_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object postureRevisionId_ = ""; + /** + * + * + *
+   * Required. Revision_id of the Posture that is to be deployed.
+   * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureRevisionId. + */ + @java.lang.Override + public java.lang.String getPostureRevisionId() { + java.lang.Object ref = postureRevisionId_; + 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(); + postureRevisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Revision_id of the Posture that is to be deployed.
+   * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureRevisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPostureRevisionIdBytes() { + java.lang.Object ref = postureRevisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureRevisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Optional. User provided description of the PostureDeployment.
+   * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. User provided description of the PostureDeployment.
+   * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 ETAG_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * Optional. An opaque tag indicating the current version of the
+   * PostureDeployment, used for concurrency control. When the
+   * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+   * `ListPostureDeployments` request, this `etag` indicates the version of the
+   * current `PostureDeployment` to use when executing a read-modify-write loop.
+   *
+   * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+   * use the `etag` value that was returned from a `GetPostureDeployment`
+   * request as part of a read-modify-write loop for concurrency control. Not
+   * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+   * unconditional write of the `PostureDeployment`.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An opaque tag indicating the current version of the
+   * PostureDeployment, used for concurrency control. When the
+   * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+   * `ListPostureDeployments` request, this `etag` indicates the version of the
+   * current `PostureDeployment` to use when executing a read-modify-write loop.
+   *
+   * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+   * use the `etag` value that was returned from a `GetPostureDeployment`
+   * request as part of a read-modify-write loop for concurrency control. Not
+   * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+   * unconditional write of the `PostureDeployment`.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATIONS_FIELD_NUMBER = 9; + + private static final class AnnotationsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureDeployment_AnnotationsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int RECONCILING_FIELD_NUMBER = 10; + private boolean reconciling_ = false; + /** + * + * + *
+   * Output only. Whether or not this Posture is in the process of being
+   * updated.
+   * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + + public static final int DESIRED_POSTURE_ID_FIELD_NUMBER = 11; + + @SuppressWarnings("serial") + private volatile java.lang.Object desiredPostureId_ = ""; + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled in
+   * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+   * DELETE_FAILED. It denotes the desired Posture.
+   * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The desiredPostureId. + */ + @java.lang.Override + public java.lang.String getDesiredPostureId() { + java.lang.Object ref = desiredPostureId_; + 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(); + desiredPostureId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled in
+   * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+   * DELETE_FAILED. It denotes the desired Posture.
+   * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for desiredPostureId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDesiredPostureIdBytes() { + java.lang.Object ref = desiredPostureId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + desiredPostureId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESIRED_POSTURE_REVISION_ID_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object desiredPostureRevisionId_ = ""; + /** + * + * + *
+   * Output only. Output only optional field which provides revision_id of the
+   * desired_posture_id.
+   * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The desiredPostureRevisionId. + */ + @java.lang.Override + public java.lang.String getDesiredPostureRevisionId() { + java.lang.Object ref = desiredPostureRevisionId_; + 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(); + desiredPostureRevisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Output only optional field which provides revision_id of the
+   * desired_posture_id.
+   * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for desiredPostureRevisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDesiredPostureRevisionIdBytes() { + java.lang.Object ref = desiredPostureRevisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + desiredPostureRevisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILURE_MESSAGE_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object failureMessage_ = ""; + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled in
+   * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+   * CREATE_FAILED or DELETE_FAILED.
+   * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The failureMessage. + */ + @java.lang.Override + public java.lang.String getFailureMessage() { + java.lang.Object ref = failureMessage_; + 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(); + failureMessage_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled in
+   * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+   * CREATE_FAILED or DELETE_FAILED.
+   * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for failureMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFailureMessageBytes() { + java.lang.Object ref = failureMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + failureMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (state_ + != com.google.cloud.securityposture.v1.PostureDeployment.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, postureId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureRevisionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, postureRevisionId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, etag_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 9); + if (reconciling_ != false) { + output.writeBool(10, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(desiredPostureId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, desiredPostureId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(desiredPostureRevisionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, desiredPostureRevisionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetResource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, targetResource_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(failureMessage_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, failureMessage_); + } + 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 (state_ + != com.google.cloud.securityposture.v1.PostureDeployment.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, postureId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(postureRevisionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, postureRevisionId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, etag_); + } + for (java.util.Map.Entry entry : + internalGetAnnotations().getMap().entrySet()) { + com.google.protobuf.MapEntry annotations__ = + AnnotationsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, annotations__); + } + if (reconciling_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(10, reconciling_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(desiredPostureId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, desiredPostureId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(desiredPostureRevisionId_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(12, desiredPostureRevisionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(targetResource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, targetResource_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(failureMessage_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, failureMessage_); + } + 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.securityposture.v1.PostureDeployment)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.PostureDeployment other = + (com.google.cloud.securityposture.v1.PostureDeployment) obj; + + if (!getName().equals(other.getName())) return false; + if (!getTargetResource().equals(other.getTargetResource())) return false; + if (state_ != other.state_) return false; + if (!getPostureId().equals(other.getPostureId())) return false; + if (!getPostureRevisionId().equals(other.getPostureRevisionId())) 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 (!getDescription().equals(other.getDescription())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; + if (getReconciling() != other.getReconciling()) return false; + if (!getDesiredPostureId().equals(other.getDesiredPostureId())) return false; + if (!getDesiredPostureRevisionId().equals(other.getDesiredPostureRevisionId())) return false; + if (!getFailureMessage().equals(other.getFailureMessage())) 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) + TARGET_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getTargetResource().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + POSTURE_ID_FIELD_NUMBER; + hash = (53 * hash) + getPostureId().hashCode(); + hash = (37 * hash) + POSTURE_REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getPostureRevisionId().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetAnnotations().getMap().isEmpty()) { + hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetAnnotations().hashCode(); + } + hash = (37 * hash) + RECONCILING_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReconciling()); + hash = (37 * hash) + DESIRED_POSTURE_ID_FIELD_NUMBER; + hash = (53 * hash) + getDesiredPostureId().hashCode(); + hash = (37 * hash) + DESIRED_POSTURE_REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getDesiredPostureRevisionId().hashCode(); + hash = (37 * hash) + FAILURE_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getFailureMessage().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.PostureDeployment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PostureDeployment 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.securityposture.v1.PostureDeployment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PostureDeployment 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.securityposture.v1.PostureDeployment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PostureDeployment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.PostureDeployment parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PostureDeployment 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.securityposture.v1.PostureDeployment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PostureDeployment 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.securityposture.v1.PostureDeployment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PostureDeployment 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.securityposture.v1.PostureDeployment 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; + } + /** + * + * + *
+   * ========================== PostureDeployments ==========================
+   * Message describing PostureDeployment resource.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PostureDeployment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.PostureDeployment) + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureDeployment_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 9: + return internalGetMutableAnnotations(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureDeployment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PostureDeployment.class, + com.google.cloud.securityposture.v1.PostureDeployment.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.PostureDeployment.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(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + targetResource_ = ""; + state_ = 0; + postureId_ = ""; + postureRevisionId_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + description_ = ""; + etag_ = ""; + internalGetMutableAnnotations().clear(); + reconciling_ = false; + desiredPostureId_ = ""; + desiredPostureRevisionId_ = ""; + failureMessage_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureDeployment_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeployment getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeployment build() { + com.google.cloud.securityposture.v1.PostureDeployment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeployment buildPartial() { + com.google.cloud.securityposture.v1.PostureDeployment result = + new com.google.cloud.securityposture.v1.PostureDeployment(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.PostureDeployment result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.targetResource_ = targetResource_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.postureId_ = postureId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.postureRevisionId_ = postureRevisionId_; + } + 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; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.etag_ = etag_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.annotations_ = internalGetAnnotations(); + result.annotations_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.reconciling_ = reconciling_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.desiredPostureId_ = desiredPostureId_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.desiredPostureRevisionId_ = desiredPostureRevisionId_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.failureMessage_ = failureMessage_; + } + 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.securityposture.v1.PostureDeployment) { + return mergeFrom((com.google.cloud.securityposture.v1.PostureDeployment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.PostureDeployment other) { + if (other == com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTargetResource().isEmpty()) { + targetResource_ = other.targetResource_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getPostureId().isEmpty()) { + postureId_ = other.postureId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getPostureRevisionId().isEmpty()) { + postureRevisionId_ = other.postureRevisionId_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000100; + onChanged(); + } + internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); + bitField0_ |= 0x00000200; + if (other.getReconciling() != false) { + setReconciling(other.getReconciling()); + } + if (!other.getDesiredPostureId().isEmpty()) { + desiredPostureId_ = other.desiredPostureId_; + bitField0_ |= 0x00000800; + onChanged(); + } + if (!other.getDesiredPostureRevisionId().isEmpty()) { + desiredPostureRevisionId_ = other.desiredPostureRevisionId_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (!other.getFailureMessage().isEmpty()) { + failureMessage_ = other.failureMessage_; + bitField0_ |= 0x00002000; + 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: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 16 + case 26: + { + postureId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + postureRevisionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + com.google.protobuf.MapEntry annotations__ = + input.readMessage( + AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableAnnotations() + .getMutableMap() + .put(annotations__.getKey(), annotations__.getValue()); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 80: + { + reconciling_ = input.readBool(); + bitField0_ |= 0x00000400; + break; + } // case 80 + case 90: + { + desiredPostureId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 90 + case 98: + { + desiredPostureRevisionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 98 + case 106: + { + targetResource_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 106 + case 114: + { + failureMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of this PostureDeployment resource, in the format of
+     * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of this PostureDeployment resource, in the format of
+     * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of this PostureDeployment resource, in the format of
+     * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of this PostureDeployment resource, in the format of
+     * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of this PostureDeployment resource, in the format of
+     * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 targetResource_ = ""; + /** + * + * + *
+     * Required. Target resource where the Posture will be deployed. Currently
+     * supported resources are of types: projects/projectNumber,
+     * folders/folderNumber, organizations/organizationNumber.
+     * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetResource. + */ + public java.lang.String getTargetResource() { + java.lang.Object ref = targetResource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetResource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Target resource where the Posture will be deployed. Currently
+     * supported resources are of types: projects/projectNumber,
+     * folders/folderNumber, organizations/organizationNumber.
+     * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetResource. + */ + public com.google.protobuf.ByteString getTargetResourceBytes() { + java.lang.Object ref = targetResource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetResource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Target resource where the Posture will be deployed. Currently
+     * supported resources are of types: projects/projectNumber,
+     * folders/folderNumber, organizations/organizationNumber.
+     * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The targetResource to set. + * @return This builder for chaining. + */ + public Builder setTargetResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + targetResource_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Target resource where the Posture will be deployed. Currently
+     * supported resources are of types: projects/projectNumber,
+     * folders/folderNumber, organizations/organizationNumber.
+     * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTargetResource() { + targetResource_ = getDefaultInstance().getTargetResource(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Target resource where the Posture will be deployed. Currently
+     * supported resources are of types: projects/projectNumber,
+     * folders/folderNumber, organizations/organizationNumber.
+     * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for targetResource to set. + * @return This builder for chaining. + */ + public Builder setTargetResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + targetResource_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of PostureDeployment resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.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 PostureDeployment resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of PostureDeployment resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeployment.State getState() { + com.google.cloud.securityposture.v1.PostureDeployment.State result = + com.google.cloud.securityposture.v1.PostureDeployment.State.forNumber(state_); + return result == null + ? com.google.cloud.securityposture.v1.PostureDeployment.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of PostureDeployment resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.securityposture.v1.PostureDeployment.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of PostureDeployment resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object postureId_ = ""; + /** + * + * + *
+     * Required. Posture that needs to be deployed.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/postures/<posture>
+     * Example:
+     * organizations/99/locations/global/postures/les-miserables.
+     * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + public java.lang.String getPostureId() { + java.lang.Object ref = postureId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + postureId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Posture that needs to be deployed.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/postures/<posture>
+     * Example:
+     * organizations/99/locations/global/postures/les-miserables.
+     * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + public com.google.protobuf.ByteString getPostureIdBytes() { + java.lang.Object ref = postureId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Posture that needs to be deployed.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/postures/<posture>
+     * Example:
+     * organizations/99/locations/global/postures/les-miserables.
+     * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The postureId to set. + * @return This builder for chaining. + */ + public Builder setPostureId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + postureId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Posture that needs to be deployed.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/postures/<posture>
+     * Example:
+     * organizations/99/locations/global/postures/les-miserables.
+     * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPostureId() { + postureId_ = getDefaultInstance().getPostureId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Posture that needs to be deployed.
+     * Format:
+     * organizations/{org_id}/locations/{location_id}/postures/<posture>
+     * Example:
+     * organizations/99/locations/global/postures/les-miserables.
+     * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for postureId to set. + * @return This builder for chaining. + */ + public Builder setPostureIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + postureId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object postureRevisionId_ = ""; + /** + * + * + *
+     * Required. Revision_id of the Posture that is to be deployed.
+     * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureRevisionId. + */ + public java.lang.String getPostureRevisionId() { + java.lang.Object ref = postureRevisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + postureRevisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Revision_id of the Posture that is to be deployed.
+     * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureRevisionId. + */ + public com.google.protobuf.ByteString getPostureRevisionIdBytes() { + java.lang.Object ref = postureRevisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + postureRevisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Revision_id of the Posture that is to be deployed.
+     * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The postureRevisionId to set. + * @return This builder for chaining. + */ + public Builder setPostureRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + postureRevisionId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Revision_id of the Posture that is to be deployed.
+     * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPostureRevisionId() { + postureRevisionId_ = getDefaultInstance().getPostureRevisionId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Revision_id of the Posture that is to be deployed.
+     * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for postureRevisionId to set. + * @return This builder for chaining. + */ + public Builder setPostureRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + postureRevisionId_ = 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. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 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. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.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. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 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 timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.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 timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp that the PostureDeployment was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Optional. User provided description of the PostureDeployment.
+     * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. User provided description of the PostureDeployment.
+     * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. User provided description of the PostureDeployment.
+     * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User provided description of the PostureDeployment.
+     * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User provided description of the PostureDeployment.
+     * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ |= 0x00000080; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the
+     * PostureDeployment, used for concurrency control. When the
+     * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+     * `ListPostureDeployments` request, this `etag` indicates the version of the
+     * current `PostureDeployment` to use when executing a read-modify-write loop.
+     *
+     * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+     * use the `etag` value that was returned from a `GetPostureDeployment`
+     * request as part of a read-modify-write loop for concurrency control. Not
+     * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+     * unconditional write of the `PostureDeployment`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the
+     * PostureDeployment, used for concurrency control. When the
+     * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+     * `ListPostureDeployments` request, this `etag` indicates the version of the
+     * current `PostureDeployment` to use when executing a read-modify-write loop.
+     *
+     * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+     * use the `etag` value that was returned from a `GetPostureDeployment`
+     * request as part of a read-modify-write loop for concurrency control. Not
+     * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+     * unconditional write of the `PostureDeployment`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the
+     * PostureDeployment, used for concurrency control. When the
+     * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+     * `ListPostureDeployments` request, this `etag` indicates the version of the
+     * current `PostureDeployment` to use when executing a read-modify-write loop.
+     *
+     * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+     * use the `etag` value that was returned from a `GetPostureDeployment`
+     * request as part of a read-modify-write loop for concurrency control. Not
+     * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+     * unconditional write of the `PostureDeployment`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the
+     * PostureDeployment, used for concurrency control. When the
+     * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+     * `ListPostureDeployments` request, this `etag` indicates the version of the
+     * current `PostureDeployment` to use when executing a read-modify-write loop.
+     *
+     * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+     * use the `etag` value that was returned from a `GetPostureDeployment`
+     * request as part of a read-modify-write loop for concurrency control. Not
+     * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+     * unconditional write of the `PostureDeployment`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An opaque tag indicating the current version of the
+     * PostureDeployment, used for concurrency control. When the
+     * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+     * `ListPostureDeployments` request, this `etag` indicates the version of the
+     * current `PostureDeployment` to use when executing a read-modify-write loop.
+     *
+     * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+     * use the `etag` value that was returned from a `GetPostureDeployment`
+     * request as part of a read-modify-write loop for concurrency control. Not
+     * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+     * unconditional write of the `PostureDeployment`.
+     * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.protobuf.MapField annotations_; + + private com.google.protobuf.MapField + internalGetAnnotations() { + if (annotations_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AnnotationsDefaultEntryHolder.defaultEntry); + } + return annotations_; + } + + private com.google.protobuf.MapField + internalGetMutableAnnotations() { + if (annotations_ == null) { + annotations_ = + com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); + } + if (!annotations_.isMutable()) { + annotations_ = annotations_.copy(); + } + bitField0_ |= 0x00000200; + onChanged(); + return annotations_; + } + + public int getAnnotationsCount() { + return internalGetAnnotations().getMap().size(); + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetAnnotations().getMap().containsKey(key); + } + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getAnnotations() { + return getAnnotationsMap(); + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getAnnotationsMap() { + return internalGetAnnotations().getMap(); + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getAnnotationsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetAnnotations().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAnnotations() { + bitField0_ = (bitField0_ & ~0x00000200); + internalGetMutableAnnotations().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeAnnotations(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableAnnotations().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableAnnotations() { + bitField0_ |= 0x00000200; + return internalGetMutableAnnotations().getMutableMap(); + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAnnotations(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableAnnotations().getMutableMap().put(key, value); + bitField0_ |= 0x00000200; + return this; + } + /** + * + * + *
+     * Optional. User annotations. These attributes can only be set and used by
+     * the user, and not by Google Security Postures.
+     * .
+     * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllAnnotations(java.util.Map values) { + internalGetMutableAnnotations().getMutableMap().putAll(values); + bitField0_ |= 0x00000200; + return this; + } + + private boolean reconciling_; + /** + * + * + *
+     * Output only. Whether or not this Posture is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + @java.lang.Override + public boolean getReconciling() { + return reconciling_; + } + /** + * + * + *
+     * Output only. Whether or not this Posture is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The reconciling to set. + * @return This builder for chaining. + */ + public Builder setReconciling(boolean value) { + + reconciling_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Whether or not this Posture is in the process of being
+     * updated.
+     * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearReconciling() { + bitField0_ = (bitField0_ & ~0x00000400); + reconciling_ = false; + onChanged(); + return this; + } + + private java.lang.Object desiredPostureId_ = ""; + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+     * DELETE_FAILED. It denotes the desired Posture.
+     * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The desiredPostureId. + */ + public java.lang.String getDesiredPostureId() { + java.lang.Object ref = desiredPostureId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + desiredPostureId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+     * DELETE_FAILED. It denotes the desired Posture.
+     * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for desiredPostureId. + */ + public com.google.protobuf.ByteString getDesiredPostureIdBytes() { + java.lang.Object ref = desiredPostureId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + desiredPostureId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+     * DELETE_FAILED. It denotes the desired Posture.
+     * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The desiredPostureId to set. + * @return This builder for chaining. + */ + public Builder setDesiredPostureId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + desiredPostureId_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+     * DELETE_FAILED. It denotes the desired Posture.
+     * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDesiredPostureId() { + desiredPostureId_ = getDefaultInstance().getDesiredPostureId(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+     * DELETE_FAILED. It denotes the desired Posture.
+     * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for desiredPostureId to set. + * @return This builder for chaining. + */ + public Builder setDesiredPostureIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + desiredPostureId_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + private java.lang.Object desiredPostureRevisionId_ = ""; + /** + * + * + *
+     * Output only. Output only optional field which provides revision_id of the
+     * desired_posture_id.
+     * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The desiredPostureRevisionId. + */ + public java.lang.String getDesiredPostureRevisionId() { + java.lang.Object ref = desiredPostureRevisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + desiredPostureRevisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Output only optional field which provides revision_id of the
+     * desired_posture_id.
+     * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for desiredPostureRevisionId. + */ + public com.google.protobuf.ByteString getDesiredPostureRevisionIdBytes() { + java.lang.Object ref = desiredPostureRevisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + desiredPostureRevisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Output only optional field which provides revision_id of the
+     * desired_posture_id.
+     * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The desiredPostureRevisionId to set. + * @return This builder for chaining. + */ + public Builder setDesiredPostureRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + desiredPostureRevisionId_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Output only optional field which provides revision_id of the
+     * desired_posture_id.
+     * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDesiredPostureRevisionId() { + desiredPostureRevisionId_ = getDefaultInstance().getDesiredPostureRevisionId(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Output only optional field which provides revision_id of the
+     * desired_posture_id.
+     * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The bytes for desiredPostureRevisionId to set. + * @return This builder for chaining. + */ + public Builder setDesiredPostureRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + desiredPostureRevisionId_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private java.lang.Object failureMessage_ = ""; + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+     * CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The failureMessage. + */ + public java.lang.String getFailureMessage() { + java.lang.Object ref = failureMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + failureMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+     * CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for failureMessage. + */ + public com.google.protobuf.ByteString getFailureMessageBytes() { + java.lang.Object ref = failureMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + failureMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+     * CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The failureMessage to set. + * @return This builder for chaining. + */ + public Builder setFailureMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + failureMessage_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+     * CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearFailureMessage() { + failureMessage_ = getDefaultInstance().getFailureMessage(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. This is a output only optional field which will be filled in
+     * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+     * CREATE_FAILED or DELETE_FAILED.
+     * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for failureMessage to set. + * @return This builder for chaining. + */ + public Builder setFailureMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + failureMessage_ = value; + bitField0_ |= 0x00002000; + 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.securityposture.v1.PostureDeployment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.PostureDeployment) + private static final com.google.cloud.securityposture.v1.PostureDeployment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.PostureDeployment(); + } + + public static com.google.cloud.securityposture.v1.PostureDeployment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PostureDeployment 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.securityposture.v1.PostureDeployment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeploymentName.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeploymentName.java new file mode 100644 index 000000000000..6ee3d43bacd5 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeploymentName.java @@ -0,0 +1,237 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.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 PostureDeploymentName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_POSTURE_DEPLOYMENT = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/postureDeployments/{posture_deployment}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String postureDeployment; + + @Deprecated + protected PostureDeploymentName() { + organization = null; + location = null; + postureDeployment = null; + } + + private PostureDeploymentName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + postureDeployment = Preconditions.checkNotNull(builder.getPostureDeployment()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPostureDeployment() { + return postureDeployment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PostureDeploymentName of( + String organization, String location, String postureDeployment) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPostureDeployment(postureDeployment) + .build(); + } + + public static String format(String organization, String location, String postureDeployment) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPostureDeployment(postureDeployment) + .build() + .toString(); + } + + public static PostureDeploymentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_POSTURE_DEPLOYMENT.validatedMatch( + formattedString, "PostureDeploymentName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("posture_deployment")); + } + + 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 (PostureDeploymentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_POSTURE_DEPLOYMENT.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 (postureDeployment != null) { + fieldMapBuilder.put("posture_deployment", postureDeployment); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_POSTURE_DEPLOYMENT.instantiate( + "organization", + organization, + "location", + location, + "posture_deployment", + postureDeployment); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PostureDeploymentName that = ((PostureDeploymentName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.postureDeployment, that.postureDeployment); + } + 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(postureDeployment); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/postureDeployments/{posture_deployment}. + */ + public static class Builder { + private String organization; + private String location; + private String postureDeployment; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPostureDeployment() { + return postureDeployment; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPostureDeployment(String postureDeployment) { + this.postureDeployment = postureDeployment; + return this; + } + + private Builder(PostureDeploymentName postureDeploymentName) { + this.organization = postureDeploymentName.organization; + this.location = postureDeploymentName.location; + this.postureDeployment = postureDeploymentName.postureDeployment; + } + + public PostureDeploymentName build() { + return new PostureDeploymentName(this); + } + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeploymentOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeploymentOrBuilder.java new file mode 100644 index 000000000000..0dfdad99d8b9 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureDeploymentOrBuilder.java @@ -0,0 +1,489 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface PostureDeploymentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.PostureDeployment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of this PostureDeployment resource, in the format of
+   * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of this PostureDeployment resource, in the format of
+   * organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Target resource where the Posture will be deployed. Currently
+   * supported resources are of types: projects/projectNumber,
+   * folders/folderNumber, organizations/organizationNumber.
+   * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The targetResource. + */ + java.lang.String getTargetResource(); + /** + * + * + *
+   * Required. Target resource where the Posture will be deployed. Currently
+   * supported resources are of types: projects/projectNumber,
+   * folders/folderNumber, organizations/organizationNumber.
+   * 
+ * + * string target_resource = 13 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for targetResource. + */ + com.google.protobuf.ByteString getTargetResourceBytes(); + + /** + * + * + *
+   * Output only. State of PostureDeployment resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of PostureDeployment resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.securityposture.v1.PostureDeployment.State getState(); + + /** + * + * + *
+   * Required. Posture that needs to be deployed.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/postures/<posture>
+   * Example:
+   * organizations/99/locations/global/postures/les-miserables.
+   * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureId. + */ + java.lang.String getPostureId(); + /** + * + * + *
+   * Required. Posture that needs to be deployed.
+   * Format:
+   * organizations/{org_id}/locations/{location_id}/postures/<posture>
+   * Example:
+   * organizations/99/locations/global/postures/les-miserables.
+   * 
+ * + * string posture_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureId. + */ + com.google.protobuf.ByteString getPostureIdBytes(); + + /** + * + * + *
+   * Required. Revision_id of the Posture that is to be deployed.
+   * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The postureRevisionId. + */ + java.lang.String getPostureRevisionId(); + /** + * + * + *
+   * Required. Revision_id of the Posture that is to be deployed.
+   * 
+ * + * string posture_revision_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for postureRevisionId. + */ + com.google.protobuf.ByteString getPostureRevisionIdBytes(); + + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp that the PostureDeployment was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. User provided description of the PostureDeployment.
+   * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. User provided description of the PostureDeployment.
+   * 
+ * + * string description = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. An opaque tag indicating the current version of the
+   * PostureDeployment, used for concurrency control. When the
+   * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+   * `ListPostureDeployments` request, this `etag` indicates the version of the
+   * current `PostureDeployment` to use when executing a read-modify-write loop.
+   *
+   * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+   * use the `etag` value that was returned from a `GetPostureDeployment`
+   * request as part of a read-modify-write loop for concurrency control. Not
+   * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+   * unconditional write of the `PostureDeployment`.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. An opaque tag indicating the current version of the
+   * PostureDeployment, used for concurrency control. When the
+   * `PostureDeployment` is returned from either a `GetPostureDeployment` or a
+   * `ListPostureDeployments` request, this `etag` indicates the version of the
+   * current `PostureDeployment` to use when executing a read-modify-write loop.
+   *
+   * When the `PostureDeployment` is used in a `UpdatePostureDeployment` method,
+   * use the `etag` value that was returned from a `GetPostureDeployment`
+   * request as part of a read-modify-write loop for concurrency control. Not
+   * setting the `etag` in a `UpdatePostureDeployment` request will result in an
+   * unconditional write of the `PostureDeployment`.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Whether or not this Posture is in the process of being
+   * updated.
+   * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); + + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled in
+   * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+   * DELETE_FAILED. It denotes the desired Posture.
+   * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The desiredPostureId. + */ + java.lang.String getDesiredPostureId(); + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled in
+   * case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or
+   * DELETE_FAILED. It denotes the desired Posture.
+   * 
+ * + * string desired_posture_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for desiredPostureId. + */ + com.google.protobuf.ByteString getDesiredPostureIdBytes(); + + /** + * + * + *
+   * Output only. Output only optional field which provides revision_id of the
+   * desired_posture_id.
+   * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The desiredPostureRevisionId. + */ + java.lang.String getDesiredPostureRevisionId(); + /** + * + * + *
+   * Output only. Output only optional field which provides revision_id of the
+   * desired_posture_id.
+   * 
+ * + * string desired_posture_revision_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for desiredPostureRevisionId. + */ + com.google.protobuf.ByteString getDesiredPostureRevisionIdBytes(); + + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled in
+   * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+   * CREATE_FAILED or DELETE_FAILED.
+   * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The failureMessage. + */ + java.lang.String getFailureMessage(); + /** + * + * + *
+   * Output only. This is a output only optional field which will be filled in
+   * case where PostureDeployment enters a failure state like UPDATE_FAILED or
+   * CREATE_FAILED or DELETE_FAILED.
+   * 
+ * + * string failure_message = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for failureMessage. + */ + com.google.protobuf.ByteString getFailureMessageBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureName.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureName.java new file mode 100644 index 000000000000..770f0a621e20 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureName.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.securityposture.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 PostureName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_POSTURE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/postures/{posture}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String posture; + + @Deprecated + protected PostureName() { + organization = null; + location = null; + posture = null; + } + + private PostureName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + posture = Preconditions.checkNotNull(builder.getPosture()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPosture() { + return posture; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PostureName of(String organization, String location, String posture) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPosture(posture) + .build(); + } + + public static String format(String organization, String location, String posture) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPosture(posture) + .build() + .toString(); + } + + public static PostureName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_POSTURE.validatedMatch( + formattedString, "PostureName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location"), matchMap.get("posture")); + } + + 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 (PostureName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_POSTURE.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 (posture != null) { + fieldMapBuilder.put("posture", posture); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_POSTURE.instantiate( + "organization", organization, "location", location, "posture", posture); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PostureName that = ((PostureName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.posture, that.posture); + } + 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(posture); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}/postures/{posture}. */ + public static class Builder { + private String organization; + private String location; + private String posture; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPosture() { + return posture; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPosture(String posture) { + this.posture = posture; + return this; + } + + private Builder(PostureName postureName) { + this.organization = postureName.organization; + this.location = postureName.location; + this.posture = postureName.posture; + } + + public PostureName build() { + return new PostureName(this); + } + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureOrBuilder.java new file mode 100644 index 000000000000..c1d2d9be4845 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureOrBuilder.java @@ -0,0 +1,412 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface PostureOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.Posture) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Identifier. The name of this Posture resource, in the format of
+   * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Identifier. The name of this Posture resource, in the format of
+   * organizations/{org_id}/locations/{location_id}/postures/{posture}.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. State of Posture resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Required. State of Posture resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture.State state = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The state. + */ + com.google.cloud.securityposture.v1.Posture.State getState(); + + /** + * + * + *
+   * Output only. Immutable. The revision ID of the posture.
+   * The format is an 8-character hexadecimal string.
+   * https://google.aip.dev/162
+   * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The revisionId. + */ + java.lang.String getRevisionId(); + /** + * + * + *
+   * Output only. Immutable. The revision ID of the posture.
+   * The format is an 8-character hexadecimal string.
+   * https://google.aip.dev/162
+   * 
+ * + * + * string revision_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for revisionId. + */ + com.google.protobuf.ByteString getRevisionIdBytes(); + + /** + * + * + *
+   * Output only. The timestamp that the posture was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp that the posture was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp that the posture was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp that the posture was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp that the posture was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp that the posture was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. User provided description of the posture.
+   * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Optional. User provided description of the posture.
+   * 
+ * + * string description = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPolicySetsList(); + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PolicySet getPolicySets(int index); + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPolicySetsCount(); + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPolicySetsOrBuilderList(); + /** + * + * + *
+   * Required. List of Policy sets.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 7 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PolicySetOrBuilder getPolicySetsOrBuilder(int index); + + /** + * + * + *
+   * Optional. An opaque tag indicating the current version of the Posture, used
+   * for concurrency control. When the `Posture` is returned from either a
+   * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+   * of the current `Posture` to use when executing a read-modify-write loop.
+   *
+   * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+   * value that was returned from a `GetPosture` request as part of a
+   * read-modify-write loop for concurrency control. Not setting the `etag` in a
+   * `UpdatePosture` request will result in an unconditional write of the
+   * `Posture`.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * Optional. An opaque tag indicating the current version of the Posture, used
+   * for concurrency control. When the `Posture` is returned from either a
+   * `GetPosture` or a `ListPostures` request, this `etag` indicates the version
+   * of the current `Posture` to use when executing a read-modify-write loop.
+   *
+   * When the `Posture` is used in a `UpdatePosture` method, use the `etag`
+   * value that was returned from a `GetPosture` request as part of a
+   * read-modify-write loop for concurrency control. Not setting the `etag` in a
+   * `UpdatePosture` request will result in an unconditional write of the
+   * `Posture`.
+   * 
+ * + * string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); + + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getAnnotationsCount(); + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsAnnotations(java.lang.String key); + /** Use {@link #getAnnotationsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getAnnotations(); + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getAnnotationsMap(); + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getAnnotationsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. User annotations. These attributes can only be set and used by
+   * the user, and not by Google Security Postures.
+   * .
+   * 
+ * + * map<string, string> annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getAnnotationsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Whether or not this Posture is in the process of being
+   * updated.
+   * 
+ * + * bool reconciling = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The reconciling. + */ + boolean getReconciling(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplate.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplate.java new file mode 100644 index 000000000000..6eb86d991c2c --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplate.java @@ -0,0 +1,1892 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * PostureTemplates
+ * Message describing PostureTemplate object.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PostureTemplate} + */ +public final class PostureTemplate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.PostureTemplate) + PostureTemplateOrBuilder { + private static final long serialVersionUID = 0L; + // Use PostureTemplate.newBuilder() to construct. + private PostureTemplate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PostureTemplate() { + name_ = ""; + revisionId_ = ""; + description_ = ""; + state_ = 0; + policySets_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PostureTemplate(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PostureTemplate.class, + com.google.cloud.securityposture.v1.PostureTemplate.Builder.class); + } + + /** + * + * + *
+   * State of a PostureTemplate
+   * 
+ * + * Protobuf enum {@code google.cloud.securityposture.v1.PostureTemplate.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified state
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * If the Posture template is adhering to the latest controls and standards.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * If the Posture template controls and standards are outdated and not
+     * recommended for use.
+     * 
+ * + * DEPRECATED = 2; + */ + DEPRECATED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified state
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * If the Posture template is adhering to the latest controls and standards.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * If the Posture template controls and standards are outdated and not
+     * recommended for use.
+     * 
+ * + * DEPRECATED = 2; + */ + public static final int DEPRECATED_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 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 ACTIVE; + case 2: + return DEPRECATED; + 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.securityposture.v1.PostureTemplate.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.securityposture.v1.PostureTemplate.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. Identifier. The name of the Posture template will be of the
+   * format
+   * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+   * Output only. Identifier. The name of the Posture template will be of the
+   * format
+   * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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 REVISION_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object revisionId_ = ""; + /** + * + * + *
+   * Output only. The revision_id of a PostureTemplate.
+   * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revisionId. + */ + @java.lang.Override + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + 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(); + revisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The revision_id of a PostureTemplate.
+   * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** + * + * + *
+   * Output only. Description of the Posture template.
+   * 
+ * + * string description = 3 [(.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 of the Posture template.
+   * 
+ * + * string description = 3 [(.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 STATE_FIELD_NUMBER = 4; + private int state_ = 0; + /** + * + * + *
+   * Output only. State of PostureTemplate resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.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 PostureTemplate resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureTemplate.State getState() { + com.google.cloud.securityposture.v1.PostureTemplate.State result = + com.google.cloud.securityposture.v1.PostureTemplate.State.forNumber(state_); + return result == null + ? com.google.cloud.securityposture.v1.PostureTemplate.State.UNRECOGNIZED + : result; + } + + public static final int POLICY_SETS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private java.util.List policySets_; + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getPolicySetsList() { + return policySets_; + } + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPolicySetsOrBuilderList() { + return policySets_; + } + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getPolicySetsCount() { + return policySets_.size(); + } + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicySet getPolicySets(int index) { + return policySets_.get(index); + } + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PolicySetOrBuilder getPolicySetsOrBuilder(int index) { + return policySets_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, revisionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (state_ + != com.google.cloud.securityposture.v1.PostureTemplate.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, state_); + } + for (int i = 0; i < policySets_.size(); i++) { + output.writeMessage(5, policySets_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, revisionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (state_ + != com.google.cloud.securityposture.v1.PostureTemplate.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + for (int i = 0; i < policySets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, policySets_.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.securityposture.v1.PostureTemplate)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.PostureTemplate other = + (com.google.cloud.securityposture.v1.PostureTemplate) obj; + + if (!getName().equals(other.getName())) return false; + if (!getRevisionId().equals(other.getRevisionId())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (state_ != other.state_) return false; + if (!getPolicySetsList().equals(other.getPolicySetsList())) 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) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (getPolicySetsCount() > 0) { + hash = (37 * hash) + POLICY_SETS_FIELD_NUMBER; + hash = (53 * hash) + getPolicySetsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.PostureTemplate parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PostureTemplate 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.securityposture.v1.PostureTemplate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PostureTemplate 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.securityposture.v1.PostureTemplate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.PostureTemplate parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.PostureTemplate parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PostureTemplate 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.securityposture.v1.PostureTemplate parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PostureTemplate 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.securityposture.v1.PostureTemplate parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.PostureTemplate 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.securityposture.v1.PostureTemplate 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; + } + /** + * + * + *
+   * PostureTemplates
+   * Message describing PostureTemplate object.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.PostureTemplate} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.PostureTemplate) + com.google.cloud.securityposture.v1.PostureTemplateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.PostureTemplate.class, + com.google.cloud.securityposture.v1.PostureTemplate.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.PostureTemplate.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + revisionId_ = ""; + description_ = ""; + state_ = 0; + if (policySetsBuilder_ == null) { + policySets_ = java.util.Collections.emptyList(); + } else { + policySets_ = null; + policySetsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_PostureTemplate_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureTemplate getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.PostureTemplate.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureTemplate build() { + com.google.cloud.securityposture.v1.PostureTemplate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureTemplate buildPartial() { + com.google.cloud.securityposture.v1.PostureTemplate result = + new com.google.cloud.securityposture.v1.PostureTemplate(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.securityposture.v1.PostureTemplate result) { + if (policySetsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0)) { + policySets_ = java.util.Collections.unmodifiableList(policySets_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.policySets_ = policySets_; + } else { + result.policySets_ = policySetsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.securityposture.v1.PostureTemplate result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.revisionId_ = revisionId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.state_ = state_; + } + } + + @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.securityposture.v1.PostureTemplate) { + return mergeFrom((com.google.cloud.securityposture.v1.PostureTemplate) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.PostureTemplate other) { + if (other == com.google.cloud.securityposture.v1.PostureTemplate.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (policySetsBuilder_ == null) { + if (!other.policySets_.isEmpty()) { + if (policySets_.isEmpty()) { + policySets_ = other.policySets_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensurePolicySetsIsMutable(); + policySets_.addAll(other.policySets_); + } + onChanged(); + } + } else { + if (!other.policySets_.isEmpty()) { + if (policySetsBuilder_.isEmpty()) { + policySetsBuilder_.dispose(); + policySetsBuilder_ = null; + policySets_ = other.policySets_; + bitField0_ = (bitField0_ & ~0x00000010); + policySetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPolicySetsFieldBuilder() + : null; + } else { + policySetsBuilder_.addAllMessages(other.policySets_); + } + } + } + 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: + { + revisionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + com.google.cloud.securityposture.v1.PolicySet m = + input.readMessage( + com.google.cloud.securityposture.v1.PolicySet.parser(), extensionRegistry); + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.add(m); + } else { + policySetsBuilder_.addMessage(m); + } + 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 name_ = ""; + /** + * + * + *
+     * Output only. Identifier. The name of the Posture template will be of the
+     * format
+     * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. The name of the Posture template will be of the
+     * format
+     * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + } + /** + * + * + *
+     * Output only. Identifier. The name of the Posture template will be of the
+     * format
+     * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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; + } + /** + * + * + *
+     * Output only. Identifier. The name of the Posture template will be of the
+     * format
+     * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifier. The name of the Posture template will be of the
+     * format
+     * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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 revisionId_ = ""; + /** + * + * + *
+     * Output only. The revision_id of a PostureTemplate.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revisionId. + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The revision_id of a PostureTemplate.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revisionId. + */ + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The revision_id of a PostureTemplate.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The revision_id of a PostureTemplate.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRevisionId() { + revisionId_ = getDefaultInstance().getRevisionId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The revision_id of a PostureTemplate.
+     * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. Description of the Posture template.
+     * 
+ * + * string description = 3 [(.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 of the Posture template.
+     * 
+ * + * string description = 3 [(.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 of the Posture template.
+     * 
+ * + * string description = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description of the Posture template.
+     * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description of the Posture template.
+     * 
+ * + * string description = 3 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of PostureTemplate resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.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 PostureTemplate resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of PostureTemplate resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureTemplate.State getState() { + com.google.cloud.securityposture.v1.PostureTemplate.State result = + com.google.cloud.securityposture.v1.PostureTemplate.State.forNumber(state_); + return result == null + ? com.google.cloud.securityposture.v1.PostureTemplate.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of PostureTemplate resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.securityposture.v1.PostureTemplate.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of PostureTemplate resource.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000008); + state_ = 0; + onChanged(); + return this; + } + + private java.util.List policySets_ = + java.util.Collections.emptyList(); + + private void ensurePolicySetsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + policySets_ = + new java.util.ArrayList(policySets_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicySet, + com.google.cloud.securityposture.v1.PolicySet.Builder, + com.google.cloud.securityposture.v1.PolicySetOrBuilder> + policySetsBuilder_; + + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getPolicySetsList() { + if (policySetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(policySets_); + } else { + return policySetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getPolicySetsCount() { + if (policySetsBuilder_ == null) { + return policySets_.size(); + } else { + return policySetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securityposture.v1.PolicySet getPolicySets(int index) { + if (policySetsBuilder_ == null) { + return policySets_.get(index); + } else { + return policySetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPolicySets(int index, com.google.cloud.securityposture.v1.PolicySet value) { + if (policySetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicySetsIsMutable(); + policySets_.set(index, value); + onChanged(); + } else { + policySetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPolicySets( + int index, com.google.cloud.securityposture.v1.PolicySet.Builder builderForValue) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.set(index, builderForValue.build()); + onChanged(); + } else { + policySetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPolicySets(com.google.cloud.securityposture.v1.PolicySet value) { + if (policySetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicySetsIsMutable(); + policySets_.add(value); + onChanged(); + } else { + policySetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPolicySets(int index, com.google.cloud.securityposture.v1.PolicySet value) { + if (policySetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePolicySetsIsMutable(); + policySets_.add(index, value); + onChanged(); + } else { + policySetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPolicySets( + com.google.cloud.securityposture.v1.PolicySet.Builder builderForValue) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.add(builderForValue.build()); + onChanged(); + } else { + policySetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPolicySets( + int index, com.google.cloud.securityposture.v1.PolicySet.Builder builderForValue) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.add(index, builderForValue.build()); + onChanged(); + } else { + policySetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllPolicySets( + java.lang.Iterable values) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, policySets_); + onChanged(); + } else { + policySetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPolicySets() { + if (policySetsBuilder_ == null) { + policySets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + policySetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removePolicySets(int index) { + if (policySetsBuilder_ == null) { + ensurePolicySetsIsMutable(); + policySets_.remove(index); + onChanged(); + } else { + policySetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securityposture.v1.PolicySet.Builder getPolicySetsBuilder(int index) { + return getPolicySetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securityposture.v1.PolicySetOrBuilder getPolicySetsOrBuilder( + int index) { + if (policySetsBuilder_ == null) { + return policySets_.get(index); + } else { + return policySetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPolicySetsOrBuilderList() { + if (policySetsBuilder_ != null) { + return policySetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(policySets_); + } + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securityposture.v1.PolicySet.Builder addPolicySetsBuilder() { + return getPolicySetsFieldBuilder() + .addBuilder(com.google.cloud.securityposture.v1.PolicySet.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.securityposture.v1.PolicySet.Builder addPolicySetsBuilder(int index) { + return getPolicySetsFieldBuilder() + .addBuilder(index, com.google.cloud.securityposture.v1.PolicySet.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Policy_sets to be used by the user.
+     * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPolicySetsBuilderList() { + return getPolicySetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicySet, + com.google.cloud.securityposture.v1.PolicySet.Builder, + com.google.cloud.securityposture.v1.PolicySetOrBuilder> + getPolicySetsFieldBuilder() { + if (policySetsBuilder_ == null) { + policySetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.securityposture.v1.PolicySet, + com.google.cloud.securityposture.v1.PolicySet.Builder, + com.google.cloud.securityposture.v1.PolicySetOrBuilder>( + policySets_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + policySets_ = null; + } + return policySetsBuilder_; + } + + @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.securityposture.v1.PostureTemplate) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.PostureTemplate) + private static final com.google.cloud.securityposture.v1.PostureTemplate DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.PostureTemplate(); + } + + public static com.google.cloud.securityposture.v1.PostureTemplate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PostureTemplate 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.securityposture.v1.PostureTemplate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplateName.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplateName.java new file mode 100644 index 000000000000..39e52b3b6548 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplateName.java @@ -0,0 +1,232 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.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 PostureTemplateName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION_POSTURE_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/postureTemplates/{posture_template}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + private final String postureTemplate; + + @Deprecated + protected PostureTemplateName() { + organization = null; + location = null; + postureTemplate = null; + } + + private PostureTemplateName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + postureTemplate = Preconditions.checkNotNull(builder.getPostureTemplate()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPostureTemplate() { + return postureTemplate; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PostureTemplateName of( + String organization, String location, String postureTemplate) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPostureTemplate(postureTemplate) + .build(); + } + + public static String format(String organization, String location, String postureTemplate) { + return newBuilder() + .setOrganization(organization) + .setLocation(location) + .setPostureTemplate(postureTemplate) + .build() + .toString(); + } + + public static PostureTemplateName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION_POSTURE_TEMPLATE.validatedMatch( + formattedString, "PostureTemplateName.parse: formattedString not in valid format"); + return of( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("posture_template")); + } + + 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 (PostureTemplateName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION_POSTURE_TEMPLATE.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 (postureTemplate != null) { + fieldMapBuilder.put("posture_template", postureTemplate); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION_POSTURE_TEMPLATE.instantiate( + "organization", organization, "location", location, "posture_template", postureTemplate); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + PostureTemplateName that = ((PostureTemplateName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location) + && Objects.equals(this.postureTemplate, that.postureTemplate); + } + 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(postureTemplate); + return h; + } + + /** + * Builder for + * organizations/{organization}/locations/{location}/postureTemplates/{posture_template}. + */ + public static class Builder { + private String organization; + private String location; + private String postureTemplate; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getPostureTemplate() { + return postureTemplate; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPostureTemplate(String postureTemplate) { + this.postureTemplate = postureTemplate; + return this; + } + + private Builder(PostureTemplateName postureTemplateName) { + this.organization = postureTemplateName.organization; + this.location = postureTemplateName.location; + this.postureTemplate = postureTemplateName.postureTemplate; + } + + public PostureTemplateName build() { + return new PostureTemplateName(this); + } + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplateOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplateOrBuilder.java new file mode 100644 index 000000000000..73dc4173b170 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/PostureTemplateOrBuilder.java @@ -0,0 +1,200 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface PostureTemplateOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.PostureTemplate) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Identifier. The name of the Posture template will be of the
+   * format
+   * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. Identifier. The name of the Posture template will be of the
+   * format
+   * organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = IDENTIFIER]; + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The revision_id of a PostureTemplate.
+   * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revisionId. + */ + java.lang.String getRevisionId(); + /** + * + * + *
+   * Output only. The revision_id of a PostureTemplate.
+   * 
+ * + * string revision_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revisionId. + */ + com.google.protobuf.ByteString getRevisionIdBytes(); + + /** + * + * + *
+   * Output only. Description of the Posture template.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Description of the Posture template.
+   * 
+ * + * string description = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. State of PostureTemplate resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of PostureTemplate resource.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureTemplate.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.securityposture.v1.PostureTemplate.State getState(); + + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getPolicySetsList(); + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.securityposture.v1.PolicySet getPolicySets(int index); + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getPolicySetsCount(); + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getPolicySetsOrBuilderList(); + /** + * + * + *
+   * Output only. Policy_sets to be used by the user.
+   * 
+ * + * + * repeated .google.cloud.securityposture.v1.PolicySet policy_sets = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.securityposture.v1.PolicySetOrBuilder getPolicySetsOrBuilder(int index); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsCustomModule.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsCustomModule.java new file mode 100644 index 000000000000..453540d2593d --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsCustomModule.java @@ -0,0 +1,1349 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/sha_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for SHA Custom Module
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule} + */ +public final class SecurityHealthAnalyticsCustomModule + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + SecurityHealthAnalyticsCustomModuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecurityHealthAnalyticsCustomModule.newBuilder() to construct. + private SecurityHealthAnalyticsCustomModule( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecurityHealthAnalyticsCustomModule() { + id_ = ""; + displayName_ = ""; + moduleEnablementState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecurityHealthAnalyticsCustomModule(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.class, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** + * + * + *
+   * Output only. Immutable. The id of the custom module.
+   * The id is server-generated and is not user settable.
+   * It will be a numeric id containing 1-20 digits.
+   * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + } + /** + * + * + *
+   * Output only. Immutable. The id of the custom module.
+   * The id is server-generated and is not user settable.
+   * It will be a numeric id containing 1-20 digits.
+   * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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_ = ""; + /** + * + * + *
+   * Optional. The display name of the Security Health Analytics custom module.
+   * This display name becomes the finding category for all findings that are
+   * returned by this custom module. The display name must be between 1 and
+   * 128 characters, start with a lowercase letter, and contain alphanumeric
+   * characters or underscores only.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. The display name of the Security Health Analytics custom module.
+   * This display name becomes the finding category for all findings that are
+   * returned by this custom module. The display name must be between 1 and
+   * 128 characters, start with a lowercase letter, and contain alphanumeric
+   * characters or underscores only.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.securityposture.v1.CustomConfig config_; + /** + * + * + *
+   * Required. custom module details
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. custom module details
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfig getConfig() { + return config_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.getDefaultInstance() + : config_; + } + /** + * + * + *
+   * Required. custom module details
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.CustomConfigOrBuilder getConfigOrBuilder() { + return config_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.getDefaultInstance() + : config_; + } + + public static final int MODULE_ENABLEMENT_STATE_FIELD_NUMBER = 4; + private int moduleEnablementState_ = 0; + /** + * + * + *
+   * The state of enablement for the module at its level of the resource
+   * hierarchy.
+   * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @return The enum numeric value on the wire for moduleEnablementState. + */ + @java.lang.Override + public int getModuleEnablementStateValue() { + return moduleEnablementState_; + } + /** + * + * + *
+   * The state of enablement for the module at its level of the resource
+   * hierarchy.
+   * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @return The moduleEnablementState. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.EnablementState getModuleEnablementState() { + com.google.cloud.securityposture.v1.EnablementState result = + com.google.cloud.securityposture.v1.EnablementState.forNumber(moduleEnablementState_); + return result == null + ? com.google.cloud.securityposture.v1.EnablementState.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(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getConfig()); + } + if (moduleEnablementState_ + != com.google.cloud.securityposture.v1.EnablementState.ENABLEMENT_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, moduleEnablementState_); + } + 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_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getConfig()); + } + if (moduleEnablementState_ + != com.google.cloud.securityposture.v1.EnablementState.ENABLEMENT_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, moduleEnablementState_); + } + 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.securityposture.v1.SecurityHealthAnalyticsCustomModule)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule other = + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) obj; + + if (!getId().equals(other.getId())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig().equals(other.getConfig())) return false; + } + if (moduleEnablementState_ != other.moduleEnablementState_) 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(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + hash = (37 * hash) + MODULE_ENABLEMENT_STATE_FIELD_NUMBER; + hash = (53 * hash) + moduleEnablementState_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule 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.securityposture.v1.SecurityHealthAnalyticsCustomModule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule 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.securityposture.v1.SecurityHealthAnalyticsCustomModule parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule 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.securityposture.v1.SecurityHealthAnalyticsCustomModule + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + 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.securityposture.v1.SecurityHealthAnalyticsCustomModule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule 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.securityposture.v1.SecurityHealthAnalyticsCustomModule 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 SHA Custom Module
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.class, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.Builder + .class); + } + + // Construct using + // com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + displayName_ = ""; + config_ = null; + if (configBuilder_ != null) { + configBuilder_.dispose(); + configBuilder_ = null; + } + moduleEnablementState_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule build() { + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule buildPartial() { + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule result = + new com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.config_ = configBuilder_ == null ? config_ : configBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.moduleEnablementState_ = moduleEnablementState_; + } + 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.securityposture.v1.SecurityHealthAnalyticsCustomModule) { + return mergeFrom( + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule other) { + if (other + == com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.moduleEnablementState_ != 0) { + setModuleEnablementStateValue(other.getModuleEnablementStateValue()); + } + 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 + case 26: + { + input.readMessage(getConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + moduleEnablementState_ = 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 java.lang.Object id_ = ""; + /** + * + * + *
+     * Output only. Immutable. The id of the custom module.
+     * The id is server-generated and is not user settable.
+     * It will be a numeric id containing 1-20 digits.
+     * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + } + /** + * + * + *
+     * Output only. Immutable. The id of the custom module.
+     * The id is server-generated and is not user settable.
+     * It will be a numeric id containing 1-20 digits.
+     * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + } + /** + * + * + *
+     * Output only. Immutable. The id of the custom module.
+     * The id is server-generated and is not user settable.
+     * It will be a numeric id containing 1-20 digits.
+     * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + } + /** + * + * + *
+     * Output only. Immutable. The id of the custom module.
+     * The id is server-generated and is not user settable.
+     * It will be a numeric id containing 1-20 digits.
+     * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Immutable. The id of the custom module.
+     * The id is server-generated and is not user settable.
+     * It will be a numeric id containing 1-20 digits.
+     * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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_ = ""; + /** + * + * + *
+     * Optional. The display name of the Security Health Analytics custom module.
+     * This display name becomes the finding category for all findings that are
+     * returned by this custom module. The display name must be between 1 and
+     * 128 characters, start with a lowercase letter, and contain alphanumeric
+     * characters or underscores only.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The display name of the Security Health Analytics custom module.
+     * This display name becomes the finding category for all findings that are
+     * returned by this custom module. The display name must be between 1 and
+     * 128 characters, start with a lowercase letter, and contain alphanumeric
+     * characters or underscores only.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The display name of the Security Health Analytics custom module.
+     * This display name becomes the finding category for all findings that are
+     * returned by this custom module. The display name must be between 1 and
+     * 128 characters, start with a lowercase letter, and contain alphanumeric
+     * characters or underscores only.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. The display name of the Security Health Analytics custom module.
+     * This display name becomes the finding category for all findings that are
+     * returned by this custom module. The display name must be between 1 and
+     * 128 characters, start with a lowercase letter, and contain alphanumeric
+     * characters or underscores only.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The display name of the Security Health Analytics custom module.
+     * This display name becomes the finding category for all findings that are
+     * returned by this custom module. The display name must be between 1 and
+     * 128 characters, start with a lowercase letter, and contain alphanumeric
+     * characters or underscores only.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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.securityposture.v1.CustomConfig config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig, + com.google.cloud.securityposture.v1.CustomConfig.Builder, + com.google.cloud.securityposture.v1.CustomConfigOrBuilder> + configBuilder_; + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + public com.google.cloud.securityposture.v1.CustomConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.getDefaultInstance() + : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConfig(com.google.cloud.securityposture.v1.CustomConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + } else { + configBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setConfig( + com.google.cloud.securityposture.v1.CustomConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeConfig(com.google.cloud.securityposture.v1.CustomConfig value) { + if (configBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && config_ != null + && config_ != com.google.cloud.securityposture.v1.CustomConfig.getDefaultInstance()) { + getConfigBuilder().mergeFrom(value); + } else { + config_ = value; + } + } else { + configBuilder_.mergeFrom(value); + } + if (config_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + config_ = null; + if (configBuilder_ != null) { + configBuilder_.dispose(); + configBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfig.Builder getConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.CustomConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null + ? com.google.cloud.securityposture.v1.CustomConfig.getDefaultInstance() + : config_; + } + } + /** + * + * + *
+     * Required. custom module details
+     * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig, + com.google.cloud.securityposture.v1.CustomConfig.Builder, + com.google.cloud.securityposture.v1.CustomConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.CustomConfig, + com.google.cloud.securityposture.v1.CustomConfig.Builder, + com.google.cloud.securityposture.v1.CustomConfigOrBuilder>( + getConfig(), getParentForChildren(), isClean()); + config_ = null; + } + return configBuilder_; + } + + private int moduleEnablementState_ = 0; + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @return The enum numeric value on the wire for moduleEnablementState. + */ + @java.lang.Override + public int getModuleEnablementStateValue() { + return moduleEnablementState_; + } + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @param value The enum numeric value on the wire for moduleEnablementState to set. + * @return This builder for chaining. + */ + public Builder setModuleEnablementStateValue(int value) { + moduleEnablementState_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @return The moduleEnablementState. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.EnablementState getModuleEnablementState() { + com.google.cloud.securityposture.v1.EnablementState result = + com.google.cloud.securityposture.v1.EnablementState.forNumber(moduleEnablementState_); + return result == null + ? com.google.cloud.securityposture.v1.EnablementState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @param value The moduleEnablementState to set. + * @return This builder for chaining. + */ + public Builder setModuleEnablementState( + com.google.cloud.securityposture.v1.EnablementState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + moduleEnablementState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @return This builder for chaining. + */ + public Builder clearModuleEnablementState() { + bitField0_ = (bitField0_ & ~0x00000008); + moduleEnablementState_ = 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.securityposture.v1.SecurityHealthAnalyticsCustomModule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + private static final com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule(); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityHealthAnalyticsCustomModule 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.securityposture.v1.SecurityHealthAnalyticsCustomModule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsCustomModuleOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsCustomModuleOrBuilder.java new file mode 100644 index 000000000000..5c1ed204c52a --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsCustomModuleOrBuilder.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/securityposture/v1/sha_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface SecurityHealthAnalyticsCustomModuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.SecurityHealthAnalyticsCustomModule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Immutable. The id of the custom module.
+   * The id is server-generated and is not user settable.
+   * It will be a numeric id containing 1-20 digits.
+   * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * Output only. Immutable. The id of the custom module.
+   * The id is server-generated and is not user settable.
+   * It will be a numeric id containing 1-20 digits.
+   * 
+ * + * + * string id = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * Optional. The display name of the Security Health Analytics custom module.
+   * This display name becomes the finding category for all findings that are
+   * returned by this custom module. The display name must be between 1 and
+   * 128 characters, start with a lowercase letter, and contain alphanumeric
+   * characters or underscores only.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Optional. The display name of the Security Health Analytics custom module.
+   * This display name becomes the finding category for all findings that are
+   * returned by this custom module. The display name must be between 1 and
+   * 128 characters, start with a lowercase letter, and contain alphanumeric
+   * characters or underscores only.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Required. custom module details
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + * + * + *
+   * Required. custom module details
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The config. + */ + com.google.cloud.securityposture.v1.CustomConfig getConfig(); + /** + * + * + *
+   * Required. custom module details
+   * 
+ * + * + * .google.cloud.securityposture.v1.CustomConfig config = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.CustomConfigOrBuilder getConfigOrBuilder(); + + /** + * + * + *
+   * The state of enablement for the module at its level of the resource
+   * hierarchy.
+   * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @return The enum numeric value on the wire for moduleEnablementState. + */ + int getModuleEnablementStateValue(); + /** + * + * + *
+   * The state of enablement for the module at its level of the resource
+   * hierarchy.
+   * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 4; + * + * @return The moduleEnablementState. + */ + com.google.cloud.securityposture.v1.EnablementState getModuleEnablementState(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsModule.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsModule.java new file mode 100644 index 000000000000..f2be1fff9fa8 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsModule.java @@ -0,0 +1,799 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/sha_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for Security Health Analytics built-in detector.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.SecurityHealthAnalyticsModule} + */ +public final class SecurityHealthAnalyticsModule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) + SecurityHealthAnalyticsModuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecurityHealthAnalyticsModule.newBuilder() to construct. + private SecurityHealthAnalyticsModule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecurityHealthAnalyticsModule() { + moduleName_ = ""; + moduleEnablementState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecurityHealthAnalyticsModule(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.class, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.Builder.class); + } + + public static final int MODULE_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object moduleName_ = ""; + /** + * + * + *
+   * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+   * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The moduleName. + */ + @java.lang.Override + public java.lang.String getModuleName() { + java.lang.Object ref = moduleName_; + 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(); + moduleName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+   * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for moduleName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModuleNameBytes() { + java.lang.Object ref = moduleName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + moduleName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODULE_ENABLEMENT_STATE_FIELD_NUMBER = 2; + private int moduleEnablementState_ = 0; + /** + * + * + *
+   * The state of enablement for the module at its level of the resource
+   * hierarchy.
+   * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @return The enum numeric value on the wire for moduleEnablementState. + */ + @java.lang.Override + public int getModuleEnablementStateValue() { + return moduleEnablementState_; + } + /** + * + * + *
+   * The state of enablement for the module at its level of the resource
+   * hierarchy.
+   * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @return The moduleEnablementState. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.EnablementState getModuleEnablementState() { + com.google.cloud.securityposture.v1.EnablementState result = + com.google.cloud.securityposture.v1.EnablementState.forNumber(moduleEnablementState_); + return result == null + ? com.google.cloud.securityposture.v1.EnablementState.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(moduleName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, moduleName_); + } + if (moduleEnablementState_ + != com.google.cloud.securityposture.v1.EnablementState.ENABLEMENT_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, moduleEnablementState_); + } + 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(moduleName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, moduleName_); + } + if (moduleEnablementState_ + != com.google.cloud.securityposture.v1.EnablementState.ENABLEMENT_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, moduleEnablementState_); + } + 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.securityposture.v1.SecurityHealthAnalyticsModule)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule other = + (com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) obj; + + if (!getModuleName().equals(other.getModuleName())) return false; + if (moduleEnablementState_ != other.moduleEnablementState_) 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) + MODULE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getModuleName().hashCode(); + hash = (37 * hash) + MODULE_ENABLEMENT_STATE_FIELD_NUMBER; + hash = (53 * hash) + moduleEnablementState_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule 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.securityposture.v1.SecurityHealthAnalyticsModule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule 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.securityposture.v1.SecurityHealthAnalyticsModule parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule 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.securityposture.v1.SecurityHealthAnalyticsModule + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + 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.securityposture.v1.SecurityHealthAnalyticsModule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule 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.securityposture.v1.SecurityHealthAnalyticsModule 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 Security Health Analytics built-in detector.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.SecurityHealthAnalyticsModule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.class, + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.Builder.class); + } + + // Construct using + // com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + moduleName_ = ""; + moduleEnablementState_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.ShaConstraintsProto + .internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule build() { + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule buildPartial() { + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule result = + new com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.moduleName_ = moduleName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.moduleEnablementState_ = moduleEnablementState_; + } + } + + @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.securityposture.v1.SecurityHealthAnalyticsModule) { + return mergeFrom((com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule other) { + if (other + == com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule.getDefaultInstance()) + return this; + if (!other.getModuleName().isEmpty()) { + moduleName_ = other.moduleName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.moduleEnablementState_ != 0) { + setModuleEnablementStateValue(other.getModuleEnablementStateValue()); + } + 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: + { + moduleName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + moduleEnablementState_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object moduleName_ = ""; + /** + * + * + *
+     * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+     * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The moduleName. + */ + public java.lang.String getModuleName() { + java.lang.Object ref = moduleName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + moduleName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+     * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for moduleName. + */ + public com.google.protobuf.ByteString getModuleNameBytes() { + java.lang.Object ref = moduleName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + moduleName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+     * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The moduleName to set. + * @return This builder for chaining. + */ + public Builder setModuleName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + moduleName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+     * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearModuleName() { + moduleName_ = getDefaultInstance().getModuleName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+     * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for moduleName to set. + * @return This builder for chaining. + */ + public Builder setModuleNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + moduleName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int moduleEnablementState_ = 0; + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @return The enum numeric value on the wire for moduleEnablementState. + */ + @java.lang.Override + public int getModuleEnablementStateValue() { + return moduleEnablementState_; + } + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @param value The enum numeric value on the wire for moduleEnablementState to set. + * @return This builder for chaining. + */ + public Builder setModuleEnablementStateValue(int value) { + moduleEnablementState_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @return The moduleEnablementState. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.EnablementState getModuleEnablementState() { + com.google.cloud.securityposture.v1.EnablementState result = + com.google.cloud.securityposture.v1.EnablementState.forNumber(moduleEnablementState_); + return result == null + ? com.google.cloud.securityposture.v1.EnablementState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @param value The moduleEnablementState to set. + * @return This builder for chaining. + */ + public Builder setModuleEnablementState( + com.google.cloud.securityposture.v1.EnablementState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + moduleEnablementState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The state of enablement for the module at its level of the resource
+     * hierarchy.
+     * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @return This builder for chaining. + */ + public Builder clearModuleEnablementState() { + bitField0_ = (bitField0_ & ~0x00000002); + moduleEnablementState_ = 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.securityposture.v1.SecurityHealthAnalyticsModule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) + private static final com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule(); + } + + public static com.google.cloud.securityposture.v1.SecurityHealthAnalyticsModule + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecurityHealthAnalyticsModule 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.securityposture.v1.SecurityHealthAnalyticsModule + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsModuleOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsModuleOrBuilder.java new file mode 100644 index 000000000000..c01efa1c0e04 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/SecurityHealthAnalyticsModuleOrBuilder.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/securityposture/v1/sha_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface SecurityHealthAnalyticsModuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.SecurityHealthAnalyticsModule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+   * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The moduleName. + */ + java.lang.String getModuleName(); + /** + * + * + *
+   * Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED.
+   * 
+ * + * string module_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for moduleName. + */ + com.google.protobuf.ByteString getModuleNameBytes(); + + /** + * + * + *
+   * The state of enablement for the module at its level of the resource
+   * hierarchy.
+   * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @return The enum numeric value on the wire for moduleEnablementState. + */ + int getModuleEnablementStateValue(); + /** + * + * + *
+   * The state of enablement for the module at its level of the resource
+   * hierarchy.
+   * 
+ * + * .google.cloud.securityposture.v1.EnablementState module_enablement_state = 2; + * + * @return The moduleEnablementState. + */ + com.google.cloud.securityposture.v1.EnablementState getModuleEnablementState(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ShaConstraintsProto.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ShaConstraintsProto.java new file mode 100644 index 000000000000..bba4195a6009 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ShaConstraintsProto.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/securityposture/v1/sha_constraints.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public final class ShaConstraintsProto { + private ShaConstraintsProto() {} + + 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_securityposture_v1_SecurityHealthAnalyticsModule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_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/securityposture/v1/sha_co" + + "nstraints.proto\022\037google.cloud.securitypo" + + "sture.v1\032\037google/api/field_behavior.prot" + + "o\0327google/cloud/securityposture/v1/sha_c" + + "ustom_config.proto\"\214\001\n\035SecurityHealthAna" + + "lyticsModule\022\030\n\013module_name\030\001 \001(\tB\003\340A\002\022Q" + + "\n\027module_enablement_state\030\002 \001(\01620.google" + + ".cloud.securityposture.v1.EnablementStat" + + "e\"\353\001\n#SecurityHealthAnalyticsCustomModul" + + "e\022\022\n\002id\030\001 \001(\tB\006\340A\005\340A\003\022\031\n\014display_name\030\002 " + + "\001(\tB\003\340A\001\022B\n\006config\030\003 \001(\0132-.google.cloud." + + "securityposture.v1.CustomConfigB\003\340A\002\022Q\n\027" + + "module_enablement_state\030\004 \001(\01620.google.c" + + "loud.securityposture.v1.EnablementState*" + + "N\n\017EnablementState\022 \n\034ENABLEMENT_STATE_U" + + "NSPECIFIED\020\000\022\013\n\007ENABLED\020\001\022\014\n\010DISABLED\020\002B" + + "\213\001\n#com.google.cloud.securityposture.v1B" + + "\023ShaConstraintsProtoP\001ZMcloud.google.com" + + "/go/securityposture/apiv1/securitypostur" + + "epb;securityposturepbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.securityposture.v1.ShaCustomConfigProto.getDescriptor(), + }); + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsModule_descriptor, + new java.lang.String[] { + "ModuleName", "ModuleEnablementState", + }); + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_SecurityHealthAnalyticsCustomModule_descriptor, + new java.lang.String[] { + "Id", "DisplayName", "Config", "ModuleEnablementState", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.securityposture.v1.ShaCustomConfigProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ShaCustomConfigProto.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ShaCustomConfigProto.java new file mode 100644 index 000000000000..af3c9cb9c95e --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/ShaCustomConfigProto.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/securityposture/v1/sha_custom_config.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public final class ShaCustomConfigProto { + private ShaCustomConfigProto() {} + + 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_securityposture_v1_CustomConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_CustomConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_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/securityposture/v1/sha_cu" + + "stom_config.proto\022\037google.cloud.security" + + "posture.v1\032\037google/api/field_behavior.pr" + + "oto\032\026google/type/expr.proto\"\307\005\n\014CustomCo" + + "nfig\022)\n\tpredicate\030\001 \001(\0132\021.google.type.Ex" + + "prB\003\340A\002\022Z\n\rcustom_output\030\002 \001(\0132>.google." + + "cloud.securityposture.v1.CustomConfig.Cu" + + "stomOutputSpecB\003\340A\001\022^\n\021resource_selector" + + "\030\003 \001(\0132>.google.cloud.securityposture.v1" + + ".CustomConfig.ResourceSelectorB\003\340A\002\022M\n\010s" + + "everity\030\004 \001(\01626.google.cloud.securitypos" + + "ture.v1.CustomConfig.SeverityB\003\340A\002\022\030\n\013de" + + "scription\030\005 \001(\tB\003\340A\001\022\033\n\016recommendation\030\006" + + " \001(\tB\003\340A\001\032\305\001\n\020CustomOutputSpec\022`\n\nproper" + + "ties\030\001 \003(\0132G.google.cloud.securitypostur" + + "e.v1.CustomConfig.CustomOutputSpec.Prope" + + "rtyB\003\340A\001\032O\n\010Property\022\021\n\004name\030\001 \001(\tB\003\340A\002\022" + + "0\n\020value_expression\030\002 \001(\0132\021.google.type." + + "ExprB\003\340A\001\032/\n\020ResourceSelector\022\033\n\016resourc" + + "e_types\030\001 \003(\tB\003\340A\002\"Q\n\010Severity\022\030\n\024SEVERI" + + "TY_UNSPECIFIED\020\000\022\014\n\010CRITICAL\020\001\022\010\n\004HIGH\020\002" + + "\022\n\n\006MEDIUM\020\003\022\007\n\003LOW\020\004B\214\001\n#com.google.clo" + + "ud.securityposture.v1B\024ShaCustomConfigPr" + + "otoP\001ZMcloud.google.com/go/securitypostu" + + "re/apiv1/securityposturepb;securitypostu" + + "repbb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.type.ExprProto.getDescriptor(), + }); + internal_static_google_cloud_securityposture_v1_CustomConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securityposture_v1_CustomConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_CustomConfig_descriptor, + new java.lang.String[] { + "Predicate", + "CustomOutput", + "ResourceSelector", + "Severity", + "Description", + "Recommendation", + }); + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_descriptor = + internal_static_google_cloud_securityposture_v1_CustomConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_descriptor, + new java.lang.String[] { + "Properties", + }); + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_descriptor = + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_CustomConfig_CustomOutputSpec_Property_descriptor, + new java.lang.String[] { + "Name", "ValueExpression", + }); + internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_descriptor = + internal_static_google_cloud_securityposture_v1_CustomConfig_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_CustomConfig_ResourceSelector_descriptor, + new java.lang.String[] { + "ResourceTypes", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.type.ExprProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureDeploymentRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureDeploymentRequest.java new file mode 100644 index 000000000000..ca45571946cb --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureDeploymentRequest.java @@ -0,0 +1,1093 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for updating a PostureDeployment.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.UpdatePostureDeploymentRequest} + */ +public final class UpdatePostureDeploymentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.UpdatePostureDeploymentRequest) + UpdatePostureDeploymentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdatePostureDeploymentRequest.newBuilder() to construct. + private UpdatePostureDeploymentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdatePostureDeploymentRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdatePostureDeploymentRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest.class, + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest.Builder.class); + } + + private int bitField0_; + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * PostureDeployment resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * PostureDeployment resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * PostureDeployment resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int POSTURE_DEPLOYMENT_FIELD_NUMBER = 2; + private com.google.cloud.securityposture.v1.PostureDeployment postureDeployment_; + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the postureDeployment field is set. + */ + @java.lang.Override + public boolean hasPostureDeployment() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The postureDeployment. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployment() { + return postureDeployment_ == null + ? com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance() + : postureDeployment_; + } + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder + getPostureDeploymentOrBuilder() { + return postureDeployment_ == null + ? com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance() + : postureDeployment_; + } + + 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, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getPostureDeployment()); + } + 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, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPostureDeployment()); + } + 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.securityposture.v1.UpdatePostureDeploymentRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest other = + (com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasPostureDeployment() != other.hasPostureDeployment()) return false; + if (hasPostureDeployment()) { + if (!getPostureDeployment().equals(other.getPostureDeployment())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasPostureDeployment()) { + hash = (37 * hash) + POSTURE_DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getPostureDeployment().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest 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.securityposture.v1.UpdatePostureDeploymentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest 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.securityposture.v1.UpdatePostureDeploymentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest 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.securityposture.v1.UpdatePostureDeploymentRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest + 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.securityposture.v1.UpdatePostureDeploymentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest 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.securityposture.v1.UpdatePostureDeploymentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a PostureDeployment.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.UpdatePostureDeploymentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.UpdatePostureDeploymentRequest) + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest.class, + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest.Builder.class); + } + + // Construct using + // com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUpdateMaskFieldBuilder(); + getPostureDeploymentFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + postureDeployment_ = null; + if (postureDeploymentBuilder_ != null) { + postureDeploymentBuilder_.dispose(); + postureDeploymentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest + getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest build() { + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest buildPartial() { + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest result = + new com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.postureDeployment_ = + postureDeploymentBuilder_ == null + ? postureDeployment_ + : postureDeploymentBuilder_.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.securityposture.v1.UpdatePostureDeploymentRequest) { + return mergeFrom( + (com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest other) { + if (other + == com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest + .getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasPostureDeployment()) { + mergePostureDeployment(other.getPostureDeployment()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getPostureDeploymentFieldBuilder().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.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * PostureDeployment resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.securityposture.v1.PostureDeployment postureDeployment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder> + postureDeploymentBuilder_; + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the postureDeployment field is set. + */ + public boolean hasPostureDeployment() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The postureDeployment. + */ + public com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployment() { + if (postureDeploymentBuilder_ == null) { + return postureDeployment_ == null + ? com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance() + : postureDeployment_; + } else { + return postureDeploymentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPostureDeployment( + com.google.cloud.securityposture.v1.PostureDeployment value) { + if (postureDeploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + postureDeployment_ = value; + } else { + postureDeploymentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPostureDeployment( + com.google.cloud.securityposture.v1.PostureDeployment.Builder builderForValue) { + if (postureDeploymentBuilder_ == null) { + postureDeployment_ = builderForValue.build(); + } else { + postureDeploymentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePostureDeployment( + com.google.cloud.securityposture.v1.PostureDeployment value) { + if (postureDeploymentBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && postureDeployment_ != null + && postureDeployment_ + != com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance()) { + getPostureDeploymentBuilder().mergeFrom(value); + } else { + postureDeployment_ = value; + } + } else { + postureDeploymentBuilder_.mergeFrom(value); + } + if (postureDeployment_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPostureDeployment() { + bitField0_ = (bitField0_ & ~0x00000002); + postureDeployment_ = null; + if (postureDeploymentBuilder_ != null) { + postureDeploymentBuilder_.dispose(); + postureDeploymentBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PostureDeployment.Builder + getPostureDeploymentBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getPostureDeploymentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder + getPostureDeploymentOrBuilder() { + if (postureDeploymentBuilder_ != null) { + return postureDeploymentBuilder_.getMessageOrBuilder(); + } else { + return postureDeployment_ == null + ? com.google.cloud.securityposture.v1.PostureDeployment.getDefaultInstance() + : postureDeployment_; + } + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder> + getPostureDeploymentFieldBuilder() { + if (postureDeploymentBuilder_ == null) { + postureDeploymentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.PostureDeployment, + com.google.cloud.securityposture.v1.PostureDeployment.Builder, + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder>( + getPostureDeployment(), getParentForChildren(), isClean()); + postureDeployment_ = null; + } + return postureDeploymentBuilder_; + } + + @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.securityposture.v1.UpdatePostureDeploymentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.UpdatePostureDeploymentRequest) + private static final com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest(); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePostureDeploymentRequest 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.securityposture.v1.UpdatePostureDeploymentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureDeploymentRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureDeploymentRequestOrBuilder.java new file mode 100644 index 000000000000..614f3d28b916 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureDeploymentRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface UpdatePostureDeploymentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.UpdatePostureDeploymentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * PostureDeployment resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * PostureDeployment resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * PostureDeployment resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the postureDeployment field is set. + */ + boolean hasPostureDeployment(); + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The postureDeployment. + */ + com.google.cloud.securityposture.v1.PostureDeployment getPostureDeployment(); + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.PostureDeployment posture_deployment = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PostureDeploymentOrBuilder getPostureDeploymentOrBuilder(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureRequest.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureRequest.java new file mode 100644 index 000000000000..650ad619a2c8 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureRequest.java @@ -0,0 +1,1253 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +/** + * + * + *
+ * Message for updating a Posture.
+ * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.UpdatePostureRequest} + */ +public final class UpdatePostureRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.securityposture.v1.UpdatePostureRequest) + UpdatePostureRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdatePostureRequest.newBuilder() to construct. + private UpdatePostureRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdatePostureRequest() { + revisionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdatePostureRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.UpdatePostureRequest.class, + com.google.cloud.securityposture.v1.UpdatePostureRequest.Builder.class); + } + + private int bitField0_; + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Posture resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Posture resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Posture resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int POSTURE_FIELD_NUMBER = 2; + private com.google.cloud.securityposture.v1.Posture posture_; + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the posture field is set. + */ + @java.lang.Override + public boolean hasPosture() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The posture. + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.Posture getPosture() { + return posture_ == null + ? com.google.cloud.securityposture.v1.Posture.getDefaultInstance() + : posture_; + } + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.securityposture.v1.PostureOrBuilder getPostureOrBuilder() { + return posture_ == null + ? com.google.cloud.securityposture.v1.Posture.getDefaultInstance() + : posture_; + } + + public static final int REVISION_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object revisionId_ = ""; + /** + * + * + *
+   * Required. Posture revision which needs to be updated.
+   * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revisionId. + */ + @java.lang.Override + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + 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(); + revisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Posture revision which needs to be updated.
+   * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for revisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = 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, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getPosture()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, revisionId_); + } + 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, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPosture()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, revisionId_); + } + 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.securityposture.v1.UpdatePostureRequest)) { + return super.equals(obj); + } + com.google.cloud.securityposture.v1.UpdatePostureRequest other = + (com.google.cloud.securityposture.v1.UpdatePostureRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasPosture() != other.hasPosture()) return false; + if (hasPosture()) { + if (!getPosture().equals(other.getPosture())) return false; + } + if (!getRevisionId().equals(other.getRevisionId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasPosture()) { + hash = (37 * hash) + POSTURE_FIELD_NUMBER; + hash = (53 * hash) + getPosture().hashCode(); + } + hash = (37 * hash) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest 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.securityposture.v1.UpdatePostureRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest 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.securityposture.v1.UpdatePostureRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest 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.securityposture.v1.UpdatePostureRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest 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.securityposture.v1.UpdatePostureRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest 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.securityposture.v1.UpdatePostureRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Message for updating a Posture.
+   * 
+ * + * Protobuf type {@code google.cloud.securityposture.v1.UpdatePostureRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.securityposture.v1.UpdatePostureRequest) + com.google.cloud.securityposture.v1.UpdatePostureRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.securityposture.v1.UpdatePostureRequest.class, + com.google.cloud.securityposture.v1.UpdatePostureRequest.Builder.class); + } + + // Construct using com.google.cloud.securityposture.v1.UpdatePostureRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUpdateMaskFieldBuilder(); + getPostureFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + posture_ = null; + if (postureBuilder_ != null) { + postureBuilder_.dispose(); + postureBuilder_ = null; + } + revisionId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.securityposture.v1.V1mainProto + .internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.UpdatePostureRequest getDefaultInstanceForType() { + return com.google.cloud.securityposture.v1.UpdatePostureRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.UpdatePostureRequest build() { + com.google.cloud.securityposture.v1.UpdatePostureRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.securityposture.v1.UpdatePostureRequest buildPartial() { + com.google.cloud.securityposture.v1.UpdatePostureRequest result = + new com.google.cloud.securityposture.v1.UpdatePostureRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.securityposture.v1.UpdatePostureRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.posture_ = postureBuilder_ == null ? posture_ : postureBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.revisionId_ = revisionId_; + } + 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.securityposture.v1.UpdatePostureRequest) { + return mergeFrom((com.google.cloud.securityposture.v1.UpdatePostureRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.securityposture.v1.UpdatePostureRequest other) { + if (other == com.google.cloud.securityposture.v1.UpdatePostureRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasPosture()) { + mergePosture(other.getPosture()); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getPostureFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + revisionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Field mask is used to specify the fields to be overwritten in the
+     * Posture resource by the update.
+     * The fields specified in the update_mask are relative to the resource, not
+     * the full request. A field will be overwritten if it is in the mask. If the
+     * user does not provide a mask then all fields will be overwritten.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.securityposture.v1.Posture posture_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder> + postureBuilder_; + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the posture field is set. + */ + public boolean hasPosture() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The posture. + */ + public com.google.cloud.securityposture.v1.Posture getPosture() { + if (postureBuilder_ == null) { + return posture_ == null + ? com.google.cloud.securityposture.v1.Posture.getDefaultInstance() + : posture_; + } else { + return postureBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPosture(com.google.cloud.securityposture.v1.Posture value) { + if (postureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + posture_ = value; + } else { + postureBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPosture(com.google.cloud.securityposture.v1.Posture.Builder builderForValue) { + if (postureBuilder_ == null) { + posture_ = builderForValue.build(); + } else { + postureBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergePosture(com.google.cloud.securityposture.v1.Posture value) { + if (postureBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && posture_ != null + && posture_ != com.google.cloud.securityposture.v1.Posture.getDefaultInstance()) { + getPostureBuilder().mergeFrom(value); + } else { + posture_ = value; + } + } else { + postureBuilder_.mergeFrom(value); + } + if (posture_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPosture() { + bitField0_ = (bitField0_ & ~0x00000002); + posture_ = null; + if (postureBuilder_ != null) { + postureBuilder_.dispose(); + postureBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.Posture.Builder getPostureBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getPostureFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.securityposture.v1.PostureOrBuilder getPostureOrBuilder() { + if (postureBuilder_ != null) { + return postureBuilder_.getMessageOrBuilder(); + } else { + return posture_ == null + ? com.google.cloud.securityposture.v1.Posture.getDefaultInstance() + : posture_; + } + } + /** + * + * + *
+     * Required. The resource being updated.
+     * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder> + getPostureFieldBuilder() { + if (postureBuilder_ == null) { + postureBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.securityposture.v1.Posture, + com.google.cloud.securityposture.v1.Posture.Builder, + com.google.cloud.securityposture.v1.PostureOrBuilder>( + getPosture(), getParentForChildren(), isClean()); + posture_ = null; + } + return postureBuilder_; + } + + private java.lang.Object revisionId_ = ""; + /** + * + * + *
+     * Required. Posture revision which needs to be updated.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revisionId. + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Posture revision which needs to be updated.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for revisionId. + */ + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Posture revision which needs to be updated.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Posture revision which needs to be updated.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearRevisionId() { + revisionId_ = getDefaultInstance().getRevisionId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Posture revision which needs to be updated.
+     * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionId_ = 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.securityposture.v1.UpdatePostureRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.securityposture.v1.UpdatePostureRequest) + private static final com.google.cloud.securityposture.v1.UpdatePostureRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.securityposture.v1.UpdatePostureRequest(); + } + + public static com.google.cloud.securityposture.v1.UpdatePostureRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePostureRequest 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.securityposture.v1.UpdatePostureRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureRequestOrBuilder.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureRequestOrBuilder.java new file mode 100644 index 000000000000..ee8656193904 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/UpdatePostureRequestOrBuilder.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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public interface UpdatePostureRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.securityposture.v1.UpdatePostureRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Posture resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Posture resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Field mask is used to specify the fields to be overwritten in the
+   * Posture resource by the update.
+   * The fields specified in the update_mask are relative to the resource, not
+   * the full request. A field will be overwritten if it is in the mask. If the
+   * user does not provide a mask then all fields will be overwritten.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the posture field is set. + */ + boolean hasPosture(); + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The posture. + */ + com.google.cloud.securityposture.v1.Posture getPosture(); + /** + * + * + *
+   * Required. The resource being updated.
+   * 
+ * + * + * .google.cloud.securityposture.v1.Posture posture = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.securityposture.v1.PostureOrBuilder getPostureOrBuilder(); + + /** + * + * + *
+   * Required. Posture revision which needs to be updated.
+   * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The revisionId. + */ + java.lang.String getRevisionId(); + /** + * + * + *
+   * Required. Posture revision which needs to be updated.
+   * 
+ * + * string revision_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for revisionId. + */ + com.google.protobuf.ByteString getRevisionIdBytes(); +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/V1mainProto.java b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/V1mainProto.java new file mode 100644 index 000000000000..78b594d9b250 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/java/com/google/cloud/securityposture/v1/V1mainProto.java @@ -0,0 +1,704 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/securityposture/v1/securityposture.proto + +// Protobuf Java Version: 3.25.2 +package com.google.cloud.securityposture.v1; + +public final class V1mainProto { + private V1mainProto() {} + + 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_securityposture_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_Posture_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_Posture_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_Posture_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_Posture_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_PolicySet_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_PolicySet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_Policy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_Policy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_Constraint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_Constraint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ListPosturesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ListPosturesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ListPosturesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ListPosturesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_GetPostureRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_GetPostureRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_CreatePostureRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_CreatePostureRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_DeletePostureRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_DeletePostureRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_PostureDeployment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_PostureDeployment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_PostureDeployment_AnnotationsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_PostureDeployment_AnnotationsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_PostureTemplate_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_PostureTemplate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_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/securityposture/v1/securi" + + "typosture.proto\022\037google.cloud.securitypo" + + "sture.v1\032\034google/api/annotations.proto\032\027" + + "google/api/client.proto\032\037google/api/fiel" + + "d_behavior.proto\032\031google/api/resource.pr" + + "oto\032\n\010policies\030\003" + + " \003(\0132\'.google.cloud.securityposture.v1.P" + + "olicyB\003\340A\002\"\242\002\n\006Policy\022\026\n\tpolicy_id\030\001 \001(\t" + + "B\003\340A\002\022]\n\024compliance_standards\030\002 \003(\0132:.go" + + "ogle.cloud.securityposture.v1.Policy.Com" + + "plianceStandardB\003\340A\001\022D\n\nconstraint\030\003 \001(\013" + + "2+.google.cloud.securityposture.v1.Const" + + "raintB\003\340A\002\022\030\n\013description\030\004 \001(\tB\003\340A\001\032A\n\022" + + "ComplianceStandard\022\025\n\010standard\030\001 \001(\tB\003\340A" + + "\001\022\024\n\007control\030\002 \001(\tB\003\340A\001\"\322\003\n\nConstraint\022o" + + "\n security_health_analytics_module\030\003 \001(\013" + + "2>.google.cloud.securityposture.v1.Secur" + + "ityHealthAnalyticsModuleB\003\340A\001H\000\022|\n\'secur" + + "ity_health_analytics_custom_module\030\004 \001(\013" + + "2D.google.cloud.securityposture.v1.Secur" + + "ityHealthAnalyticsCustomModuleB\003\340A\001H\000\022Z\n" + + "\025org_policy_constraint\030\005 \001(\01324.google.cl" + + "oud.securityposture.v1.OrgPolicyConstrai" + + "ntB\003\340A\001H\000\022g\n\034org_policy_constraint_custo" + + "m\030\006 \001(\0132:.google.cloud.securityposture.v" + + "1.OrgPolicyConstraintCustomB\003\340A\001H\000B\020\n\016im" + + "plementation\"|\n\023ListPosturesRequest\022>\n\006p" + + "arent\030\001 \001(\tB.\340A\002\372A(\022&securityposture.goo" + + "gleapis.com/Posture\022\021\n\tpage_size\030\002 \001(\005\022\022" + + "\n\npage_token\030\003 \001(\t\"\200\001\n\024ListPosturesRespo" + + "nse\022:\n\010postures\030\001 \003(\0132(.google.cloud.sec" + + "urityposture.v1.Posture\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\214\001\n\033ListPo" + + "stureRevisionsRequest\022<\n\004name\030\001 \001(\tB.\340A\002" + + "\372A(\n&securityposture.googleapis.com/Post" + + "ure\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\"t\n\034ListPostureRevisionsResp" + + "onse\022;\n\trevisions\030\001 \003(\0132(.google.cloud.s" + + "ecurityposture.v1.Posture\022\027\n\017next_page_t" + + "oken\030\002 \001(\t\"k\n\021GetPostureRequest\022<\n\004name\030" + + "\001 \001(\tB.\340A\002\372A(\n&securityposture.googleapi" + + "s.com/Posture\022\030\n\013revision_id\030\003 \001(\tB\003\340A\001\"" + + "\257\001\n\024CreatePostureRequest\022>\n\006parent\030\001 \001(\t" + + "B.\340A\002\372A(\022&securityposture.googleapis.com" + + "/Posture\022\027\n\nposture_id\030\002 \001(\tB\003\340A\002\022>\n\007pos" + + "ture\030\003 \001(\0132(.google.cloud.securitypostur" + + "e.v1.PostureB\003\340A\002\"\246\001\n\024UpdatePostureReque" + + "st\0224\n\013update_mask\030\001 \001(\0132\032.google.protobu" + + "f.FieldMaskB\003\340A\002\022>\n\007posture\030\002 \001(\0132(.goog" + + "le.cloud.securityposture.v1.PostureB\003\340A\002" + + "\022\030\n\013revision_id\030\003 \001(\tB\003\340A\002\"g\n\024DeletePost" + + "ureRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&securi" + + "typosture.googleapis.com/Posture\022\021\n\004etag" + + "\030\002 \001(\tB\003\340A\001\"\207\001\n\025ExtractPostureRequest\022>\n" + + "\006parent\030\001 \001(\tB.\340A\002\372A(\022&securityposture.g" + + "oogleapis.com/Posture\022\027\n\nposture_id\030\002 \001(" + + "\tB\003\340A\002\022\025\n\010workload\030\003 \001(\tB\003\340A\002\"\312\007\n\021Postur" + + "eDeployment\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\034\n\017target" + + "_resource\030\r \001(\tB\003\340A\002\022L\n\005state\030\002 \001(\01628.go" + + "ogle.cloud.securityposture.v1.PostureDep" + + "loyment.StateB\003\340A\003\022\027\n\nposture_id\030\003 \001(\tB\003" + + "\340A\002\022 \n\023posture_revision_id\030\004 \001(\tB\003\340A\002\0224\n" + + "\013create_time\030\005 \001(\0132\032.google.protobuf.Tim" + + "estampB\003\340A\003\0224\n\013update_time\030\006 \001(\0132\032.googl" + + "e.protobuf.TimestampB\003\340A\003\022\030\n\013description" + + "\030\007 \001(\tB\003\340A\001\022\021\n\004etag\030\010 \001(\tB\003\340A\001\022]\n\013annota" + + "tions\030\t \003(\0132C.google.cloud.securitypostu" + + "re.v1.PostureDeployment.AnnotationsEntry" + + "B\003\340A\001\022\030\n\013reconciling\030\n \001(\010B\003\340A\003\022\037\n\022desir" + + "ed_posture_id\030\013 \001(\tB\003\340A\003\022(\n\033desired_post" + + "ure_revision_id\030\014 \001(\tB\003\340A\003\022\034\n\017failure_me" + + "ssage\030\016 \001(\tB\003\340A\003\0322\n\020AnnotationsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\215\001\n\005State\022\025" + + "\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\014\n\010D" + + "ELETING\020\002\022\014\n\010UPDATING\020\003\022\n\n\006ACTIVE\020\004\022\021\n\rC" + + "REATE_FAILED\020\005\022\021\n\rUPDATE_FAILED\020\006\022\021\n\rDEL" + + "ETE_FAILED\020\007:\273\001\352A\267\001\n0securityposture.goo" + + "gleapis.com/PostureDeployment\022Yorganizat" + + "ions/{organization}/locations/{location}" + + "/postureDeployments/{posture_deployment}" + + "*\022postureDeployments2\021postureDeploymentR" + + "\001\001\"\257\001\n\035ListPostureDeploymentsRequest\022H\n\006" + + "parent\030\001 \001(\tB8\340A\002\372A2\0220securityposture.go" + + "ogleapis.com/PostureDeployment\022\026\n\tpage_s" + + "ize\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\"\237\001\n\036ListPostureDepl" + + "oymentsResponse\022O\n\023posture_deployments\030\001" + + " \003(\01322.google.cloud.securityposture.v1.P" + + "ostureDeployment\022\027\n\017next_page_token\030\002 \001(" + + "\t\022\023\n\013unreachable\030\003 \003(\t\"e\n\033GetPostureDepl" + + "oymentRequest\022F\n\004name\030\001 \001(\tB8\340A\002\372A2\n0sec" + + "urityposture.googleapis.com/PostureDeplo" + + "yment\"\343\001\n\036CreatePostureDeploymentRequest" + + "\022H\n\006parent\030\001 \001(\tB8\340A\002\372A2\0220securitypostur" + + "e.googleapis.com/PostureDeployment\022\"\n\025po" + + "sture_deployment_id\030\002 \001(\tB\003\340A\002\022S\n\022postur" + + "e_deployment\030\003 \001(\01322.google.cloud.securi" + + "typosture.v1.PostureDeploymentB\003\340A\002\"\253\001\n\036" + + "UpdatePostureDeploymentRequest\0224\n\013update" + + "_mask\030\001 \001(\0132\032.google.protobuf.FieldMaskB" + + "\003\340A\002\022S\n\022posture_deployment\030\002 \001(\01322.googl" + + "e.cloud.securityposture.v1.PostureDeploy" + + "mentB\003\340A\002\"{\n\036DeletePostureDeploymentRequ" + + "est\022F\n\004name\030\001 \001(\tB8\340A\002\372A2\n0securitypostu" + + "re.googleapis.com/PostureDeployment\022\021\n\004e" + + "tag\030\002 \001(\tB\003\340A\001\"\332\003\n\017PostureTemplate\022\024\n\004na" + + "me\030\001 \001(\tB\006\340A\003\340A\010\022\030\n\013revision_id\030\002 \001(\tB\003\340" + + "A\003\022\030\n\013description\030\003 \001(\tB\003\340A\003\022J\n\005state\030\004 " + + "\001(\01626.google.cloud.securityposture.v1.Po" + + "stureTemplate.StateB\003\340A\003\022D\n\013policy_sets\030" + + "\005 \003(\0132*.google.cloud.securityposture.v1." + + "PolicySetB\003\340A\003\":\n\005State\022\025\n\021STATE_UNSPECI" + + "FIED\020\000\022\n\n\006ACTIVE\020\001\022\016\n\nDEPRECATED\020\002:\256\001\352A\252" + + "\001\n.securityposture.googleapis.com/Postur" + + "eTemplate\022Uorganizations/{organization}/" + + "locations/{location}/postureTemplates/{p" + + "osture_template}*\020postureTemplates2\017post" + + "ureTemplate\"\253\001\n\033ListPostureTemplatesRequ" + + "est\022F\n\006parent\030\001 \001(\tB6\340A\002\372A0\022.securitypos" + + "ture.googleapis.com/PostureTemplate\022\026\n\tp" + + "age_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\"\204\001\n\034ListPostur" + + "eTemplatesResponse\022K\n\021posture_templates\030" + + "\001 \003(\01320.google.cloud.securityposture.v1." + + "PostureTemplate\022\027\n\017next_page_token\030\002 \001(\t" + + "\"{\n\031GetPostureTemplateRequest\022D\n\004name\030\001 " + + "\001(\tB6\340A\002\372A0\n.securityposture.googleapis." + + "com/PostureTemplate\022\030\n\013revision_id\030\002 \001(\t" + + "B\003\340A\0012\224\032\n\017SecurityPosture\022\277\001\n\014ListPostur" + + "es\0224.google.cloud.securityposture.v1.Lis" + + "tPosturesRequest\0325.google.cloud.security" + + "posture.v1.ListPosturesResponse\"B\332A\006pare" + + "nt\202\323\344\223\0023\0221/v1/{parent=organizations/*/lo" + + "cations/*}/postures\022\334\001\n\024ListPostureRevis" + + "ions\022<.google.cloud.securityposture.v1.L" + + "istPostureRevisionsRequest\032=.google.clou" + + "d.securityposture.v1.ListPostureRevision" + + "sResponse\"G\202\323\344\223\002A\022?/v1/{name=organizatio" + + "ns/*/locations/*/postures/*}:listRevisio" + + "ns\022\254\001\n\nGetPosture\0222.google.cloud.securit" + + "yposture.v1.GetPostureRequest\032(.google.c" + + "loud.securityposture.v1.Posture\"@\332A\004name" + + "\202\323\344\223\0023\0221/v1/{name=organizations/*/locati" + + "ons/*/postures/*}\022\344\001\n\rCreatePosture\0225.go" + + "ogle.cloud.securityposture.v1.CreatePost" + + "ureRequest\032\035.google.longrunning.Operatio" + + "n\"}\312A\034\n\007Posture\022\021OperationMetadata\332A\031par" + + "ent,posture,posture_id\202\323\344\223\002<\"1/v1/{paren" + + "t=organizations/*/locations/*}/postures:" + + "\007posture\022\346\001\n\rUpdatePosture\0225.google.clou" + + "d.securityposture.v1.UpdatePostureReques" + + "t\032\035.google.longrunning.Operation\"\177\312A\034\n\007P" + + "osture\022\021OperationMetadata\332A\023posture,upda" + + "te_mask\202\323\344\223\002D29/v1/{posture.name=organiz" + + "ations/*/locations/*/postures/*}:\007postur" + + "e\022\324\001\n\rDeletePosture\0225.google.cloud.secur" + + "ityposture.v1.DeletePostureRequest\032\035.goo" + + "gle.longrunning.Operation\"m\312A*\n\025google.p" + + "rotobuf.Empty\022\021OperationMetadata\332A\004name\202" + + "\323\344\223\0023*1/v1/{name=organizations/*/locatio" + + "ns/*/postures/*}\022\352\001\n\016ExtractPosture\0226.go" + + "ogle.cloud.securityposture.v1.ExtractPos" + + "tureRequest\032\035.google.longrunning.Operati" + + "on\"\200\001\312A\034\n\007Posture\022\021OperationMetadata\332A\032p" + + "arent,posture_id,workload\202\323\344\223\002>\"9/v1/{pa" + + "rent=organizations/*/locations/*}/postur" + + "es:extract:\001*\022\347\001\n\026ListPostureDeployments" + + "\022>.google.cloud.securityposture.v1.ListP" + + "ostureDeploymentsRequest\032?.google.cloud." + + "securityposture.v1.ListPostureDeployment" + + "sResponse\"L\332A\006parent\202\323\344\223\002=\022;/v1/{parent=" + + "organizations/*/locations/*}/postureDepl" + + "oyments\022\324\001\n\024GetPostureDeployment\022<.googl" + + "e.cloud.securityposture.v1.GetPostureDep" + + "loymentRequest\0322.google.cloud.securitypo" + + "sture.v1.PostureDeployment\"J\332A\004name\202\323\344\223\002" + + "=\022;/v1/{name=organizations/*/locations/*" + + "/postureDeployments/*}\022\256\002\n\027CreatePosture" + + "Deployment\022?.google.cloud.securitypostur" + + "e.v1.CreatePostureDeploymentRequest\032\035.go" + + "ogle.longrunning.Operation\"\262\001\312A&\n\021Postur" + + "eDeployment\022\021OperationMetadata\332A/parent," + + "posture_deployment,posture_deployment_id" + + "\202\323\344\223\002Q\";/v1/{parent=organizations/*/loca" + + "tions/*}/postureDeployments:\022posture_dep" + + "loyment\022\260\002\n\027UpdatePostureDeployment\022?.go" + + "ogle.cloud.securityposture.v1.UpdatePost" + + "ureDeploymentRequest\032\035.google.longrunnin" + + "g.Operation\"\264\001\312A&\n\021PostureDeployment\022\021Op" + + "erationMetadata\332A\036posture_deployment,upd" + + "ate_mask\202\323\344\223\002d2N/v1/{posture_deployment." + + "name=organizations/*/locations/*/posture" + + "Deployments/*}:\022posture_deployment\022\362\001\n\027D" + + "eletePostureDeployment\022?.google.cloud.se" + + "curityposture.v1.DeletePostureDeployment" + + "Request\032\035.google.longrunning.Operation\"w" + + "\312A*\n\025google.protobuf.Empty\022\021OperationMet" + + "adata\332A\004name\202\323\344\223\002=*;/v1/{name=organizati" + + "ons/*/locations/*/postureDeployments/*}\022" + + "\337\001\n\024ListPostureTemplates\022<.google.cloud." + + "securityposture.v1.ListPostureTemplatesR" + + "equest\032=.google.cloud.securityposture.v1" + + ".ListPostureTemplatesResponse\"J\332A\006parent" + + "\202\323\344\223\002;\0229/v1/{parent=organizations/*/loca" + + "tions/*}/postureTemplates\022\314\001\n\022GetPosture" + + "Template\022:.google.cloud.securityposture." + + "v1.GetPostureTemplateRequest\0320.google.cl" + + "oud.securityposture.v1.PostureTemplate\"H" + + "\332A\004name\202\323\344\223\002;\0229/v1/{name=organizations/*" + + "/locations/*/postureTemplates/*}\032R\312A\036sec" + + "urityposture.googleapis.com\322A.https://ww" + + "w.googleapis.com/auth/cloud-platformB\316\002\n" + + "#com.google.cloud.securityposture.v1B\013V1" + + "mainProtoP\001ZMcloud.google.com/go/securit" + + "yposture/apiv1/securityposturepb;securit" + + "yposturepb\252\002\037Google.Cloud.Securitypostur" + + "e.V1\312\002\037Google\\Cloud\\Securityposture\\V1\352\002" + + "\"Google::Cloud::Securityposture::V1\352A_\n*" + + "securitposture.googleapis.com/Organizati" + + "on\0221organizations/{organization}/locatio" + + "ns/{location}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.securityposture.v1.OrgPolicyConstraintsProto.getDescriptor(), + com.google.cloud.securityposture.v1.ShaConstraintsProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_securityposture_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_securityposture_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + "ErrorMessage", + }); + internal_static_google_cloud_securityposture_v1_Posture_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_securityposture_v1_Posture_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_Posture_descriptor, + new java.lang.String[] { + "Name", + "State", + "RevisionId", + "CreateTime", + "UpdateTime", + "Description", + "PolicySets", + "Etag", + "Annotations", + "Reconciling", + }); + internal_static_google_cloud_securityposture_v1_Posture_AnnotationsEntry_descriptor = + internal_static_google_cloud_securityposture_v1_Posture_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_securityposture_v1_Posture_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_Posture_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_securityposture_v1_PolicySet_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_securityposture_v1_PolicySet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_PolicySet_descriptor, + new java.lang.String[] { + "PolicySetId", "Description", "Policies", + }); + internal_static_google_cloud_securityposture_v1_Policy_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_securityposture_v1_Policy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_Policy_descriptor, + new java.lang.String[] { + "PolicyId", "ComplianceStandards", "Constraint", "Description", + }); + internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_descriptor = + internal_static_google_cloud_securityposture_v1_Policy_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_Policy_ComplianceStandard_descriptor, + new java.lang.String[] { + "Standard", "Control", + }); + internal_static_google_cloud_securityposture_v1_Constraint_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_securityposture_v1_Constraint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_Constraint_descriptor, + new java.lang.String[] { + "SecurityHealthAnalyticsModule", + "SecurityHealthAnalyticsCustomModule", + "OrgPolicyConstraint", + "OrgPolicyConstraintCustom", + "Implementation", + }); + internal_static_google_cloud_securityposture_v1_ListPosturesRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_securityposture_v1_ListPosturesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ListPosturesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_securityposture_v1_ListPosturesResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_securityposture_v1_ListPosturesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ListPosturesResponse_descriptor, + new java.lang.String[] { + "Postures", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsRequest_descriptor, + new java.lang.String[] { + "Name", "PageSize", "PageToken", + }); + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ListPostureRevisionsResponse_descriptor, + new java.lang.String[] { + "Revisions", "NextPageToken", + }); + internal_static_google_cloud_securityposture_v1_GetPostureRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_securityposture_v1_GetPostureRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_GetPostureRequest_descriptor, + new java.lang.String[] { + "Name", "RevisionId", + }); + internal_static_google_cloud_securityposture_v1_CreatePostureRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_securityposture_v1_CreatePostureRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_CreatePostureRequest_descriptor, + new java.lang.String[] { + "Parent", "PostureId", "Posture", + }); + internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_UpdatePostureRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Posture", "RevisionId", + }); + internal_static_google_cloud_securityposture_v1_DeletePostureRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_securityposture_v1_DeletePostureRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_DeletePostureRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", + }); + internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ExtractPostureRequest_descriptor, + new java.lang.String[] { + "Parent", "PostureId", "Workload", + }); + internal_static_google_cloud_securityposture_v1_PostureDeployment_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_securityposture_v1_PostureDeployment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_PostureDeployment_descriptor, + new java.lang.String[] { + "Name", + "TargetResource", + "State", + "PostureId", + "PostureRevisionId", + "CreateTime", + "UpdateTime", + "Description", + "Etag", + "Annotations", + "Reconciling", + "DesiredPostureId", + "DesiredPostureRevisionId", + "FailureMessage", + }); + internal_static_google_cloud_securityposture_v1_PostureDeployment_AnnotationsEntry_descriptor = + internal_static_google_cloud_securityposture_v1_PostureDeployment_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_securityposture_v1_PostureDeployment_AnnotationsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_PostureDeployment_AnnotationsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ListPostureDeploymentsResponse_descriptor, + new java.lang.String[] { + "PostureDeployments", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_GetPostureDeploymentRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_CreatePostureDeploymentRequest_descriptor, + new java.lang.String[] { + "Parent", "PostureDeploymentId", "PostureDeployment", + }); + internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_UpdatePostureDeploymentRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "PostureDeployment", + }); + internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_DeletePostureDeploymentRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", + }); + internal_static_google_cloud_securityposture_v1_PostureTemplate_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_securityposture_v1_PostureTemplate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_PostureTemplate_descriptor, + new java.lang.String[] { + "Name", "RevisionId", "Description", "State", "PolicySets", + }); + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_ListPostureTemplatesResponse_descriptor, + new java.lang.String[] { + "PostureTemplates", "NextPageToken", + }); + internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_securityposture_v1_GetPostureTemplateRequest_descriptor, + new java.lang.String[] { + "Name", "RevisionId", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + 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.securityposture.v1.OrgPolicyConstraintsProto.getDescriptor(); + com.google.cloud.securityposture.v1.ShaConstraintsProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/org_policy_config.proto b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/org_policy_config.proto new file mode 100644 index 000000000000..ff30f600dcdd --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/org_policy_config.proto @@ -0,0 +1,174 @@ +// 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.securityposture.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; + +option go_package = "cloud.google.com/go/securityposture/apiv1/securityposturepb;securityposturepb"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyConfigProto"; +option java_package = "com.google.cloud.securityposture.v1"; + +// A rule used to express this policy. +message PolicyRule { + // A message that holds specific allowed and denied values. + // This message can define specific values and subtrees of the Resource + // Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that + // are allowed or denied. This is achieved by using the `under:` and + // optional `is:` prefixes. + // The `under:` prefix is used to denote resource subtree values. + // The `is:` prefix is used to denote specific values, and is required only + // if the value contains a ":". Values prefixed with "is:" are treated the + // same as values with no prefix. + // Ancestry subtrees must be in one of the following formats: + // + // - `projects/` (for example, `projects/tokyo-rain-123`) + // - `folders/` (for example, `folders/1234`) + // - `organizations/` (for example, `organizations/1234`) + // + // The `supports_under` field of the associated `Constraint` defines + // whether ancestry prefixes can be used. + message StringValues { + // List of values allowed at this resource. + repeated string allowed_values = 1; + + // List of values denied at this resource. + repeated string denied_values = 2; + } + + oneof kind { + // List of values to be used for this policy rule. This field can be set + // only in policies for list constraints. + StringValues values = 1; + + // Setting this to true means that all values are allowed. This field can + // be set only in policies for list constraints. + bool allow_all = 2; + + // Setting this to true means that all values are denied. This field can + // be set only in policies for list constraints. + bool deny_all = 3; + + // If `true`, then the policy is enforced. If `false`, then any + // configuration is acceptable. + // This field can be set only in policies for boolean constraints. + bool enforce = 4; + } + + // A condition which determines whether this rule is used + // in the evaluation of the policy. When set, the `expression` field in + // the `Expr' must include from 1 to 10 subexpressions, joined by the "||" + // or "&&" operators. Each subexpression must be of the form + // "resource.matchTag('/tag_key_short_name, + // 'tag_value_short_name')" or "resource.matchTagId('tagKeys/key_id', + // 'tagValues/value_id')" where key_name and value_name are the resource + // names for Label Keys and Values. These names are available from the Tag + // Manager Service. An example expression is: + // "resource.matchTag('123456789/environment, + // 'prod')" or "resource.matchTagId('tagKeys/123', + // 'tagValues/456')". + google.type.Expr condition = 5; +} + +// A custom constraint defined by customers which can *only* be applied to the +// given resource types and organization. +// +// By creating a custom constraint, customers can apply policies of this +// custom constraint. *Creating a custom constraint itself does NOT apply any +// policy enforcement*. +message CustomConstraint { + // The operation for which this constraint will be applied. To apply this + // constraint only when creating new VMs, the `method_types` should be + // `CREATE` only. To apply this constraint when creating or deleting + // VMs, the `method_types` should be `CREATE` and `DELETE`. + // + // `UPDATE` only custom constraints are not supported. Use `CREATE` or + // `CREATE, UPDATE`. + enum MethodType { + // Unspecified. Results in an error. + METHOD_TYPE_UNSPECIFIED = 0; + + // Constraint applied when creating the resource. + CREATE = 1; + + // Constraint applied when updating the resource. + UPDATE = 2; + + // Constraint applied when deleting the resource. + // Not supported yet. + DELETE = 3; + } + + // Allow or deny type. + enum ActionType { + // Unspecified. Results in an error. + ACTION_TYPE_UNSPECIFIED = 0; + + // Allowed action type. + ALLOW = 1; + + // Deny action type. + DENY = 2; + } + + // Immutable. Name of the constraint. This is unique within the organization. + // Format of the name should be + // + // - + // `organizations/{organization_id}/customConstraints/{custom_constraint_id}` + // + // Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms` + // + // The max length is 70 characters and the minimum length is 1. Note that the + // prefix `organizations/{organization_id}/customConstraints/` is not counted. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The resource instance type on which this policy applies. Format + // will be of the form : `/` Example: + // + // - `compute.googleapis.com/Instance`. + repeated string resource_types = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // All the operations being applied for this constraint. + repeated MethodType method_types = 3; + + // Org policy condition/expression. For example: + // `resource.instanceName.matches("[production|test]_.*_(\d)+")` or, + // `resource.management.auto_upgrade == true` + // + // The max length of the condition is 1000 characters. + string condition = 4; + + // Allow or deny type. + ActionType action_type = 5; + + // One line display name for the UI. + // The max length of the display_name is 200 characters. + string display_name = 6; + + // Detailed information about this custom policy constraint. + // The max length of the description is 2000 characters. + string description = 7; + + // Output only. The last time this custom constraint was updated. This + // represents the last time that the `CreateCustomConstraint` or + // `UpdateCustomConstraint` RPC was called + google.protobuf.Timestamp update_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/org_policy_constraints.proto b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/org_policy_constraints.proto new file mode 100644 index 000000000000..9a2ee3a9ff1c --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/org_policy_constraints.proto @@ -0,0 +1,44 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.securityposture.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/securityposture/v1/org_policy_config.proto"; + +option go_package = "cloud.google.com/go/securityposture/apiv1/securityposturepb;securityposturepb"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyConstraintsProto"; +option java_package = "com.google.cloud.securityposture.v1"; + +// Message for Org Policy Canned Constraint. +message OrgPolicyConstraint { + // Required. Org Policy Canned Constraint id. + string canned_constraint_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Org PolicySpec rules. + repeated PolicyRule policy_rules = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for Org Policy Custom Constraint. +message OrgPolicyConstraintCustom { + // Required. Org Policy Custom Constraint. + CustomConstraint custom_constraint = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Org Policyspec rules. + repeated PolicyRule policy_rules = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/securityposture.proto b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/securityposture.proto new file mode 100644 index 000000000000..ba96fe84ac64 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/securityposture.proto @@ -0,0 +1,851 @@ +// 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.securityposture.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/securityposture/v1/org_policy_constraints.proto"; +import "google/cloud/securityposture/v1/sha_constraints.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Securityposture.V1"; +option go_package = "cloud.google.com/go/securityposture/apiv1/securityposturepb;securityposturepb"; +option java_multiple_files = true; +option java_outer_classname = "V1mainProto"; +option java_package = "com.google.cloud.securityposture.v1"; +option php_namespace = "Google\\Cloud\\Securityposture\\V1"; +option ruby_package = "Google::Cloud::Securityposture::V1"; +option (google.api.resource_definition) = { + type: "securitposture.googleapis.com/Organization" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Service describing handlers for resources. +service SecurityPosture { + option (google.api.default_host) = "securityposture.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // (-- This option restricts the visibility of the API to only projects that + // will + // (-- be labeled as `PREVIEW` or `GOOGLE_INTERNAL` by the service. + // (-- option (google.api.api_visibility).restriction = + // "PREVIEW,GOOGLE_INTERNAL"; Postures Lists Postures in a given organization + // and location. In case a posture has multiple revisions, the latest revision + // as per UpdateTime will be returned. + rpc ListPostures(ListPosturesRequest) returns (ListPosturesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/postures" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists revisions of a Posture in a given organization and location. + rpc ListPostureRevisions(ListPostureRevisionsRequest) + returns (ListPostureRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/postures/*}:listRevisions" + }; + } + + // Gets a posture in a given organization and location. + // User must provide revision_id to retrieve a specific revision of the + // resource. + // NOT_FOUND error is returned if the revision_id or the Posture name does not + // exist. In case revision_id is not provided then the latest Posture revision + // by UpdateTime is returned. + rpc GetPosture(GetPostureRequest) returns (Posture) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/postures/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Posture resource. + // If a Posture with the specified name already exists in the specified + // organization and location, the long running operation returns a + // [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + rpc CreatePosture(CreatePostureRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/locations/*}/postures" + body: "posture" + }; + option (google.api.method_signature) = "parent,posture,posture_id"; + option (google.longrunning.operation_info) = { + response_type: "Posture" + metadata_type: "OperationMetadata" + }; + } + + // Updates an existing Posture. + // A new revision of the posture will be created if the revision to be + // updated is currently deployed on a workload. + // Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the + // Posture does not exist. + // Returns a `google.rpc.Status` with `google.rpc.Code.ABORTED` if the etag + // supplied in the request does not match the persisted etag of the Posture. + // Updatable fields are state, description and policy_sets. + // State update operation cannot be clubbed with update of description and + // policy_sets. + // An ACTIVE posture can be updated to both DRAFT or DEPRECATED states. + // Postures in DRAFT or DEPRECATED states can only be updated to ACTIVE state. + rpc UpdatePosture(UpdatePostureRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{posture.name=organizations/*/locations/*/postures/*}" + body: "posture" + }; + option (google.api.method_signature) = "posture,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Posture" + metadata_type: "OperationMetadata" + }; + } + + // Deletes all the revisions of a resource. + // A posture can only be deleted when none of the revisions are deployed to + // any workload. + rpc DeletePosture(DeletePostureRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/locations/*/postures/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Extracts existing policies on a workload as a posture. + // If a Posture on the given workload already exists, the long running + // operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + rpc ExtractPosture(ExtractPostureRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/locations/*}/postures:extract" + body: "*" + }; + option (google.api.method_signature) = "parent,posture_id,workload"; + option (google.longrunning.operation_info) = { + response_type: "Posture" + metadata_type: "OperationMetadata" + }; + } + + // PostureDeployments + // Lists PostureDeployments in a given project and location. + rpc ListPostureDeployments(ListPostureDeploymentsRequest) + returns (ListPostureDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/postureDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single PostureDeployment. + rpc GetPostureDeployment(GetPostureDeploymentRequest) + returns (PostureDeployment) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/postureDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new PostureDeployment in a given project and location. + rpc CreatePostureDeployment(CreatePostureDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/locations/*}/postureDeployments" + body: "posture_deployment" + }; + option (google.api.method_signature) = + "parent,posture_deployment,posture_deployment_id"; + option (google.longrunning.operation_info) = { + response_type: "PostureDeployment" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single PostureDeployment. + rpc UpdatePostureDeployment(UpdatePostureDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{posture_deployment.name=organizations/*/locations/*/postureDeployments/*}" + body: "posture_deployment" + }; + option (google.api.method_signature) = "posture_deployment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PostureDeployment" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single PostureDeployment. + rpc DeletePostureDeployment(DeletePostureDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/locations/*/postureDeployments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // PostureTemplates + // Lists all the PostureTemplates available to the user. + rpc ListPostureTemplates(ListPostureTemplatesRequest) + returns (ListPostureTemplatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/postureTemplates" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a PostureTemplate. + // User must provide revision_id to retrieve a specific revision of the + // resource. + // NOT_FOUND error is returned if the revision_id or the PostureTemplate name + // does not exist. In case revision_id is not provided then the + // PostureTemplate with latest revision_id is returned. + rpc GetPostureTemplate(GetPostureTemplateRequest) returns (PostureTemplate) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/postureTemplates/*}" + }; + 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]; + + // Output only. This is a output only optional field which will be filled only + // in cases where PostureDeployments enter failure states like UPDATE_FAILED + // or CREATE_FAILED or DELETE_FAILED. + string error_message = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Postures +// Definition of a Posture. +message Posture { + option (google.api.resource) = { + type: "securityposture.googleapis.com/Posture" + pattern: "organizations/{organization}/locations/{location}/postures/{posture}" + plural: "postures" + singular: "posture" + style: DECLARATIVE_FRIENDLY + }; + + // State of a Posture. + enum State { + // Unspecified operation state. + STATE_UNSPECIFIED = 0; + + // The Posture is marked deprecated when it is not in use by the user. + DEPRECATED = 1; + + // The Posture is created successfully but is not yet ready for usage. + DRAFT = 2; + + // The Posture state is active. Ready for use/deployments. + ACTIVE = 3; + } + + // Required. Identifier. The name of this Posture resource, in the format of + // organizations/{org_id}/locations/{location_id}/postures/{posture}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Required. State of Posture resource. + State state = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Immutable. The revision ID of the posture. + // The format is an 8-character hexadecimal string. + // https://google.aip.dev/162 + string revision_id = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The timestamp that the posture was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the posture was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User provided description of the posture. + string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Required. List of Policy sets. + repeated PolicySet policy_sets = 7 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An opaque tag indicating the current version of the Posture, used + // for concurrency control. When the `Posture` is returned from either a + // `GetPosture` or a `ListPostures` request, this `etag` indicates the version + // of the current `Posture` to use when executing a read-modify-write loop. + // + // When the `Posture` is used in a `UpdatePosture` method, use the `etag` + // value that was returned from a `GetPosture` request as part of a + // read-modify-write loop for concurrency control. Not setting the `etag` in a + // `UpdatePosture` request will result in an unconditional write of the + // `Posture`. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User annotations. These attributes can only be set and used by + // the user, and not by Google Security Postures. + // . + map annotations = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Whether or not this Posture is in the process of being + // updated. + bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// PolicySet representation. +message PolicySet { + // Required. ID of the Policy set. + string policy_set_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the Policy set. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. List of policies. + repeated Policy policies = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Policy representation. +message Policy { + // Mapping for a Policy to standard and control. + message ComplianceStandard { + // Optional. The compliance standard that the Policy maps to, e.g.: CIS-2.0. + string standard = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Control mapping provided by user for this Policy. e.g.: 1.5. + string control = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. ID of the Policy that is user generated, immutable and unique + // within the scope of a policy set. + string policy_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Contains list of mapping for a Policy to a standard and control. + repeated ComplianceStandard compliance_standards = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Constraint details. + Constraint constraint = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Description of the Policy. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Representation of a Constraint. +message Constraint { + oneof implementation { + // Optional. SHA built-in detector. + SecurityHealthAnalyticsModule security_health_analytics_module = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SHA custom detector. + SecurityHealthAnalyticsCustomModule + security_health_analytics_custom_module = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Org Policy builtin constraint. + OrgPolicyConstraint org_policy_constraint = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Org Policy custom constraint. + OrgPolicyConstraintCustom org_policy_constraint_custom = 6 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Message for requesting list of Postures. +message ListPosturesRequest { + // Required. Parent value for ListPosturesRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securityposture.googleapis.com/Posture" + } + ]; + + // Requested page size. Server may return fewer items than requested. + // If unspecified, server will pick an appropriate default. + int32 page_size = 2; + + // A token identifying a page of results the server should return. + string page_token = 3; +} + +// Message for response to listing Postures. +message ListPosturesResponse { + // The list of Posture. + repeated Posture postures = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Message for requesting list of Posture revisions. +message ListPostureRevisionsRequest { + // Required. Name value for ListPostureRevisionsRequest. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securityposture.googleapis.com/Posture" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick 100 as default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing PostureRevisions. +message ListPostureRevisionsResponse { + // The list of Posture revisions. + repeated Posture revisions = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for getting a Posture. +message GetPostureRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securityposture.googleapis.com/Posture" + } + ]; + + // Optional. Posture revision which needs to be retrieved. + string revision_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for creating a Posture. +message CreatePostureRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securityposture.googleapis.com/Posture" + } + ]; + + // Required. User provided identifier. It should be unique in scope of an + // Organization and location. + string posture_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + Posture posture = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for updating a Posture. +message UpdatePostureRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Posture resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated. + Posture posture = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Posture revision which needs to be updated. + string revision_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message for deleting a Posture. +message DeletePostureRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securityposture.googleapis.com/Posture" + } + ]; + + // Optional. Etag value of the Posture to be deleted. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for extracting existing policies on a workload as a Posture. +message ExtractPostureRequest { + // Required. The parent resource name. The format of this value is as follows: + // `organizations/{organization}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securityposture.googleapis.com/Posture" + } + ]; + + // Required. User provided identifier. It should be unique in scope of an + // Organization and location. + string posture_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Workload from which the policies are to be extracted, it should + // belong to the same organization defined in parent. The format of this value + // varies depending on the scope of the request: + // - `folder/folderNumber` + // - `project/projectNumber` + // - `organization/organizationNumber` + string workload = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// ========================== PostureDeployments ========================== +// Message describing PostureDeployment resource. +message PostureDeployment { + option (google.api.resource) = { + type: "securityposture.googleapis.com/PostureDeployment" + pattern: "organizations/{organization}/locations/{location}/postureDeployments/{posture_deployment}" + plural: "postureDeployments" + singular: "postureDeployment" + style: DECLARATIVE_FRIENDLY + }; + + // State of a PostureDeployment. + enum State { + // Unspecified operation state. + STATE_UNSPECIFIED = 0; + + // The PostureDeployment is being created. + CREATING = 1; + + // The PostureDeployment is being deleted. + DELETING = 2; + + // The PostureDeployment state is being updated. + UPDATING = 3; + + // The PostureDeployment state is active and in use. + ACTIVE = 4; + + // The PostureDeployment creation failed. + CREATE_FAILED = 5; + + // The PostureDeployment update failed. + UPDATE_FAILED = 6; + + // The PostureDeployment deletion failed. + DELETE_FAILED = 7; + } + + // Required. The name of this PostureDeployment resource, in the format of + // organizations/{organization}/locations/{location_id}/postureDeployments/{postureDeployment}. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Target resource where the Posture will be deployed. Currently + // supported resources are of types: projects/projectNumber, + // folders/folderNumber, organizations/organizationNumber. + string target_resource = 13 [(google.api.field_behavior) = REQUIRED]; + + // Output only. State of PostureDeployment resource. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Posture that needs to be deployed. + // Format: + // organizations/{org_id}/locations/{location_id}/postures/ + // Example: + // organizations/99/locations/global/postures/les-miserables. + string posture_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Revision_id of the Posture that is to be deployed. + string posture_revision_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp that the PostureDeployment was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the PostureDeployment was updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User provided description of the PostureDeployment. + string description = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An opaque tag indicating the current version of the + // PostureDeployment, used for concurrency control. When the + // `PostureDeployment` is returned from either a `GetPostureDeployment` or a + // `ListPostureDeployments` request, this `etag` indicates the version of the + // current `PostureDeployment` to use when executing a read-modify-write loop. + // + // When the `PostureDeployment` is used in a `UpdatePostureDeployment` method, + // use the `etag` value that was returned from a `GetPostureDeployment` + // request as part of a read-modify-write loop for concurrency control. Not + // setting the `etag` in a `UpdatePostureDeployment` request will result in an + // unconditional write of the `PostureDeployment`. + string etag = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User annotations. These attributes can only be set and used by + // the user, and not by Google Security Postures. + // . + map annotations = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Whether or not this Posture is in the process of being + // updated. + bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This is a output only optional field which will be filled in + // case where PostureDeployment state is UPDATE_FAILED or CREATE_FAILED or + // DELETE_FAILED. It denotes the desired Posture. + string desired_posture_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Output only optional field which provides revision_id of the + // desired_posture_id. + string desired_posture_revision_id = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This is a output only optional field which will be filled in + // case where PostureDeployment enters a failure state like UPDATE_FAILED or + // CREATE_FAILED or DELETE_FAILED. + string failure_message = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for requesting list of PostureDeployments. +message ListPostureDeploymentsRequest { + // Required. Parent value for ListPostureDeploymentsRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securityposture.googleapis.com/PostureDeployment" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied on the resource, defined by EBNF grammar + // https://google.aip.dev/assets/misc/ebnf-filtering.txt. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing PostureDeployments. +message ListPostureDeploymentsResponse { + // The list of PostureDeployment. + repeated PostureDeployment posture_deployments = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a PostureDeployment. +message GetPostureDeploymentRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securityposture.googleapis.com/PostureDeployment" + } + ]; +} + +// Message for creating a PostureDeployment. +message CreatePostureDeploymentRequest { + // Required. Value for parent. + // Format: organizations/{org_id}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securityposture.googleapis.com/PostureDeployment" + } + ]; + + // Required. User provided identifier. It should be unique in scope of an + // Organization and location. + string posture_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created. + PostureDeployment posture_deployment = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for updating a PostureDeployment. +message UpdatePostureDeploymentRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // PostureDeployment resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated. + PostureDeployment posture_deployment = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Message for deleting a PostureDeployment. +message DeletePostureDeploymentRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securityposture.googleapis.com/PostureDeployment" + } + ]; + + // Optional. Etag value of the PostureDeployment to be deleted. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// PostureTemplates +// Message describing PostureTemplate object. +message PostureTemplate { + option (google.api.resource) = { + type: "securityposture.googleapis.com/PostureTemplate" + pattern: "organizations/{organization}/locations/{location}/postureTemplates/{posture_template}" + plural: "postureTemplates" + singular: "postureTemplate" + }; + + // State of a PostureTemplate + enum State { + // Unspecified state + STATE_UNSPECIFIED = 0; + + // If the Posture template is adhering to the latest controls and standards. + ACTIVE = 1; + + // If the Posture template controls and standards are outdated and not + // recommended for use. + DEPRECATED = 2; + } + + // Output only. Identifier. The name of the Posture template will be of the + // format + // organizations/{organization}/locations/{location}/postureTemplates/{postureTemplate} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The revision_id of a PostureTemplate. + string revision_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the Posture template. + string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of PostureTemplate resource. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Policy_sets to be used by the user. + repeated PolicySet policy_sets = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for requesting list of Posture Templates. +message ListPostureTemplatesRequest { + // Required. Parent value for ListPostureTemplatesRequest. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "securityposture.googleapis.com/PostureTemplate" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter to be applied on the resource, defined by EBNF grammar + // https://google.aip.dev/assets/misc/ebnf-filtering.txt. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing PostureTemplates. +message ListPostureTemplatesResponse { + // The list of PostureTemplate. + repeated PostureTemplate posture_templates = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// Message for getting a Posture Template. +message GetPostureTemplateRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securityposture.googleapis.com/PostureTemplate" + } + ]; + + // Optional. Specific revision_id of a Posture Template. + // PostureTemplate revision_id which needs to be retrieved. + string revision_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/sha_constraints.proto b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/sha_constraints.proto new file mode 100644 index 000000000000..513c19905b62 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/sha_constraints.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.securityposture.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/securityposture/v1/sha_custom_config.proto"; + +option go_package = "cloud.google.com/go/securityposture/apiv1/securityposturepb;securityposturepb"; +option java_multiple_files = true; +option java_outer_classname = "ShaConstraintsProto"; +option java_package = "com.google.cloud.securityposture.v1"; + +// Possible enablement states of a service or module. +enum EnablementState { + // Default value. This value is unused. + ENABLEMENT_STATE_UNSPECIFIED = 0; + + // State is enabled. + ENABLED = 1; + + // State is disabled. + DISABLED = 2; +} + +// Message for Security Health Analytics built-in detector. +message SecurityHealthAnalyticsModule { + // Required. The name of the module eg: BIGQUERY_TABLE_CMEK_DISABLED. + string module_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The state of enablement for the module at its level of the resource + // hierarchy. + EnablementState module_enablement_state = 2; +} + +// Message for SHA Custom Module +message SecurityHealthAnalyticsCustomModule { + // Output only. Immutable. The id of the custom module. + // The id is server-generated and is not user settable. + // It will be a numeric id containing 1-20 digits. + string id = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. The display name of the Security Health Analytics custom module. + // This display name becomes the finding category for all findings that are + // returned by this custom module. The display name must be between 1 and + // 128 characters, start with a lowercase letter, and contain alphanumeric + // characters or underscores only. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. custom module details + CustomConfig config = 3 [(google.api.field_behavior) = REQUIRED]; + + // The state of enablement for the module at its level of the resource + // hierarchy. + EnablementState module_enablement_state = 4; +} diff --git a/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/sha_custom_config.proto b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/sha_custom_config.proto new file mode 100644 index 000000000000..1685dc61b228 --- /dev/null +++ b/java-securityposture/proto-google-cloud-securityposture-v1/src/main/proto/google/cloud/securityposture/v1/sha_custom_config.proto @@ -0,0 +1,102 @@ +// 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.securityposture.v1; + +import "google/api/field_behavior.proto"; +import "google/type/expr.proto"; + +option go_package = "cloud.google.com/go/securityposture/apiv1/securityposturepb;securityposturepb"; +option java_multiple_files = true; +option java_outer_classname = "ShaCustomConfigProto"; +option java_package = "com.google.cloud.securityposture.v1"; + +// Defines the properties in a custom module configuration for Security +// Health Analytics. Use the custom module configuration to create custom +// detectors that generate custom findings for resources that you specify. +message CustomConfig { + // A set of optional name-value pairs that define custom source properties to + // return with each finding that is generated by the custom module. The custom + // source properties that are defined here are included in the finding JSON + // under `sourceProperties`. + message CustomOutputSpec { + // An individual name-value pair that defines a custom source property. + message Property { + // Required. Name of the property for the custom output. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The CEL expression for the custom output. A resource property + // can be specified to return the value of the property or a text string + // enclosed in quotation marks. + google.type.Expr value_expression = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. A list of custom output properties to add to the finding. + repeated Property properties = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Resource for selecting resource type. + message ResourceSelector { + // Required. The resource types to run the detector on. + repeated string resource_types = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Defines the valid value options for the severity of a finding. + enum Severity { + // Unspecified severity. + SEVERITY_UNSPECIFIED = 0; + + // Critical severity. + CRITICAL = 1; + + // High severity. + HIGH = 2; + + // Medium severity. + MEDIUM = 3; + + // Low severity. + LOW = 4; + } + + // Required. The CEL expression to evaluate to produce findings. When the + // expression evaluates to true against a resource, a finding is generated. + google.type.Expr predicate = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Custom output properties. + CustomOutputSpec custom_output = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource types that the custom module operates on. Each + // custom module can specify up to 5 resource types. + ResourceSelector resource_selector = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The severity to assign to findings generated by the module. + Severity severity = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Text that describes the vulnerability or misconfiguration that + // the custom module detects. This explanation is returned with each finding + // instance to help investigators understand the detected issue. The text must + // be enclosed in quotation marks. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An explanation of the recommended steps that security teams can + // take to resolve the detected issue. This explanation is returned with each + // finding generated by this module in the `nextSteps` property of the finding + // JSON. + string recommendation = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/create/SyncCreateSetCredentialsProvider.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..16ff203760f5 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.SecurityPostureSettings; +import com.google.cloud.securityposture.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 + SecurityPostureSettings securityPostureSettings = + SecurityPostureSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SecurityPostureClient securityPostureClient = + SecurityPostureClient.create(securityPostureSettings); + } +} +// [END securityposture_v1_generated_SecurityPosture_Create_SetCredentialsProvider_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/create/SyncCreateSetCredentialsProvider1.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..0279a8779c60 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_Create_SetCredentialsProvider1_sync] +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.SecurityPostureSettings; + +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 + SecurityPostureSettings securityPostureSettings = + SecurityPostureSettings.newHttpJsonBuilder().build(); + SecurityPostureClient securityPostureClient = + SecurityPostureClient.create(securityPostureSettings); + } +} +// [END securityposture_v1_generated_SecurityPosture_Create_SetCredentialsProvider1_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/create/SyncCreateSetEndpoint.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..df0901a4d493 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_Create_SetEndpoint_sync] +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.SecurityPostureSettings; +import com.google.cloud.securityposture.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 + SecurityPostureSettings securityPostureSettings = + SecurityPostureSettings.newBuilder().setEndpoint(myEndpoint).build(); + SecurityPostureClient securityPostureClient = + SecurityPostureClient.create(securityPostureSettings); + } +} +// [END securityposture_v1_generated_SecurityPosture_Create_SetEndpoint_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/AsyncCreatePosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/AsyncCreatePosture.java new file mode 100644 index 000000000000..22ef1773dcff --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/AsyncCreatePosture.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePosture_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.CreatePostureRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.longrunning.Operation; + +public class AsyncCreatePosture { + + public static void main(String[] args) throws Exception { + asyncCreatePosture(); + } + + public static void asyncCreatePosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + CreatePostureRequest request = + CreatePostureRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureId("postureId2023219203") + .setPosture(Posture.newBuilder().build()) + .build(); + ApiFuture future = + securityPostureClient.createPostureCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePosture_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/AsyncCreatePostureLRO.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/AsyncCreatePostureLRO.java new file mode 100644 index 000000000000..8e4760a2f617 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/AsyncCreatePostureLRO.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePosture_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.securityposture.v1.CreatePostureRequest; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncCreatePostureLRO { + + public static void main(String[] args) throws Exception { + asyncCreatePostureLRO(); + } + + public static void asyncCreatePostureLRO() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + CreatePostureRequest request = + CreatePostureRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureId("postureId2023219203") + .setPosture(Posture.newBuilder().build()) + .build(); + OperationFuture future = + securityPostureClient.createPostureOperationCallable().futureCall(request); + // Do something. + Posture response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePosture_LRO_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePosture.java new file mode 100644 index 000000000000..d9fb90684aeb --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePosture.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePosture_sync] +import com.google.cloud.securityposture.v1.CreatePostureRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncCreatePosture { + + public static void main(String[] args) throws Exception { + syncCreatePosture(); + } + + public static void syncCreatePosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + CreatePostureRequest request = + CreatePostureRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureId("postureId2023219203") + .setPosture(Posture.newBuilder().build()) + .build(); + Posture response = securityPostureClient.createPostureAsync(request).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePosture_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePostureOrganizationnamePostureString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePostureOrganizationnamePostureString.java new file mode 100644 index 000000000000..e6f5ef9da87f --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePostureOrganizationnamePostureString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePosture_OrganizationnamePostureString_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncCreatePostureOrganizationnamePostureString { + + public static void main(String[] args) throws Exception { + syncCreatePostureOrganizationnamePostureString(); + } + + public static void syncCreatePostureOrganizationnamePostureString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + Posture response = securityPostureClient.createPostureAsync(parent, posture, postureId).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePosture_OrganizationnamePostureString_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePostureStringPostureString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePostureStringPostureString.java new file mode 100644 index 000000000000..8f0c16163d4a --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposture/SyncCreatePostureStringPostureString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePosture_StringPostureString_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncCreatePostureStringPostureString { + + public static void main(String[] args) throws Exception { + syncCreatePostureStringPostureString(); + } + + public static void syncCreatePostureStringPostureString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + Posture posture = Posture.newBuilder().build(); + String postureId = "postureId2023219203"; + Posture response = securityPostureClient.createPostureAsync(parent, posture, postureId).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePosture_StringPostureString_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/AsyncCreatePostureDeployment.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/AsyncCreatePostureDeployment.java new file mode 100644 index 000000000000..083e3aafc4b0 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/AsyncCreatePostureDeployment.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.longrunning.Operation; + +public class AsyncCreatePostureDeployment { + + public static void main(String[] args) throws Exception { + asyncCreatePostureDeployment(); + } + + public static void asyncCreatePostureDeployment() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + CreatePostureDeploymentRequest request = + CreatePostureDeploymentRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureDeploymentId("postureDeploymentId1771206568") + .setPostureDeployment(PostureDeployment.newBuilder().build()) + .build(); + ApiFuture future = + securityPostureClient.createPostureDeploymentCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/AsyncCreatePostureDeploymentLRO.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/AsyncCreatePostureDeploymentLRO.java new file mode 100644 index 000000000000..5f1a8ece75d3 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/AsyncCreatePostureDeploymentLRO.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncCreatePostureDeploymentLRO { + + public static void main(String[] args) throws Exception { + asyncCreatePostureDeploymentLRO(); + } + + public static void asyncCreatePostureDeploymentLRO() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + CreatePostureDeploymentRequest request = + CreatePostureDeploymentRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureDeploymentId("postureDeploymentId1771206568") + .setPostureDeployment(PostureDeployment.newBuilder().build()) + .build(); + OperationFuture future = + securityPostureClient.createPostureDeploymentOperationCallable().futureCall(request); + // Do something. + PostureDeployment response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_LRO_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeployment.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeployment.java new file mode 100644 index 000000000000..da52ee2e932f --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeployment.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_sync] +import com.google.cloud.securityposture.v1.CreatePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncCreatePostureDeployment { + + public static void main(String[] args) throws Exception { + syncCreatePostureDeployment(); + } + + public static void syncCreatePostureDeployment() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + CreatePostureDeploymentRequest request = + CreatePostureDeploymentRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureDeploymentId("postureDeploymentId1771206568") + .setPostureDeployment(PostureDeployment.newBuilder().build()) + .build(); + PostureDeployment response = + securityPostureClient.createPostureDeploymentAsync(request).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeploymentOrganizationnamePosturedeploymentString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeploymentOrganizationnamePosturedeploymentString.java new file mode 100644 index 000000000000..23e7b0771aca --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeploymentOrganizationnamePosturedeploymentString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_OrganizationnamePosturedeploymentString_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncCreatePostureDeploymentOrganizationnamePosturedeploymentString { + + public static void main(String[] args) throws Exception { + syncCreatePostureDeploymentOrganizationnamePosturedeploymentString(); + } + + public static void syncCreatePostureDeploymentOrganizationnamePosturedeploymentString() + 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + PostureDeployment response = + securityPostureClient + .createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId) + .get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_OrganizationnamePosturedeploymentString_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeploymentStringPosturedeploymentString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeploymentStringPosturedeploymentString.java new file mode 100644 index 000000000000..7abd0f3deb83 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/createposturedeployment/SyncCreatePostureDeploymentStringPosturedeploymentString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_StringPosturedeploymentString_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncCreatePostureDeploymentStringPosturedeploymentString { + + public static void main(String[] args) throws Exception { + syncCreatePostureDeploymentStringPosturedeploymentString(); + } + + public static void syncCreatePostureDeploymentStringPosturedeploymentString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + String postureDeploymentId = "postureDeploymentId1771206568"; + PostureDeployment response = + securityPostureClient + .createPostureDeploymentAsync(parent, postureDeployment, postureDeploymentId) + .get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_CreatePostureDeployment_StringPosturedeploymentString_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/AsyncDeletePosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/AsyncDeletePosture.java new file mode 100644 index 000000000000..d838c7cf6651 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/AsyncDeletePosture.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePosture_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.DeletePostureRequest; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.longrunning.Operation; + +public class AsyncDeletePosture { + + public static void main(String[] args) throws Exception { + asyncDeletePosture(); + } + + public static void asyncDeletePosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + DeletePostureRequest request = + DeletePostureRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setEtag("etag3123477") + .build(); + ApiFuture future = + securityPostureClient.deletePostureCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePosture_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/AsyncDeletePostureLRO.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/AsyncDeletePostureLRO.java new file mode 100644 index 000000000000..a9d5832ca293 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/AsyncDeletePostureLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePosture_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.securityposture.v1.DeletePostureRequest; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.Empty; + +public class AsyncDeletePostureLRO { + + public static void main(String[] args) throws Exception { + asyncDeletePostureLRO(); + } + + public static void asyncDeletePostureLRO() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + DeletePostureRequest request = + DeletePostureRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setEtag("etag3123477") + .build(); + OperationFuture future = + securityPostureClient.deletePostureOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePosture_LRO_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePosture.java new file mode 100644 index 000000000000..42304ef225b5 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePosture.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePosture_sync] +import com.google.cloud.securityposture.v1.DeletePostureRequest; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.Empty; + +public class SyncDeletePosture { + + public static void main(String[] args) throws Exception { + syncDeletePosture(); + } + + public static void syncDeletePosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + DeletePostureRequest request = + DeletePostureRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setEtag("etag3123477") + .build(); + securityPostureClient.deletePostureAsync(request).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePosture_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePosturePosturename.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePosturePosturename.java new file mode 100644 index 000000000000..a154c2f0d210 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePosturePosturename.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePosture_Posturename_sync] +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.Empty; + +public class SyncDeletePosturePosturename { + + public static void main(String[] args) throws Exception { + syncDeletePosturePosturename(); + } + + public static void syncDeletePosturePosturename() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + securityPostureClient.deletePostureAsync(name).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePosture_Posturename_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePostureString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePostureString.java new file mode 100644 index 000000000000..6f317f1dd881 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposture/SyncDeletePostureString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePosture_String_sync] +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.Empty; + +public class SyncDeletePostureString { + + public static void main(String[] args) throws Exception { + syncDeletePostureString(); + } + + public static void syncDeletePostureString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString(); + securityPostureClient.deletePostureAsync(name).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePosture_String_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/AsyncDeletePostureDeployment.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/AsyncDeletePostureDeployment.java new file mode 100644 index 000000000000..85c6d09abc64 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/AsyncDeletePostureDeployment.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.longrunning.Operation; + +public class AsyncDeletePostureDeployment { + + public static void main(String[] args) throws Exception { + asyncDeletePostureDeployment(); + } + + public static void asyncDeletePostureDeployment() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + DeletePostureDeploymentRequest request = + DeletePostureDeploymentRequest.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setEtag("etag3123477") + .build(); + ApiFuture future = + securityPostureClient.deletePostureDeploymentCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/AsyncDeletePostureDeploymentLRO.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/AsyncDeletePostureDeploymentLRO.java new file mode 100644 index 000000000000..8b86d6aae27a --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/AsyncDeletePostureDeploymentLRO.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.Empty; + +public class AsyncDeletePostureDeploymentLRO { + + public static void main(String[] args) throws Exception { + asyncDeletePostureDeploymentLRO(); + } + + public static void asyncDeletePostureDeploymentLRO() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + DeletePostureDeploymentRequest request = + DeletePostureDeploymentRequest.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setEtag("etag3123477") + .build(); + OperationFuture future = + securityPostureClient.deletePostureDeploymentOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_LRO_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeployment.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeployment.java new file mode 100644 index 000000000000..37ce67fd813d --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeployment.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_sync] +import com.google.cloud.securityposture.v1.DeletePostureDeploymentRequest; +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.Empty; + +public class SyncDeletePostureDeployment { + + public static void main(String[] args) throws Exception { + syncDeletePostureDeployment(); + } + + public static void syncDeletePostureDeployment() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + DeletePostureDeploymentRequest request = + DeletePostureDeploymentRequest.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .setEtag("etag3123477") + .build(); + securityPostureClient.deletePostureDeploymentAsync(request).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeploymentPosturedeploymentname.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeploymentPosturedeploymentname.java new file mode 100644 index 000000000000..754060a3237e --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeploymentPosturedeploymentname.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_Posturedeploymentname_sync] +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.Empty; + +public class SyncDeletePostureDeploymentPosturedeploymentname { + + public static void main(String[] args) throws Exception { + syncDeletePostureDeploymentPosturedeploymentname(); + } + + public static void syncDeletePostureDeploymentPosturedeploymentname() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + securityPostureClient.deletePostureDeploymentAsync(name).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_Posturedeploymentname_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeploymentString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeploymentString.java new file mode 100644 index 000000000000..de6c8dc562fe --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/deleteposturedeployment/SyncDeletePostureDeploymentString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_String_sync] +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.Empty; + +public class SyncDeletePostureDeploymentString { + + public static void main(String[] args) throws Exception { + syncDeletePostureDeploymentString(); + } + + public static void syncDeletePostureDeploymentString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString(); + securityPostureClient.deletePostureDeploymentAsync(name).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_DeletePostureDeployment_String_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/AsyncExtractPosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/AsyncExtractPosture.java new file mode 100644 index 000000000000..1a5fbe443655 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/AsyncExtractPosture.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ExtractPosture_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.ExtractPostureRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.longrunning.Operation; + +public class AsyncExtractPosture { + + public static void main(String[] args) throws Exception { + asyncExtractPosture(); + } + + public static void asyncExtractPosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ExtractPostureRequest request = + ExtractPostureRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureId("postureId2023219203") + .setWorkload("workload35560311") + .build(); + ApiFuture future = + securityPostureClient.extractPostureCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ExtractPosture_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/AsyncExtractPostureLRO.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/AsyncExtractPostureLRO.java new file mode 100644 index 000000000000..090c849e5376 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/AsyncExtractPostureLRO.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ExtractPosture_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.securityposture.v1.ExtractPostureRequest; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncExtractPostureLRO { + + public static void main(String[] args) throws Exception { + asyncExtractPostureLRO(); + } + + public static void asyncExtractPostureLRO() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ExtractPostureRequest request = + ExtractPostureRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureId("postureId2023219203") + .setWorkload("workload35560311") + .build(); + OperationFuture future = + securityPostureClient.extractPostureOperationCallable().futureCall(request); + // Do something. + Posture response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ExtractPosture_LRO_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPosture.java new file mode 100644 index 000000000000..b8127be04b87 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPosture.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ExtractPosture_sync] +import com.google.cloud.securityposture.v1.ExtractPostureRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncExtractPosture { + + public static void main(String[] args) throws Exception { + syncExtractPosture(); + } + + public static void syncExtractPosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ExtractPostureRequest request = + ExtractPostureRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPostureId("postureId2023219203") + .setWorkload("workload35560311") + .build(); + Posture response = securityPostureClient.extractPostureAsync(request).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ExtractPosture_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPostureOrganizationnameStringString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPostureOrganizationnameStringString.java new file mode 100644 index 000000000000..a3dbfc5e65b5 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPostureOrganizationnameStringString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ExtractPosture_OrganizationnameStringString_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncExtractPostureOrganizationnameStringString { + + public static void main(String[] args) throws Exception { + syncExtractPostureOrganizationnameStringString(); + } + + public static void syncExtractPostureOrganizationnameStringString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + Posture response = + securityPostureClient.extractPostureAsync(parent, postureId, workload).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ExtractPosture_OrganizationnameStringString_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPostureStringStringString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPostureStringStringString.java new file mode 100644 index 000000000000..e38d7bdd4b33 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/extractposture/SyncExtractPostureStringStringString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ExtractPosture_StringStringString_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncExtractPostureStringStringString { + + public static void main(String[] args) throws Exception { + syncExtractPostureStringStringString(); + } + + public static void syncExtractPostureStringStringString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + String postureId = "postureId2023219203"; + String workload = "workload35560311"; + Posture response = + securityPostureClient.extractPostureAsync(parent, postureId, workload).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ExtractPosture_StringStringString_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getlocation/AsyncGetLocation.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..c8b3c882fc93 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getlocation/AsyncGetLocation.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = securityPostureClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetLocation_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getlocation/SyncGetLocation.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..3f8e994dc8ab --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getlocation/SyncGetLocation.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = securityPostureClient.getLocation(request); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetLocation_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/AsyncGetPosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/AsyncGetPosture.java new file mode 100644 index 000000000000..453f4c2b5820 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/AsyncGetPosture.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPosture_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.GetPostureRequest; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncGetPosture { + + public static void main(String[] args) throws Exception { + asyncGetPosture(); + } + + public static void asyncGetPosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + GetPostureRequest request = + GetPostureRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .build(); + ApiFuture future = securityPostureClient.getPostureCallable().futureCall(request); + // Do something. + Posture response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPosture_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPosture.java new file mode 100644 index 000000000000..80dc9c5590f6 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPosture.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPosture_sync] +import com.google.cloud.securityposture.v1.GetPostureRequest; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPosture { + + public static void main(String[] args) throws Exception { + syncGetPosture(); + } + + public static void syncGetPosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + GetPostureRequest request = + GetPostureRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setRevisionId("revisionId-1507445162") + .build(); + Posture response = securityPostureClient.getPosture(request); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPosture_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPosturePosturename.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPosturePosturename.java new file mode 100644 index 000000000000..3ee337c8ef31 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPosturePosturename.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPosture_Posturename_sync] +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPosturePosturename { + + public static void main(String[] args) throws Exception { + syncGetPosturePosturename(); + } + + public static void syncGetPosturePosturename() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]"); + Posture response = securityPostureClient.getPosture(name); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPosture_Posturename_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPostureString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPostureString.java new file mode 100644 index 000000000000..783a001de1c0 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposture/SyncGetPostureString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPosture_String_sync] +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPostureString { + + public static void main(String[] args) throws Exception { + syncGetPostureString(); + } + + public static void syncGetPostureString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString(); + Posture response = securityPostureClient.getPosture(name); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPosture_String_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/AsyncGetPostureDeployment.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/AsyncGetPostureDeployment.java new file mode 100644 index 000000000000..384f2623fc92 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/AsyncGetPostureDeployment.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPostureDeployment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.GetPostureDeploymentRequest; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncGetPostureDeployment { + + public static void main(String[] args) throws Exception { + asyncGetPostureDeployment(); + } + + public static void asyncGetPostureDeployment() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + GetPostureDeploymentRequest request = + GetPostureDeploymentRequest.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .build(); + ApiFuture future = + securityPostureClient.getPostureDeploymentCallable().futureCall(request); + // Do something. + PostureDeployment response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPostureDeployment_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeployment.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeployment.java new file mode 100644 index 000000000000..ffa09b170e68 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeployment.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPostureDeployment_sync] +import com.google.cloud.securityposture.v1.GetPostureDeploymentRequest; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPostureDeployment { + + public static void main(String[] args) throws Exception { + syncGetPostureDeployment(); + } + + public static void syncGetPostureDeployment() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + GetPostureDeploymentRequest request = + GetPostureDeploymentRequest.newBuilder() + .setName( + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString()) + .build(); + PostureDeployment response = securityPostureClient.getPostureDeployment(request); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPostureDeployment_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeploymentPosturedeploymentname.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeploymentPosturedeploymentname.java new file mode 100644 index 000000000000..ec93e247840e --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeploymentPosturedeploymentname.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPostureDeployment_Posturedeploymentname_sync] +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPostureDeploymentPosturedeploymentname { + + public static void main(String[] args) throws Exception { + syncGetPostureDeploymentPosturedeploymentname(); + } + + public static void syncGetPostureDeploymentPosturedeploymentname() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + PostureDeploymentName name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]"); + PostureDeployment response = securityPostureClient.getPostureDeployment(name); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPostureDeployment_Posturedeploymentname_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeploymentString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeploymentString.java new file mode 100644 index 000000000000..55a398475f61 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturedeployment/SyncGetPostureDeploymentString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPostureDeployment_String_sync] +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.PostureDeploymentName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPostureDeploymentString { + + public static void main(String[] args) throws Exception { + syncGetPostureDeploymentString(); + } + + public static void syncGetPostureDeploymentString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String name = + PostureDeploymentName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_DEPLOYMENT]") + .toString(); + PostureDeployment response = securityPostureClient.getPostureDeployment(name); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPostureDeployment_String_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/AsyncGetPostureTemplate.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/AsyncGetPostureTemplate.java new file mode 100644 index 000000000000..555387bd1161 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/AsyncGetPostureTemplate.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPostureTemplate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.GetPostureTemplateRequest; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.PostureTemplateName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncGetPostureTemplate { + + public static void main(String[] args) throws Exception { + asyncGetPostureTemplate(); + } + + public static void asyncGetPostureTemplate() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + GetPostureTemplateRequest request = + GetPostureTemplateRequest.newBuilder() + .setName( + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]") + .toString()) + .setRevisionId("revisionId-1507445162") + .build(); + ApiFuture future = + securityPostureClient.getPostureTemplateCallable().futureCall(request); + // Do something. + PostureTemplate response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPostureTemplate_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplate.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplate.java new file mode 100644 index 000000000000..e43318137f41 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplate.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPostureTemplate_sync] +import com.google.cloud.securityposture.v1.GetPostureTemplateRequest; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.PostureTemplateName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPostureTemplate { + + public static void main(String[] args) throws Exception { + syncGetPostureTemplate(); + } + + public static void syncGetPostureTemplate() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + GetPostureTemplateRequest request = + GetPostureTemplateRequest.newBuilder() + .setName( + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]") + .toString()) + .setRevisionId("revisionId-1507445162") + .build(); + PostureTemplate response = securityPostureClient.getPostureTemplate(request); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPostureTemplate_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplatePosturetemplatename.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplatePosturetemplatename.java new file mode 100644 index 000000000000..eb92856b0afa --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplatePosturetemplatename.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPostureTemplate_Posturetemplatename_sync] +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.PostureTemplateName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPostureTemplatePosturetemplatename { + + public static void main(String[] args) throws Exception { + syncGetPostureTemplatePosturetemplatename(); + } + + public static void syncGetPostureTemplatePosturetemplatename() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + PostureTemplateName name = + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]"); + PostureTemplate response = securityPostureClient.getPostureTemplate(name); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPostureTemplate_Posturetemplatename_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplateString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplateString.java new file mode 100644 index 000000000000..e66b6ec2fe0f --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/getposturetemplate/SyncGetPostureTemplateString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_GetPostureTemplate_String_sync] +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.PostureTemplateName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncGetPostureTemplateString { + + public static void main(String[] args) throws Exception { + syncGetPostureTemplateString(); + } + + public static void syncGetPostureTemplateString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String name = + PostureTemplateName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE_TEMPLATE]").toString(); + PostureTemplate response = securityPostureClient.getPostureTemplate(name); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_GetPostureTemplate_String_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/AsyncListLocations.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..7ca9b8764eb5 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/AsyncListLocations.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + securityPostureClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListLocations_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/AsyncListLocationsPaged.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..86ecb10d3734 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + securityPostureClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListLocations_Paged_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/SyncListLocations.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..1b65c259411e --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listlocations/SyncListLocations.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : securityPostureClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListLocations_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/AsyncListPostureDeployments.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/AsyncListPostureDeployments.java new file mode 100644 index 000000000000..7db1da1233a9 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/AsyncListPostureDeployments.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureDeployments_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncListPostureDeployments { + + public static void main(String[] args) throws Exception { + asyncListPostureDeployments(); + } + + public static void asyncListPostureDeployments() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureDeploymentsRequest request = + ListPostureDeploymentsRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + securityPostureClient.listPostureDeploymentsPagedCallable().futureCall(request); + // Do something. + for (PostureDeployment element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureDeployments_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/AsyncListPostureDeploymentsPaged.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/AsyncListPostureDeploymentsPaged.java new file mode 100644 index 000000000000..bb4a3068e3fe --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/AsyncListPostureDeploymentsPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureDeployments_Paged_async] +import com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest; +import com.google.cloud.securityposture.v1.ListPostureDeploymentsResponse; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.common.base.Strings; + +public class AsyncListPostureDeploymentsPaged { + + public static void main(String[] args) throws Exception { + asyncListPostureDeploymentsPaged(); + } + + public static void asyncListPostureDeploymentsPaged() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureDeploymentsRequest request = + ListPostureDeploymentsRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListPostureDeploymentsResponse response = + securityPostureClient.listPostureDeploymentsCallable().call(request); + for (PostureDeployment element : response.getPostureDeploymentsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureDeployments_Paged_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeployments.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeployments.java new file mode 100644 index 000000000000..c3c13330964b --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeployments.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureDeployments_sync] +import com.google.cloud.securityposture.v1.ListPostureDeploymentsRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPostureDeployments { + + public static void main(String[] args) throws Exception { + syncListPostureDeployments(); + } + + public static void syncListPostureDeployments() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureDeploymentsRequest request = + ListPostureDeploymentsRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (PostureDeployment element : + securityPostureClient.listPostureDeployments(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureDeployments_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeploymentsOrganizationname.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeploymentsOrganizationname.java new file mode 100644 index 000000000000..f6ea16913796 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeploymentsOrganizationname.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureDeployments_Organizationname_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPostureDeploymentsOrganizationname { + + public static void main(String[] args) throws Exception { + syncListPostureDeploymentsOrganizationname(); + } + + public static void syncListPostureDeploymentsOrganizationname() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + for (PostureDeployment element : + securityPostureClient.listPostureDeployments(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureDeployments_Organizationname_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeploymentsString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeploymentsString.java new file mode 100644 index 000000000000..d2433a60f0cc --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturedeployments/SyncListPostureDeploymentsString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureDeployments_String_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPostureDeploymentsString { + + public static void main(String[] args) throws Exception { + syncListPostureDeploymentsString(); + } + + public static void syncListPostureDeploymentsString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + for (PostureDeployment element : + securityPostureClient.listPostureDeployments(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureDeployments_String_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/AsyncListPostureRevisions.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/AsyncListPostureRevisions.java new file mode 100644 index 000000000000..d19565068715 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/AsyncListPostureRevisions.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureRevisions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.ListPostureRevisionsRequest; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncListPostureRevisions { + + public static void main(String[] args) throws Exception { + asyncListPostureRevisions(); + } + + public static void asyncListPostureRevisions() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureRevisionsRequest request = + ListPostureRevisionsRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + securityPostureClient.listPostureRevisionsPagedCallable().futureCall(request); + // Do something. + for (Posture element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureRevisions_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/AsyncListPostureRevisionsPaged.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/AsyncListPostureRevisionsPaged.java new file mode 100644 index 000000000000..9d7959f5b713 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/AsyncListPostureRevisionsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureRevisions_Paged_async] +import com.google.cloud.securityposture.v1.ListPostureRevisionsRequest; +import com.google.cloud.securityposture.v1.ListPostureRevisionsResponse; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.common.base.Strings; + +public class AsyncListPostureRevisionsPaged { + + public static void main(String[] args) throws Exception { + asyncListPostureRevisionsPaged(); + } + + public static void asyncListPostureRevisionsPaged() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureRevisionsRequest request = + ListPostureRevisionsRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListPostureRevisionsResponse response = + securityPostureClient.listPostureRevisionsCallable().call(request); + for (Posture element : response.getRevisionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureRevisions_Paged_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/SyncListPostureRevisions.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/SyncListPostureRevisions.java new file mode 100644 index 000000000000..ec23b721db77 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturerevisions/SyncListPostureRevisions.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureRevisions_sync] +import com.google.cloud.securityposture.v1.ListPostureRevisionsRequest; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.PostureName; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPostureRevisions { + + public static void main(String[] args) throws Exception { + syncListPostureRevisions(); + } + + public static void syncListPostureRevisions() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureRevisionsRequest request = + ListPostureRevisionsRequest.newBuilder() + .setName(PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Posture element : securityPostureClient.listPostureRevisions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureRevisions_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/AsyncListPostures.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/AsyncListPostures.java new file mode 100644 index 000000000000..438ac42d202c --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/AsyncListPostures.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostures_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.ListPosturesRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncListPostures { + + public static void main(String[] args) throws Exception { + asyncListPostures(); + } + + public static void asyncListPostures() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPosturesRequest request = + ListPosturesRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + securityPostureClient.listPosturesPagedCallable().futureCall(request); + // Do something. + for (Posture element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostures_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/AsyncListPosturesPaged.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/AsyncListPosturesPaged.java new file mode 100644 index 000000000000..8fcba2791c06 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/AsyncListPosturesPaged.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostures_Paged_async] +import com.google.cloud.securityposture.v1.ListPosturesRequest; +import com.google.cloud.securityposture.v1.ListPosturesResponse; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.common.base.Strings; + +public class AsyncListPosturesPaged { + + public static void main(String[] args) throws Exception { + asyncListPosturesPaged(); + } + + public static void asyncListPosturesPaged() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPosturesRequest request = + ListPosturesRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListPosturesResponse response = securityPostureClient.listPosturesCallable().call(request); + for (Posture element : response.getPosturesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostures_Paged_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPostures.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPostures.java new file mode 100644 index 000000000000..200457125233 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPostures.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostures_sync] +import com.google.cloud.securityposture.v1.ListPosturesRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPostures { + + public static void main(String[] args) throws Exception { + syncListPostures(); + } + + public static void syncListPostures() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPosturesRequest request = + ListPosturesRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Posture element : securityPostureClient.listPostures(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostures_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPosturesOrganizationname.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPosturesOrganizationname.java new file mode 100644 index 000000000000..7652633fdb79 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPosturesOrganizationname.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostures_Organizationname_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPosturesOrganizationname { + + public static void main(String[] args) throws Exception { + syncListPosturesOrganizationname(); + } + + public static void syncListPosturesOrganizationname() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + for (Posture element : securityPostureClient.listPostures(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostures_Organizationname_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPosturesString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPosturesString.java new file mode 100644 index 000000000000..ab131c68de13 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listpostures/SyncListPosturesString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostures_String_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPosturesString { + + public static void main(String[] args) throws Exception { + syncListPosturesString(); + } + + public static void syncListPosturesString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + for (Posture element : securityPostureClient.listPostures(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostures_String_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/AsyncListPostureTemplates.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/AsyncListPostureTemplates.java new file mode 100644 index 000000000000..39bd678d2301 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/AsyncListPostureTemplates.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureTemplates_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.ListPostureTemplatesRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class AsyncListPostureTemplates { + + public static void main(String[] args) throws Exception { + asyncListPostureTemplates(); + } + + public static void asyncListPostureTemplates() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureTemplatesRequest request = + ListPostureTemplatesRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + securityPostureClient.listPostureTemplatesPagedCallable().futureCall(request); + // Do something. + for (PostureTemplate element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureTemplates_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/AsyncListPostureTemplatesPaged.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/AsyncListPostureTemplatesPaged.java new file mode 100644 index 000000000000..afcd050a8cf4 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/AsyncListPostureTemplatesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureTemplates_Paged_async] +import com.google.cloud.securityposture.v1.ListPostureTemplatesRequest; +import com.google.cloud.securityposture.v1.ListPostureTemplatesResponse; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.common.base.Strings; + +public class AsyncListPostureTemplatesPaged { + + public static void main(String[] args) throws Exception { + asyncListPostureTemplatesPaged(); + } + + public static void asyncListPostureTemplatesPaged() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureTemplatesRequest request = + ListPostureTemplatesRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListPostureTemplatesResponse response = + securityPostureClient.listPostureTemplatesCallable().call(request); + for (PostureTemplate element : response.getPostureTemplatesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureTemplates_Paged_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplates.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplates.java new file mode 100644 index 000000000000..8b3de4fe65f3 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplates.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureTemplates_sync] +import com.google.cloud.securityposture.v1.ListPostureTemplatesRequest; +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPostureTemplates { + + public static void main(String[] args) throws Exception { + syncListPostureTemplates(); + } + + public static void syncListPostureTemplates() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + ListPostureTemplatesRequest request = + ListPostureTemplatesRequest.newBuilder() + .setParent(OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .build(); + for (PostureTemplate element : + securityPostureClient.listPostureTemplates(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureTemplates_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplatesOrganizationname.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplatesOrganizationname.java new file mode 100644 index 000000000000..05b0902d0939 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplatesOrganizationname.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureTemplates_Organizationname_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPostureTemplatesOrganizationname { + + public static void main(String[] args) throws Exception { + syncListPostureTemplatesOrganizationname(); + } + + public static void syncListPostureTemplatesOrganizationname() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]"); + for (PostureTemplate element : + securityPostureClient.listPostureTemplates(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureTemplates_Organizationname_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplatesString.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplatesString.java new file mode 100644 index 000000000000..e6cfec474353 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/listposturetemplates/SyncListPostureTemplatesString.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_ListPostureTemplates_String_sync] +import com.google.cloud.securityposture.v1.OrganizationName; +import com.google.cloud.securityposture.v1.PostureTemplate; +import com.google.cloud.securityposture.v1.SecurityPostureClient; + +public class SyncListPostureTemplatesString { + + public static void main(String[] args) throws Exception { + syncListPostureTemplatesString(); + } + + public static void syncListPostureTemplatesString() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + String parent = OrganizationName.of("[ORGANIZATION]", "[LOCATION]").toString(); + for (PostureTemplate element : + securityPostureClient.listPostureTemplates(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END securityposture_v1_generated_SecurityPosture_ListPostureTemplates_String_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/AsyncUpdatePosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/AsyncUpdatePosture.java new file mode 100644 index 000000000000..cfbec0cac111 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/AsyncUpdatePosture.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_UpdatePosture_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.UpdatePostureRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdatePosture { + + public static void main(String[] args) throws Exception { + asyncUpdatePosture(); + } + + public static void asyncUpdatePosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + UpdatePostureRequest request = + UpdatePostureRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setPosture(Posture.newBuilder().build()) + .setRevisionId("revisionId-1507445162") + .build(); + ApiFuture future = + securityPostureClient.updatePostureCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_UpdatePosture_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/AsyncUpdatePostureLRO.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/AsyncUpdatePostureLRO.java new file mode 100644 index 000000000000..28820ca28306 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/AsyncUpdatePostureLRO.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_UpdatePosture_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.UpdatePostureRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdatePostureLRO { + + public static void main(String[] args) throws Exception { + asyncUpdatePostureLRO(); + } + + public static void asyncUpdatePostureLRO() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + UpdatePostureRequest request = + UpdatePostureRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setPosture(Posture.newBuilder().build()) + .setRevisionId("revisionId-1507445162") + .build(); + OperationFuture future = + securityPostureClient.updatePostureOperationCallable().futureCall(request); + // Do something. + Posture response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_UpdatePosture_LRO_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/SyncUpdatePosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/SyncUpdatePosture.java new file mode 100644 index 000000000000..df25e5d3615b --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/SyncUpdatePosture.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_UpdatePosture_sync] +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.UpdatePostureRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdatePosture { + + public static void main(String[] args) throws Exception { + syncUpdatePosture(); + } + + public static void syncUpdatePosture() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + UpdatePostureRequest request = + UpdatePostureRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setPosture(Posture.newBuilder().build()) + .setRevisionId("revisionId-1507445162") + .build(); + Posture response = securityPostureClient.updatePostureAsync(request).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_UpdatePosture_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/SyncUpdatePosturePostureFieldmask.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/SyncUpdatePosturePostureFieldmask.java new file mode 100644 index 000000000000..f62ab9be1126 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposture/SyncUpdatePosturePostureFieldmask.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_UpdatePosture_PostureFieldmask_sync] +import com.google.cloud.securityposture.v1.Posture; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdatePosturePostureFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdatePosturePostureFieldmask(); + } + + public static void syncUpdatePosturePostureFieldmask() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + Posture posture = Posture.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Posture response = securityPostureClient.updatePostureAsync(posture, updateMask).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_UpdatePosture_PostureFieldmask_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/AsyncUpdatePostureDeployment.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/AsyncUpdatePostureDeployment.java new file mode 100644 index 000000000000..673b05ef231c --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/AsyncUpdatePostureDeployment.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_UpdatePostureDeployment_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdatePostureDeployment { + + public static void main(String[] args) throws Exception { + asyncUpdatePostureDeployment(); + } + + public static void asyncUpdatePostureDeployment() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + UpdatePostureDeploymentRequest request = + UpdatePostureDeploymentRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setPostureDeployment(PostureDeployment.newBuilder().build()) + .build(); + ApiFuture future = + securityPostureClient.updatePostureDeploymentCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_UpdatePostureDeployment_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/AsyncUpdatePostureDeploymentLRO.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/AsyncUpdatePostureDeploymentLRO.java new file mode 100644 index 000000000000..fc6355d4c289 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/AsyncUpdatePostureDeploymentLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS 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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_UpdatePostureDeployment_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.securityposture.v1.OperationMetadata; +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdatePostureDeploymentLRO { + + public static void main(String[] args) throws Exception { + asyncUpdatePostureDeploymentLRO(); + } + + public static void asyncUpdatePostureDeploymentLRO() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + UpdatePostureDeploymentRequest request = + UpdatePostureDeploymentRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setPostureDeployment(PostureDeployment.newBuilder().build()) + .build(); + OperationFuture future = + securityPostureClient.updatePostureDeploymentOperationCallable().futureCall(request); + // Do something. + PostureDeployment response = future.get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_UpdatePostureDeployment_LRO_async] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/SyncUpdatePostureDeployment.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/SyncUpdatePostureDeployment.java new file mode 100644 index 000000000000..f2cb1d96c187 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/SyncUpdatePostureDeployment.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_UpdatePostureDeployment_sync] +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.cloud.securityposture.v1.UpdatePostureDeploymentRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdatePostureDeployment { + + public static void main(String[] args) throws Exception { + syncUpdatePostureDeployment(); + } + + public static void syncUpdatePostureDeployment() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + UpdatePostureDeploymentRequest request = + UpdatePostureDeploymentRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setPostureDeployment(PostureDeployment.newBuilder().build()) + .build(); + PostureDeployment response = + securityPostureClient.updatePostureDeploymentAsync(request).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_UpdatePostureDeployment_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/SyncUpdatePostureDeploymentPosturedeploymentFieldmask.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/SyncUpdatePostureDeploymentPosturedeploymentFieldmask.java new file mode 100644 index 000000000000..cbd8515ba6c3 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposture/updateposturedeployment/SyncUpdatePostureDeploymentPosturedeploymentFieldmask.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPosture_UpdatePostureDeployment_PosturedeploymentFieldmask_sync] +import com.google.cloud.securityposture.v1.PostureDeployment; +import com.google.cloud.securityposture.v1.SecurityPostureClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdatePostureDeploymentPosturedeploymentFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdatePostureDeploymentPosturedeploymentFieldmask(); + } + + public static void syncUpdatePostureDeploymentPosturedeploymentFieldmask() 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 (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) { + PostureDeployment postureDeployment = PostureDeployment.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + PostureDeployment response = + securityPostureClient.updatePostureDeploymentAsync(postureDeployment, updateMask).get(); + } + } +} +// [END securityposture_v1_generated_SecurityPosture_UpdatePostureDeployment_PosturedeploymentFieldmask_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposturesettings/getposture/SyncGetPosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposturesettings/getposture/SyncGetPosture.java new file mode 100644 index 000000000000..e18467905208 --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/securityposturesettings/getposture/SyncGetPosture.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.securityposture.v1.samples; + +// [START securityposture_v1_generated_SecurityPostureSettings_GetPosture_sync] +import com.google.cloud.securityposture.v1.SecurityPostureSettings; +import java.time.Duration; + +public class SyncGetPosture { + + public static void main(String[] args) throws Exception { + syncGetPosture(); + } + + public static void syncGetPosture() 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 + SecurityPostureSettings.Builder securityPostureSettingsBuilder = + SecurityPostureSettings.newBuilder(); + securityPostureSettingsBuilder + .getPostureSettings() + .setRetrySettings( + securityPostureSettingsBuilder + .getPostureSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SecurityPostureSettings securityPostureSettings = securityPostureSettingsBuilder.build(); + } +} +// [END securityposture_v1_generated_SecurityPostureSettings_GetPosture_sync] diff --git a/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/stub/securityposturestubsettings/getposture/SyncGetPosture.java b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/stub/securityposturestubsettings/getposture/SyncGetPosture.java new file mode 100644 index 000000000000..7e700268b23d --- /dev/null +++ b/java-securityposture/samples/snippets/generated/com/google/cloud/securityposture/v1/stub/securityposturestubsettings/getposture/SyncGetPosture.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.securityposture.v1.stub.samples; + +// [START securityposture_v1_generated_SecurityPostureStubSettings_GetPosture_sync] +import com.google.cloud.securityposture.v1.stub.SecurityPostureStubSettings; +import java.time.Duration; + +public class SyncGetPosture { + + public static void main(String[] args) throws Exception { + syncGetPosture(); + } + + public static void syncGetPosture() 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 + SecurityPostureStubSettings.Builder securityPostureSettingsBuilder = + SecurityPostureStubSettings.newBuilder(); + securityPostureSettingsBuilder + .getPostureSettings() + .setRetrySettings( + securityPostureSettingsBuilder + .getPostureSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SecurityPostureStubSettings securityPostureSettings = securityPostureSettingsBuilder.build(); + } +} +// [END securityposture_v1_generated_SecurityPostureStubSettings_GetPosture_sync] diff --git a/pom.xml b/pom.xml index 7230ece85ef9..fb92dff76a4d 100644 --- a/pom.xml +++ b/pom.xml @@ -152,6 +152,7 @@ java-securitycentermanagement java-securitycenter java-securitycenter-settings + java-securityposture java-security-private-ca java-service-control java-servicedirectory diff --git a/versions.txt b/versions.txt index de892aa13628..525c561bf6f0 100644 --- a/versions.txt +++ b/versions.txt @@ -727,3 +727,6 @@ proto-google-cloud-servicehealth-v1:0.2.0:0.3.0-SNAPSHOT grpc-google-cloud-servicehealth-v1:0.2.0:0.3.0-SNAPSHOT proto-google-cloud-meet-v2:0.2.0:0.3.0-SNAPSHOT grpc-google-cloud-meet-v2:0.2.0:0.3.0-SNAPSHOT +google-cloud-securityposture:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-securityposture-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-securityposture-v1:0.0.0:0.0.1-SNAPSHOT