Class WorkloadManagerClient

java.lang.Object
com.google.cloud.workloadmanager.v1.WorkloadManagerClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class WorkloadManagerClient extends Object implements BackgroundResource
Service Description: The Workload Manager provides various tools to deploy, validate and observe your workloads running on Google Cloud.

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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
   EvaluationName name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]");
   Evaluation response = workloadManagerClient.getEvaluation(name);
 }
 

Note: close() needs to be called on the WorkloadManagerClient 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

ListEvaluations

Lists Evaluations in a given project and location.

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

  • listEvaluations(ListEvaluationsRequest request)

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

  • listEvaluations(LocationName parent)

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

  • listEvaluationsPagedCallable()

  • listEvaluationsCallable()

GetEvaluation

Gets details of a single Evaluation.

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

  • getEvaluation(GetEvaluationRequest request)

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

  • getEvaluation(EvaluationName name)

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

  • getEvaluationCallable()

CreateEvaluation

Creates a new Evaluation in a given project and location.

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

  • createEvaluationAsync(CreateEvaluationRequest request)

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

  • createEvaluationAsync(LocationName parent, Evaluation evaluation, String evaluationId)

  • createEvaluationAsync(String parent, Evaluation evaluation, String evaluationId)

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

  • createEvaluationOperationCallable()

  • createEvaluationCallable()

UpdateEvaluation

Updates the parameters of a single Evaluation.

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

  • updateEvaluationAsync(UpdateEvaluationRequest request)

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

  • updateEvaluationAsync(Evaluation evaluation, 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.

  • updateEvaluationOperationCallable()

  • updateEvaluationCallable()

DeleteEvaluation

Deletes a single Evaluation.

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

  • deleteEvaluationAsync(DeleteEvaluationRequest request)

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

  • deleteEvaluationAsync(EvaluationName name)

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

  • deleteEvaluationOperationCallable()

  • deleteEvaluationCallable()

ListExecutions

Lists Executions in a given project and location.

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

  • listExecutions(ListExecutionsRequest request)

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

  • listExecutions(EvaluationName parent)

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

  • listExecutionsPagedCallable()

  • listExecutionsCallable()

GetExecution

Gets details of a single Execution.

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

  • getExecution(GetExecutionRequest request)

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

  • getExecution(ExecutionName name)

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

  • getExecutionCallable()

RunEvaluation

Creates a new Execution in a given project and location.

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

  • runEvaluationAsync(RunEvaluationRequest request)

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

  • runEvaluationAsync(EvaluationName name, Execution execution, String executionId)

  • runEvaluationAsync(String name, Execution execution, String executionId)

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

  • runEvaluationOperationCallable()

  • runEvaluationCallable()

DeleteExecution

Deletes a single Execution.

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

  • deleteExecutionAsync(DeleteExecutionRequest request)

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

  • deleteExecutionAsync(ExecutionName name)

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

  • deleteExecutionOperationCallable()

  • deleteExecutionCallable()

ListExecutionResults

Lists the result of a single evaluation.

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

  • listExecutionResults(ListExecutionResultsRequest request)

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

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

  • listExecutionResultsPagedCallable()

  • listExecutionResultsCallable()

ListRules

Lists rules in a given project.

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

  • listRules(ListRulesRequest request)

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

  • listRules(LocationName parent)

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

  • listRulesCallable()

ListScannedResources

List all scanned resources for a single Execution.

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

  • listScannedResources(ListScannedResourcesRequest request)

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

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

  • listScannedResourcesPagedCallable()

  • listScannedResourcesCallable()

ListLocations

Lists information about the supported locations for this service.This method can be called in two ways:

* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.

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 WorkloadManagerSettings 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
 WorkloadManagerSettings workloadManagerSettings =
     WorkloadManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 WorkloadManagerClient workloadManagerClient =
     WorkloadManagerClient.create(workloadManagerSettings);
 

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
 WorkloadManagerSettings workloadManagerSettings =
     WorkloadManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 WorkloadManagerClient workloadManagerClient =
     WorkloadManagerClient.create(workloadManagerSettings);
 

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
 WorkloadManagerSettings workloadManagerSettings =
     WorkloadManagerSettings.newHttpJsonBuilder().build();
 WorkloadManagerClient workloadManagerClient =
     WorkloadManagerClient.create(workloadManagerSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

  • Constructor Details

    • WorkloadManagerClient

      protected WorkloadManagerClient(WorkloadManagerSettings settings) throws IOException
      Constructs an instance of WorkloadManagerClient, 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
    • WorkloadManagerClient

      protected WorkloadManagerClient(WorkloadManagerStub stub)
  • Method Details

    • create

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

      public static final WorkloadManagerClient create(WorkloadManagerSettings settings) throws IOException
      Constructs an instance of WorkloadManagerClient, 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 WorkloadManagerClient create(WorkloadManagerStub stub)
      Constructs an instance of WorkloadManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(WorkloadManagerSettings).
    • getSettings

      public final WorkloadManagerSettings getSettings()
    • getStub

      public WorkloadManagerStub 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.
    • listEvaluations

      Lists Evaluations 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (Evaluation element : workloadManagerClient.listEvaluations(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListEvaluationsRequest.
      Throws:
      ApiException - if the remote call fails
    • listEvaluations

      public final WorkloadManagerClient.ListEvaluationsPagedResponse listEvaluations(String parent)
      Lists Evaluations 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (Evaluation element : workloadManagerClient.listEvaluations(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent value for ListEvaluationsRequest.
      Throws:
      ApiException - if the remote call fails
    • listEvaluations

      Lists Evaluations 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListEvaluationsRequest request =
             ListEvaluationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Evaluation element : workloadManagerClient.listEvaluations(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
    • listEvaluationsPagedCallable

      Lists Evaluations 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListEvaluationsRequest request =
             ListEvaluationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Evaluation> future =
             workloadManagerClient.listEvaluationsPagedCallable().futureCall(request);
         // Do something.
         for (Evaluation element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listEvaluationsCallable

      public final UnaryCallable<ListEvaluationsRequest,ListEvaluationsResponse> listEvaluationsCallable()
      Lists Evaluations 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListEvaluationsRequest request =
             ListEvaluationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListEvaluationsResponse response =
               workloadManagerClient.listEvaluationsCallable().call(request);
           for (Evaluation element : response.getEvaluationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getEvaluation

      public final Evaluation getEvaluation(EvaluationName name)
      Gets details of a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         EvaluationName name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]");
         Evaluation response = workloadManagerClient.getEvaluation(name);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getEvaluation

      public final Evaluation getEvaluation(String name)
      Gets details of a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString();
         Evaluation response = workloadManagerClient.getEvaluation(name);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getEvaluation

      public final Evaluation getEvaluation(GetEvaluationRequest request)
      Gets details of a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         GetEvaluationRequest request =
             GetEvaluationRequest.newBuilder()
                 .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .build();
         Evaluation response = workloadManagerClient.getEvaluation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getEvaluationCallable

      public final UnaryCallable<GetEvaluationRequest,Evaluation> getEvaluationCallable()
      Gets details of a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         GetEvaluationRequest request =
             GetEvaluationRequest.newBuilder()
                 .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .build();
         ApiFuture<Evaluation> future =
             workloadManagerClient.getEvaluationCallable().futureCall(request);
         // Do something.
         Evaluation response = future.get();
       }
       
    • createEvaluationAsync

      public final OperationFuture<Evaluation,OperationMetadata> createEvaluationAsync(LocationName parent, Evaluation evaluation, String evaluationId)
      Creates a new Evaluation 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         Evaluation evaluation = Evaluation.newBuilder().build();
         String evaluationId = "evaluationId407318903";
         Evaluation response =
             workloadManagerClient.createEvaluationAsync(parent, evaluation, evaluationId).get();
       }
       
      Parameters:
      parent - Required. The resource prefix of the evaluation location using the form: `projects/{project_id}/locations/{location_id}`.
      evaluation - Required. The resource being created.
      evaluationId - Required. Id of the requesting object.
      Throws:
      ApiException - if the remote call fails
    • createEvaluationAsync

      public final OperationFuture<Evaluation,OperationMetadata> createEvaluationAsync(String parent, Evaluation evaluation, String evaluationId)
      Creates a new Evaluation 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         Evaluation evaluation = Evaluation.newBuilder().build();
         String evaluationId = "evaluationId407318903";
         Evaluation response =
             workloadManagerClient.createEvaluationAsync(parent, evaluation, evaluationId).get();
       }
       
      Parameters:
      parent - Required. The resource prefix of the evaluation location using the form: `projects/{project_id}/locations/{location_id}`.
      evaluation - Required. The resource being created.
      evaluationId - Required. Id of the requesting object.
      Throws:
      ApiException - if the remote call fails
    • createEvaluationAsync

      public final OperationFuture<Evaluation,OperationMetadata> createEvaluationAsync(CreateEvaluationRequest request)
      Creates a new Evaluation 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         CreateEvaluationRequest request =
             CreateEvaluationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setEvaluationId("evaluationId407318903")
                 .setEvaluation(Evaluation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Evaluation response = workloadManagerClient.createEvaluationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createEvaluationOperationCallable

      public final OperationCallable<CreateEvaluationRequest,Evaluation,OperationMetadata> createEvaluationOperationCallable()
      Creates a new Evaluation 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         CreateEvaluationRequest request =
             CreateEvaluationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setEvaluationId("evaluationId407318903")
                 .setEvaluation(Evaluation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Evaluation, OperationMetadata> future =
             workloadManagerClient.createEvaluationOperationCallable().futureCall(request);
         // Do something.
         Evaluation response = future.get();
       }
       
    • createEvaluationCallable

      public final UnaryCallable<CreateEvaluationRequest,Operation> createEvaluationCallable()
      Creates a new Evaluation 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         CreateEvaluationRequest request =
             CreateEvaluationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setEvaluationId("evaluationId407318903")
                 .setEvaluation(Evaluation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             workloadManagerClient.createEvaluationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateEvaluationAsync

      public final OperationFuture<Evaluation,OperationMetadata> updateEvaluationAsync(Evaluation evaluation, com.google.protobuf.FieldMask updateMask)
      Updates the parameters of a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         Evaluation evaluation = Evaluation.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Evaluation response =
             workloadManagerClient.updateEvaluationAsync(evaluation, updateMask).get();
       }
       
      Parameters:
      evaluation - Required. The resource being updated.
      updateMask - Required. Field mask is used to specify the fields to be overwritten in the Evaluation 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.
      Throws:
      ApiException - if the remote call fails
    • updateEvaluationAsync

      public final OperationFuture<Evaluation,OperationMetadata> updateEvaluationAsync(UpdateEvaluationRequest request)
      Updates the parameters of a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         UpdateEvaluationRequest request =
             UpdateEvaluationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setEvaluation(Evaluation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Evaluation response = workloadManagerClient.updateEvaluationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateEvaluationOperationCallable

      public final OperationCallable<UpdateEvaluationRequest,Evaluation,OperationMetadata> updateEvaluationOperationCallable()
      Updates the parameters of a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         UpdateEvaluationRequest request =
             UpdateEvaluationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setEvaluation(Evaluation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Evaluation, OperationMetadata> future =
             workloadManagerClient.updateEvaluationOperationCallable().futureCall(request);
         // Do something.
         Evaluation response = future.get();
       }
       
    • updateEvaluationCallable

      public final UnaryCallable<UpdateEvaluationRequest,Operation> updateEvaluationCallable()
      Updates the parameters of a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         UpdateEvaluationRequest request =
             UpdateEvaluationRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setEvaluation(Evaluation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             workloadManagerClient.updateEvaluationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteEvaluationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEvaluationAsync(EvaluationName name)
      Deletes a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         EvaluationName name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]");
         workloadManagerClient.deleteEvaluationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deleteEvaluationAsync

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

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString();
         workloadManagerClient.deleteEvaluationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deleteEvaluationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteEvaluationAsync(DeleteEvaluationRequest request)
      Deletes a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         DeleteEvaluationRequest request =
             DeleteEvaluationRequest.newBuilder()
                 .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setRequestId("requestId693933066")
                 .setForce(true)
                 .build();
         workloadManagerClient.deleteEvaluationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteEvaluationOperationCallable

      public final OperationCallable<DeleteEvaluationRequest,com.google.protobuf.Empty,OperationMetadata> deleteEvaluationOperationCallable()
      Deletes a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         DeleteEvaluationRequest request =
             DeleteEvaluationRequest.newBuilder()
                 .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setRequestId("requestId693933066")
                 .setForce(true)
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             workloadManagerClient.deleteEvaluationOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteEvaluationCallable

      public final UnaryCallable<DeleteEvaluationRequest,Operation> deleteEvaluationCallable()
      Deletes a single Evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         DeleteEvaluationRequest request =
             DeleteEvaluationRequest.newBuilder()
                 .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setRequestId("requestId693933066")
                 .setForce(true)
                 .build();
         ApiFuture<Operation> future =
             workloadManagerClient.deleteEvaluationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listExecutions

      Lists Executions 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         EvaluationName parent = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]");
         for (Execution element : workloadManagerClient.listExecutions(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource prefix of the Execution using the form: `projects/{project}/locations/{location}/evaluations/{evaluation}`.
      Throws:
      ApiException - if the remote call fails
    • listExecutions

      public final WorkloadManagerClient.ListExecutionsPagedResponse listExecutions(String parent)
      Lists Executions 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String parent = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString();
         for (Execution element : workloadManagerClient.listExecutions(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The resource prefix of the Execution using the form: `projects/{project}/locations/{location}/evaluations/{evaluation}`.
      Throws:
      ApiException - if the remote call fails
    • listExecutions

      Lists Executions 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListExecutionsRequest request =
             ListExecutionsRequest.newBuilder()
                 .setParent(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Execution element : workloadManagerClient.listExecutions(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
    • listExecutionsPagedCallable

      Lists Executions 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListExecutionsRequest request =
             ListExecutionsRequest.newBuilder()
                 .setParent(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Execution> future =
             workloadManagerClient.listExecutionsPagedCallable().futureCall(request);
         // Do something.
         for (Execution element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listExecutionsCallable

      public final UnaryCallable<ListExecutionsRequest,ListExecutionsResponse> listExecutionsCallable()
      Lists Executions 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListExecutionsRequest request =
             ListExecutionsRequest.newBuilder()
                 .setParent(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListExecutionsResponse response =
               workloadManagerClient.listExecutionsCallable().call(request);
           for (Execution element : response.getExecutionsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getExecution

      public final Execution getExecution(ExecutionName name)
      Gets details of a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ExecutionName name =
             ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]");
         Execution response = workloadManagerClient.getExecution(name);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getExecution

      public final Execution getExecution(String name)
      Gets details of a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String name =
             ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]").toString();
         Execution response = workloadManagerClient.getExecution(name);
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • getExecution

      public final Execution getExecution(GetExecutionRequest request)
      Gets details of a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         GetExecutionRequest request =
             GetExecutionRequest.newBuilder()
                 .setName(
                     ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]")
                         .toString())
                 .build();
         Execution response = workloadManagerClient.getExecution(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getExecutionCallable

      public final UnaryCallable<GetExecutionRequest,Execution> getExecutionCallable()
      Gets details of a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         GetExecutionRequest request =
             GetExecutionRequest.newBuilder()
                 .setName(
                     ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]")
                         .toString())
                 .build();
         ApiFuture<Execution> future =
             workloadManagerClient.getExecutionCallable().futureCall(request);
         // Do something.
         Execution response = future.get();
       }
       
    • runEvaluationAsync

      public final OperationFuture<Execution,OperationMetadata> runEvaluationAsync(EvaluationName name, Execution execution, String executionId)
      Creates a new Execution 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         EvaluationName name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]");
         Execution execution = Execution.newBuilder().build();
         String executionId = "executionId-454906285";
         Execution response =
             workloadManagerClient.runEvaluationAsync(name, execution, executionId).get();
       }
       
      Parameters:
      name - Required. The resource name of the Evaluation using the form: `projects/{project}/locations/{location}/evaluations/{evaluation}`.
      execution - Required. The resource being created.
      executionId - Required. ID of the execution which will be created.
      Throws:
      ApiException - if the remote call fails
    • runEvaluationAsync

      public final OperationFuture<Execution,OperationMetadata> runEvaluationAsync(String name, Execution execution, String executionId)
      Creates a new Execution 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String name = EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString();
         Execution execution = Execution.newBuilder().build();
         String executionId = "executionId-454906285";
         Execution response =
             workloadManagerClient.runEvaluationAsync(name, execution, executionId).get();
       }
       
      Parameters:
      name - Required. The resource name of the Evaluation using the form: `projects/{project}/locations/{location}/evaluations/{evaluation}`.
      execution - Required. The resource being created.
      executionId - Required. ID of the execution which will be created.
      Throws:
      ApiException - if the remote call fails
    • runEvaluationAsync

      public final OperationFuture<Execution,OperationMetadata> runEvaluationAsync(RunEvaluationRequest request)
      Creates a new Execution 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         RunEvaluationRequest request =
             RunEvaluationRequest.newBuilder()
                 .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setExecutionId("executionId-454906285")
                 .setExecution(Execution.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Execution response = workloadManagerClient.runEvaluationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • runEvaluationOperationCallable

      public final OperationCallable<RunEvaluationRequest,Execution,OperationMetadata> runEvaluationOperationCallable()
      Creates a new Execution 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         RunEvaluationRequest request =
             RunEvaluationRequest.newBuilder()
                 .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setExecutionId("executionId-454906285")
                 .setExecution(Execution.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Execution, OperationMetadata> future =
             workloadManagerClient.runEvaluationOperationCallable().futureCall(request);
         // Do something.
         Execution response = future.get();
       }
       
    • runEvaluationCallable

      public final UnaryCallable<RunEvaluationRequest,Operation> runEvaluationCallable()
      Creates a new Execution 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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         RunEvaluationRequest request =
             RunEvaluationRequest.newBuilder()
                 .setName(EvaluationName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]").toString())
                 .setExecutionId("executionId-454906285")
                 .setExecution(Execution.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             workloadManagerClient.runEvaluationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteExecutionAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(ExecutionName name)
      Deletes a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ExecutionName name =
             ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]");
         workloadManagerClient.deleteExecutionAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deleteExecutionAsync

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

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String name =
             ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]").toString();
         workloadManagerClient.deleteExecutionAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deleteExecutionAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteExecutionAsync(DeleteExecutionRequest request)
      Deletes a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         DeleteExecutionRequest request =
             DeleteExecutionRequest.newBuilder()
                 .setName(
                     ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         workloadManagerClient.deleteExecutionAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteExecutionOperationCallable

      public final OperationCallable<DeleteExecutionRequest,com.google.protobuf.Empty,OperationMetadata> deleteExecutionOperationCallable()
      Deletes a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         DeleteExecutionRequest request =
             DeleteExecutionRequest.newBuilder()
                 .setName(
                     ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             workloadManagerClient.deleteExecutionOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteExecutionCallable

      public final UnaryCallable<DeleteExecutionRequest,Operation> deleteExecutionCallable()
      Deletes a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         DeleteExecutionRequest request =
             DeleteExecutionRequest.newBuilder()
                 .setName(
                     ExecutionName.of("[PROJECT]", "[LOCATION]", "[EVALUATION]", "[EXECUTION]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             workloadManagerClient.deleteExecutionCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listExecutionResults

      public final WorkloadManagerClient.ListExecutionResultsPagedResponse listExecutionResults(String parent)
      Lists the result of a single evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String parent = "parent-995424086";
         for (ExecutionResult element :
             workloadManagerClient.listExecutionResults(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The execution results. Format: {parent}/evaluations/*/executions/*/results.
      Throws:
      ApiException - if the remote call fails
    • listExecutionResults

      Lists the result of a single evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListExecutionResultsRequest request =
             ListExecutionResultsRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         for (ExecutionResult element :
             workloadManagerClient.listExecutionResults(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
    • listExecutionResultsPagedCallable

      Lists the result of a single evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListExecutionResultsRequest request =
             ListExecutionResultsRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         ApiFuture<ExecutionResult> future =
             workloadManagerClient.listExecutionResultsPagedCallable().futureCall(request);
         // Do something.
         for (ExecutionResult element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listExecutionResultsCallable

      public final UnaryCallable<ListExecutionResultsRequest,ListExecutionResultsResponse> listExecutionResultsCallable()
      Lists the result of a single evaluation.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListExecutionResultsRequest request =
             ListExecutionResultsRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         while (true) {
           ListExecutionResultsResponse response =
               workloadManagerClient.listExecutionResultsCallable().call(request);
           for (ExecutionResult element : response.getExecutionResultsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • listRules

      public final ListRulesResponse listRules(LocationName parent)
      Lists rules in a given project.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ListRulesResponse response = workloadManagerClient.listRules(parent);
       }
       
      Parameters:
      parent - Required. The [project] on which to execute the request. The format is: projects/{project_id}/locations/{location} Currently, the pre-defined rules are global available to all projects and all regions.
      Throws:
      ApiException - if the remote call fails
    • listRules

      public final ListRulesResponse listRules(String parent)
      Lists rules in a given project.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ListRulesResponse response = workloadManagerClient.listRules(parent);
       }
       
      Parameters:
      parent - Required. The [project] on which to execute the request. The format is: projects/{project_id}/locations/{location} Currently, the pre-defined rules are global available to all projects and all regions.
      Throws:
      ApiException - if the remote call fails
    • listRules

      public final ListRulesResponse listRules(ListRulesRequest request)
      Lists rules in a given project.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListRulesRequest request =
             ListRulesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setCustomRulesBucket("customRulesBucket-888019568")
                 .build();
         ListRulesResponse response = workloadManagerClient.listRules(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listRulesCallable

      public final UnaryCallable<ListRulesRequest,ListRulesResponse> listRulesCallable()
      Lists rules in a given project.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListRulesRequest request =
             ListRulesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setCustomRulesBucket("customRulesBucket-888019568")
                 .build();
         ApiFuture<ListRulesResponse> future =
             workloadManagerClient.listRulesCallable().futureCall(request);
         // Do something.
         ListRulesResponse response = future.get();
       }
       
    • listScannedResources

      public final WorkloadManagerClient.ListScannedResourcesPagedResponse listScannedResources(String parent)
      List all scanned resources for a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         String parent = "parent-995424086";
         for (ScannedResource element :
             workloadManagerClient.listScannedResources(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Parent for ListScannedResourcesRequest.
      Throws:
      ApiException - if the remote call fails
    • listScannedResources

      List all scanned resources for a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListScannedResourcesRequest request =
             ListScannedResourcesRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setRule("rule3512060")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (ScannedResource element :
             workloadManagerClient.listScannedResources(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
    • listScannedResourcesPagedCallable

      List all scanned resources for a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListScannedResourcesRequest request =
             ListScannedResourcesRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setRule("rule3512060")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<ScannedResource> future =
             workloadManagerClient.listScannedResourcesPagedCallable().futureCall(request);
         // Do something.
         for (ScannedResource element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listScannedResourcesCallable

      public final UnaryCallable<ListScannedResourcesRequest,ListScannedResourcesResponse> listScannedResourcesCallable()
      List all scanned resources for a single Execution.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListScannedResourcesRequest request =
             ListScannedResourcesRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setRule("rule3512060")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListScannedResourcesResponse response =
               workloadManagerClient.listScannedResourcesCallable().call(request);
           for (ScannedResource element : response.getScannedResourcesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • listLocations

      Lists information about the supported locations for this service.This method can be called in two ways:

      * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : workloadManagerClient.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.This method can be called in two ways:

      * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             workloadManagerClient.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.This method can be called in two ways:

      * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.

      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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response =
               workloadManagerClient.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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = workloadManagerClient.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 (WorkloadManagerClient workloadManagerClient = WorkloadManagerClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future = workloadManagerClient.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