Class SecurityPostureClient

java.lang.Object
com.google.cloud.securityposture.v1.SecurityPostureClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class SecurityPostureClient extends Object implements BackgroundResource
Service Description: Service describing handlers for resources.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SecurityPostureClient securityPostureClient = SecurityPostureClient.create()) {
   PostureName name = PostureName.of("[ORGANIZATION]", "[LOCATION]", "[POSTURE]");
   Posture response = securityPostureClient.getPosture(name);
 }
 

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

Methods
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.

  • listPostures(ListPosturesRequest request)

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

  • listPostures(OrganizationName parent)

  • listPostures(String parent)

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

  • listPosturesPagedCallable()

  • listPosturesCallable()

ListPostureRevisions

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

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

  • listPostureRevisions(ListPostureRevisionsRequest request)

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

  • listPostureRevisionsPagedCallable()

  • listPostureRevisionsCallable()

GetPosture

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

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

  • getPosture(GetPostureRequest request)

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

  • getPosture(PostureName name)

  • getPosture(String name)

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

  • getPostureCallable()

CreatePosture

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

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

  • createPostureAsync(CreatePostureRequest request)

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

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

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

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

  • createPostureOperationCallable()

  • createPostureCallable()

UpdatePosture

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

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

  • updatePostureAsync(UpdatePostureRequest request)

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

  • updatePostureAsync(Posture posture, FieldMask updateMask)

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

  • updatePostureOperationCallable()

  • updatePostureCallable()

DeletePosture

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

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

  • deletePostureAsync(DeletePostureRequest request)

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

  • deletePostureAsync(PostureName name)

  • deletePostureAsync(String name)

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

  • deletePostureOperationCallable()

  • deletePostureCallable()

ExtractPosture

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

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

  • extractPostureAsync(ExtractPostureRequest request)

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

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

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

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

  • extractPostureOperationCallable()

  • extractPostureCallable()

ListPostureDeployments

PostureDeployments Lists PostureDeployments in a given project and location.

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

  • listPostureDeployments(ListPostureDeploymentsRequest request)

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

  • listPostureDeployments(OrganizationName parent)

  • listPostureDeployments(String parent)

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

  • listPostureDeploymentsPagedCallable()

  • listPostureDeploymentsCallable()

GetPostureDeployment

Gets details of a single PostureDeployment.

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

  • getPostureDeployment(GetPostureDeploymentRequest request)

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

  • getPostureDeployment(PostureDeploymentName name)

  • getPostureDeployment(String name)

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

  • getPostureDeploymentCallable()

CreatePostureDeployment

Creates a new PostureDeployment in a given project and location.

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

  • createPostureDeploymentAsync(CreatePostureDeploymentRequest request)

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

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

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

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

  • createPostureDeploymentOperationCallable()

  • createPostureDeploymentCallable()

UpdatePostureDeployment

Updates the parameters of a single PostureDeployment.

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

  • updatePostureDeploymentAsync(UpdatePostureDeploymentRequest request)

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

  • updatePostureDeploymentAsync(PostureDeployment postureDeployment, FieldMask updateMask)

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

  • updatePostureDeploymentOperationCallable()

  • updatePostureDeploymentCallable()

DeletePostureDeployment

Deletes a single PostureDeployment.

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

  • deletePostureDeploymentAsync(DeletePostureDeploymentRequest request)

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

  • deletePostureDeploymentAsync(PostureDeploymentName name)

  • deletePostureDeploymentAsync(String name)

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

  • deletePostureDeploymentOperationCallable()

  • deletePostureDeploymentCallable()

ListPostureTemplates

PostureTemplates Lists all the PostureTemplates available to the user.

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

  • listPostureTemplates(ListPostureTemplatesRequest request)

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

  • listPostureTemplates(OrganizationName parent)

  • listPostureTemplates(String parent)

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

  • listPostureTemplatesPagedCallable()

  • listPostureTemplatesCallable()

GetPostureTemplate

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

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

  • getPostureTemplate(GetPostureTemplateRequest request)

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

  • getPostureTemplate(PostureTemplateName name)

  • getPostureTemplate(String name)

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

  • getPostureTemplateCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of SecurityPostureSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require 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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require 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:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require 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.

  • Constructor Details

    • SecurityPostureClient

      protected SecurityPostureClient(SecurityPostureSettings settings) throws IOException
      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.
      Throws:
      IOException
    • SecurityPostureClient

      protected SecurityPostureClient(SecurityPostureStub stub)
  • Method Details

    • create

      public static final SecurityPostureClient create() throws IOException
      Constructs an instance of SecurityPostureClient with default settings.
      Throws:
      IOException
    • create

      public static final SecurityPostureClient create(SecurityPostureSettings settings) throws IOException
      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.
      Throws:
      IOException
    • create

      public static final SecurityPostureClient create(SecurityPostureStub stub)
      Constructs an instance of SecurityPostureClient, using the given stub for making calls. This is for advanced usage - prefer using create(SecurityPostureSettings).
    • getSettings

      public final SecurityPostureSettings getSettings()
    • getStub

      public SecurityPostureStub getStub()
    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • getHttpJsonOperationsClient

      @BetaApi public final OperationsClient getHttpJsonOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • 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.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListPosturesRequest.
      Throws:
      ApiException - if the remote call fails
    • listPostures

      public final SecurityPostureClient.ListPosturesPagedResponse listPostures(String parent)
      (-- 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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListPosturesRequest.
      Throws:
      ApiException - if the remote call fails
    • 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.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listPosturesPagedCallable

      (-- 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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Posture> future =
             securityPostureClient.listPosturesPagedCallable().futureCall(request);
         // Do something.
         for (Posture element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listPosturesCallable

      public final UnaryCallable<ListPosturesRequest,ListPosturesResponse> listPosturesCallable()
      (-- 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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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;
           }
         }
       }
       
    • listPostureRevisions

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listPostureRevisionsPagedCallable

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Posture> future =
             securityPostureClient.listPostureRevisionsPagedCallable().futureCall(request);
         // Do something.
         for (Posture element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listPostureRevisionsCallable

      public final UnaryCallable<ListPostureRevisionsRequest,ListPostureRevisionsResponse> listPostureRevisionsCallable()
      Lists revisions of a Posture in a given organization and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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;
           }
         }
       }
       
    • getPosture

      public final Posture getPosture(PostureName name)
      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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getPosture

      public final Posture getPosture(String name)
      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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getPosture

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getPostureCallable

      public final UnaryCallable<GetPostureRequest,Posture> getPostureCallable()
      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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Posture> future = securityPostureClient.getPostureCallable().futureCall(request);
         // Do something.
         Posture response = future.get();
       }
       
    • createPostureAsync

      public final OperationFuture<Posture,OperationMetadata> createPostureAsync(OrganizationName parent, Posture posture, String postureId)
      Creates a new Posture resource. If a Posture with the specified name already exists in the specified organization and location, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      parent - Required. Value for parent.
      posture - Required. The resource being created.
      postureId - Required. User provided identifier. It should be unique in scope of an Organization and location.
      Throws:
      ApiException - if the remote call fails
    • createPostureAsync

      public final OperationFuture<Posture,OperationMetadata> createPostureAsync(String parent, Posture posture, String postureId)
      Creates a new Posture resource. If a Posture with the specified name already exists in the specified organization and location, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      parent - Required. Value for parent.
      posture - Required. The resource being created.
      postureId - Required. User provided identifier. It should be unique in scope of an Organization and location.
      Throws:
      ApiException - if the remote call fails
    • createPostureAsync

      public final OperationFuture<Posture,OperationMetadata> createPostureAsync(CreatePostureRequest request)
      Creates a new Posture resource. If a Posture with the specified name already exists in the specified organization and location, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createPostureOperationCallable

      public final OperationCallable<CreatePostureRequest,Posture,OperationMetadata> createPostureOperationCallable()
      Creates a new Posture resource. If a Posture with the specified name already exists in the specified organization and location, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Posture, OperationMetadata> future =
             securityPostureClient.createPostureOperationCallable().futureCall(request);
         // Do something.
         Posture response = future.get();
       }
       
    • createPostureCallable

      public final UnaryCallable<CreatePostureRequest,Operation> createPostureCallable()
      Creates a new Posture resource. If a Posture with the specified name already exists in the specified organization and location, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Operation> future =
             securityPostureClient.createPostureCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updatePostureAsync

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      posture - Required. The resource being updated.
      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:
      ApiException - if the remote call fails
    • updatePostureAsync

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updatePostureOperationCallable

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Posture, OperationMetadata> future =
             securityPostureClient.updatePostureOperationCallable().futureCall(request);
         // Do something.
         Posture response = future.get();
       }
       
    • updatePostureCallable

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Operation> future =
             securityPostureClient.updatePostureCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deletePostureAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePostureAsync(PostureName name)
      Deletes all the revisions of a resource. A posture can only be deleted when none of the revisions are deployed to any workload.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deletePostureAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePostureAsync(String name)
      Deletes all the revisions of a resource. A posture can only be deleted when none of the revisions are deployed to any workload.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deletePostureAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePostureAsync(DeletePostureRequest request)
      Deletes all the revisions of a resource. A posture can only be deleted when none of the revisions are deployed to any workload.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deletePostureOperationCallable

      public final OperationCallable<DeletePostureRequest,com.google.protobuf.Empty,OperationMetadata> deletePostureOperationCallable()
      Deletes all the revisions of a resource. A posture can only be deleted when none of the revisions are deployed to any workload.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Empty, OperationMetadata> future =
             securityPostureClient.deletePostureOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deletePostureCallable

      public final UnaryCallable<DeletePostureRequest,Operation> deletePostureCallable()
      Deletes all the revisions of a resource. A posture can only be deleted when none of the revisions are deployed to any workload.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Operation> future =
             securityPostureClient.deletePostureCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • extractPostureAsync

      public final OperationFuture<Posture,OperationMetadata> extractPostureAsync(OrganizationName parent, String postureId, String workload)
      Extracts existing policies on a workload as a posture. If a Posture on the given workload already exists, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      parent - Required. The parent resource name. The format of this value is as follows: `organizations/{organization}/locations/{location}`
      postureId - Required. User provided identifier. It should be unique in scope of an Organization and location.
      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:
      ApiException - if the remote call fails
    • extractPostureAsync

      public final OperationFuture<Posture,OperationMetadata> extractPostureAsync(String parent, String postureId, String workload)
      Extracts existing policies on a workload as a posture. If a Posture on the given workload already exists, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      parent - Required. The parent resource name. The format of this value is as follows: `organizations/{organization}/locations/{location}`
      postureId - Required. User provided identifier. It should be unique in scope of an Organization and location.
      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:
      ApiException - if the remote call fails
    • extractPostureAsync

      public final OperationFuture<Posture,OperationMetadata> extractPostureAsync(ExtractPostureRequest request)
      Extracts existing policies on a workload as a posture. If a Posture on the given workload already exists, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • extractPostureOperationCallable

      public final OperationCallable<ExtractPostureRequest,Posture,OperationMetadata> extractPostureOperationCallable()
      Extracts existing policies on a workload as a posture. If a Posture on the given workload already exists, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Posture, OperationMetadata> future =
             securityPostureClient.extractPostureOperationCallable().futureCall(request);
         // Do something.
         Posture response = future.get();
       }
       
    • extractPostureCallable

      public final UnaryCallable<ExtractPostureRequest,Operation> extractPostureCallable()
      Extracts existing policies on a workload as a posture. If a Posture on the given workload already exists, the long running operation returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Operation> future =
             securityPostureClient.extractPostureCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • listPostureDeployments

      PostureDeployments Lists PostureDeployments in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListPostureDeploymentsRequest.
      Throws:
      ApiException - if the remote call fails
    • listPostureDeployments

      public final SecurityPostureClient.ListPostureDeploymentsPagedResponse listPostureDeployments(String parent)
      PostureDeployments Lists PostureDeployments in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListPostureDeploymentsRequest.
      Throws:
      ApiException - if the remote call fails
    • listPostureDeployments

      PostureDeployments Lists PostureDeployments in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listPostureDeploymentsPagedCallable

      PostureDeployments Lists PostureDeployments in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<PostureDeployment> future =
             securityPostureClient.listPostureDeploymentsPagedCallable().futureCall(request);
         // Do something.
         for (PostureDeployment element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listPostureDeploymentsCallable

      public final UnaryCallable<ListPostureDeploymentsRequest,ListPostureDeploymentsResponse> listPostureDeploymentsCallable()
      PostureDeployments Lists PostureDeployments in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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;
           }
         }
       }
       
    • getPostureDeployment

      public final PostureDeployment getPostureDeployment(PostureDeploymentName name)
      Gets details of a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getPostureDeployment

      public final PostureDeployment getPostureDeployment(String name)
      Gets details of a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getPostureDeployment

      public final PostureDeployment getPostureDeployment(GetPostureDeploymentRequest request)
      Gets details of a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getPostureDeploymentCallable

      public final UnaryCallable<GetPostureDeploymentRequest,PostureDeployment> getPostureDeploymentCallable()
      Gets details of a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<PostureDeployment> future =
             securityPostureClient.getPostureDeploymentCallable().futureCall(request);
         // Do something.
         PostureDeployment response = future.get();
       }
       
    • createPostureDeploymentAsync

      public final OperationFuture<PostureDeployment,OperationMetadata> createPostureDeploymentAsync(OrganizationName parent, PostureDeployment postureDeployment, String postureDeploymentId)
      Creates a new PostureDeployment in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      parent - Required. Value for parent. Format: organizations/{org_id}/locations/{location}
      postureDeployment - Required. The resource being created.
      postureDeploymentId - Required. User provided identifier. It should be unique in scope of an Organization and location.
      Throws:
      ApiException - if the remote call fails
    • createPostureDeploymentAsync

      public final OperationFuture<PostureDeployment,OperationMetadata> createPostureDeploymentAsync(String parent, PostureDeployment postureDeployment, String postureDeploymentId)
      Creates a new PostureDeployment in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      parent - Required. Value for parent. Format: organizations/{org_id}/locations/{location}
      postureDeployment - Required. The resource being created.
      postureDeploymentId - Required. User provided identifier. It should be unique in scope of an Organization and location.
      Throws:
      ApiException - if the remote call fails
    • createPostureDeploymentAsync

      public final OperationFuture<PostureDeployment,OperationMetadata> createPostureDeploymentAsync(CreatePostureDeploymentRequest request)
      Creates a new PostureDeployment in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createPostureDeploymentOperationCallable

      public final OperationCallable<CreatePostureDeploymentRequest,PostureDeployment,OperationMetadata> createPostureDeploymentOperationCallable()
      Creates a new PostureDeployment in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<PostureDeployment, OperationMetadata> future =
             securityPostureClient.createPostureDeploymentOperationCallable().futureCall(request);
         // Do something.
         PostureDeployment response = future.get();
       }
       
    • createPostureDeploymentCallable

      public final UnaryCallable<CreatePostureDeploymentRequest,Operation> createPostureDeploymentCallable()
      Creates a new PostureDeployment in a given project and location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Operation> future =
             securityPostureClient.createPostureDeploymentCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updatePostureDeploymentAsync

      public final OperationFuture<PostureDeployment,OperationMetadata> updatePostureDeploymentAsync(PostureDeployment postureDeployment, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      postureDeployment - Required. The resource being updated.
      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:
      ApiException - if the remote call fails
    • updatePostureDeploymentAsync

      public final OperationFuture<PostureDeployment,OperationMetadata> updatePostureDeploymentAsync(UpdatePostureDeploymentRequest request)
      Updates the parameters of a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updatePostureDeploymentOperationCallable

      public final OperationCallable<UpdatePostureDeploymentRequest,PostureDeployment,OperationMetadata> updatePostureDeploymentOperationCallable()
      Updates the parameters of a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<PostureDeployment, OperationMetadata> future =
             securityPostureClient.updatePostureDeploymentOperationCallable().futureCall(request);
         // Do something.
         PostureDeployment response = future.get();
       }
       
    • updatePostureDeploymentCallable

      public final UnaryCallable<UpdatePostureDeploymentRequest,Operation> updatePostureDeploymentCallable()
      Updates the parameters of a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Operation> future =
             securityPostureClient.updatePostureDeploymentCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deletePostureDeploymentAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePostureDeploymentAsync(PostureDeploymentName name)
      Deletes a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deletePostureDeploymentAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePostureDeploymentAsync(String name)
      Deletes a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deletePostureDeploymentAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePostureDeploymentAsync(DeletePostureDeploymentRequest request)
      Deletes a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deletePostureDeploymentOperationCallable

      public final OperationCallable<DeletePostureDeploymentRequest,com.google.protobuf.Empty,OperationMetadata> deletePostureDeploymentOperationCallable()
      Deletes a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Empty, OperationMetadata> future =
             securityPostureClient.deletePostureDeploymentOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deletePostureDeploymentCallable

      public final UnaryCallable<DeletePostureDeploymentRequest,Operation> deletePostureDeploymentCallable()
      Deletes a single PostureDeployment.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Operation> future =
             securityPostureClient.deletePostureDeploymentCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listPostureTemplates

      PostureTemplates Lists all the PostureTemplates available to the user.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListPostureTemplatesRequest.
      Throws:
      ApiException - if the remote call fails
    • listPostureTemplates

      public final SecurityPostureClient.ListPostureTemplatesPagedResponse listPostureTemplates(String parent)
      PostureTemplates Lists all the PostureTemplates available to the user.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListPostureTemplatesRequest.
      Throws:
      ApiException - if the remote call fails
    • listPostureTemplates

      PostureTemplates Lists all the PostureTemplates available to the user.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listPostureTemplatesPagedCallable

      PostureTemplates Lists all the PostureTemplates available to the user.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<PostureTemplate> future =
             securityPostureClient.listPostureTemplatesPagedCallable().futureCall(request);
         // Do something.
         for (PostureTemplate element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listPostureTemplatesCallable

      public final UnaryCallable<ListPostureTemplatesRequest,ListPostureTemplatesResponse> listPostureTemplatesCallable()
      PostureTemplates Lists all the PostureTemplates available to the user.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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;
           }
         }
       }
       
    • getPostureTemplate

      public final PostureTemplate getPostureTemplate(PostureTemplateName name)
      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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getPostureTemplate

      public final PostureTemplate getPostureTemplate(String name)
      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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getPostureTemplate

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

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getPostureTemplateCallable

      public final UnaryCallable<GetPostureTemplateRequest,PostureTemplate> getPostureTemplateCallable()
      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:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<PostureTemplate> future =
             securityPostureClient.getPostureTemplateCallable().futureCall(request);
         // Do something.
         PostureTemplate response = future.get();
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Location> future =
             securityPostureClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getLocationCallable

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying 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<Location> future = securityPostureClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException