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(). + * + *
Method | + *Description | + *Method 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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeletePostureDeployment |
+ * Deletes a single PostureDeployment. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetLocation |
+ * Gets information about a location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of 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+ */ + public final UnaryCallablefuture = + * securityPostureClient.listPosturesPagedCallable().futureCall(request); + * // Do something. + * for (Posture element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
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
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.listPostureRevisionsPagedCallable().futureCall(request); + * // Do something. + * for (Posture element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
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
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+ */ + public final UnaryCallablefuture = securityPostureClient.getPostureCallable().futureCall(request); + * // Do something. + * Posture response = future.get(); + * } + * }
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
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
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
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+ */ + public final OperationCallablefuture = + * securityPostureClient.createPostureOperationCallable().futureCall(request); + * // Do something. + * Posture response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.createPostureCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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
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
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+ */ + public final OperationCallablefuture = + * securityPostureClient.updatePostureOperationCallable().futureCall(request); + * // Do something. + * Posture response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.updatePostureCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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
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
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
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+ */ + public final OperationCallablefuture = + * securityPostureClient.deletePostureOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.deletePostureCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
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
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
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
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+ */ + public final OperationCallablefuture = + * securityPostureClient.extractPostureOperationCallable().futureCall(request); + * // Do something. + * Posture response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.extractPostureCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.listPostureDeploymentsPagedCallable().futureCall(request); + * // Do something. + * for (PostureDeployment element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
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
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.getPostureDeploymentCallable().futureCall(request); + * // Do something. + * PostureDeployment response = future.get(); + * } + * }
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
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
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
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+ */ + 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. + * + *future = + * securityPostureClient.createPostureDeploymentOperationCallable().futureCall(request); + * // Do something. + * PostureDeployment response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.createPostureDeploymentCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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
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
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+ */ + public final OperationCallable< + UpdatePostureDeploymentRequest, PostureDeployment, OperationMetadata> + updatePostureDeploymentOperationCallable() { + return stub.updatePostureDeploymentOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single PostureDeployment. + * + *future = + * securityPostureClient.updatePostureDeploymentOperationCallable().futureCall(request); + * // Do something. + * PostureDeployment response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.updatePostureDeploymentCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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
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
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
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+ */ + public final OperationCallablefuture = + * securityPostureClient.deletePostureDeploymentOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.deletePostureDeploymentCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.listPostureTemplatesPagedCallable().futureCall(request); + * // Do something. + * for (PostureTemplate element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
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
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.getPostureTemplateCallable().futureCall(request); + * // Do something. + * PostureTemplate response = future.get(); + * } + * }
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+ */ + public final UnaryCallablefuture = + * securityPostureClient.listLocationsPagedCallable().futureCall(request); + * // Do something. + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
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
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+ */ + public final UnaryCallablefuture = securityPostureClient.getLocationCallable().futureCall(request); + * // Do something. + * Location response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
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
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= SecurityPostureClient =======================
+ *
+ * Service Description: Service describing handlers for resources.
+ *
+ * Sample for SecurityPostureClient:
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcSecurityPostureCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public 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{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying 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.
+ *
+ *