Class StorageTransferServiceClient

java.lang.Object
com.google.storagetransfer.v1.proto.StorageTransferServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class StorageTransferServiceClient extends Object implements BackgroundResource
Service Description: Storage Transfer Service and its protos. Transfers data between between Google Cloud Storage buckets or from a data source external to Google to a Cloud Storage bucket.

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 (StorageTransferServiceClient storageTransferServiceClient =
     StorageTransferServiceClient.create()) {
   TransferProto.GetGoogleServiceAccountRequest request =
       TransferProto.GetGoogleServiceAccountRequest.newBuilder()
           .setProjectId("projectId-894832108")
           .build();
   TransferTypes.GoogleServiceAccount response =
       storageTransferServiceClient.getGoogleServiceAccount(request);
 }
 

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

GetGoogleServiceAccount

Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.

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

  • getGoogleServiceAccount(TransferProto.GetGoogleServiceAccountRequest request)

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

  • getGoogleServiceAccountCallable()

CreateTransferJob

Creates a transfer job that runs periodically.

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

  • createTransferJob(TransferProto.CreateTransferJobRequest request)

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

  • createTransferJobCallable()

UpdateTransferJob

Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already.

**Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).

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

  • updateTransferJob(TransferProto.UpdateTransferJobRequest request)

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

  • updateTransferJobCallable()

GetTransferJob

Gets a transfer job.

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

  • getTransferJob(TransferProto.GetTransferJobRequest request)

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

  • getTransferJobCallable()

ListTransferJobs

Lists transfer jobs.

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

  • listTransferJobs(TransferProto.ListTransferJobsRequest request)

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

  • listTransferJobsPagedCallable()

  • listTransferJobsCallable()

PauseTransferOperation

Pauses a transfer operation.

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

  • pauseTransferOperation(TransferProto.PauseTransferOperationRequest request)

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

  • pauseTransferOperationCallable()

ResumeTransferOperation

Resumes a transfer operation that is paused.

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

  • resumeTransferOperation(TransferProto.ResumeTransferOperationRequest request)

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

  • resumeTransferOperationCallable()

RunTransferJob

Starts a new operation for the specified transfer job. A `TransferJob` has a maximum of one active `TransferOperation`. If this method is called while a `TransferOperation` is active, an error is returned.

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

  • runTransferJobAsync(TransferProto.RunTransferJobRequest request)

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

  • runTransferJobOperationCallable()

  • runTransferJobCallable()

DeleteTransferJob

Deletes a transfer job. Deleting a transfer job sets its status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].

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

  • deleteTransferJob(TransferProto.DeleteTransferJobRequest request)

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

  • deleteTransferJobCallable()

CreateAgentPool

Creates an agent pool resource.

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

  • createAgentPool(TransferProto.CreateAgentPoolRequest request)

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

  • createAgentPool(String projectId, TransferTypes.AgentPool agentPool, String agentPoolId)

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

  • createAgentPoolCallable()

UpdateAgentPool

Updates an existing agent pool resource.

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

  • updateAgentPool(TransferProto.UpdateAgentPoolRequest request)

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

  • updateAgentPool(TransferTypes.AgentPool agentPool, 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.

  • updateAgentPoolCallable()

GetAgentPool

Gets an agent pool.

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

  • getAgentPool(TransferProto.GetAgentPoolRequest request)

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

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

  • getAgentPoolCallable()

ListAgentPools

Lists agent pools.

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

  • listAgentPools(TransferProto.ListAgentPoolsRequest request)

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

  • listAgentPools(String projectId)

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

  • listAgentPoolsPagedCallable()

  • listAgentPoolsCallable()

DeleteAgentPool

Deletes an agent pool.

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

  • deleteAgentPool(TransferProto.DeleteAgentPoolRequest request)

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

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

  • deleteAgentPoolCallable()

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 StorageTransferServiceSettings 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
 StorageTransferServiceSettings storageTransferServiceSettings =
     StorageTransferServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 StorageTransferServiceClient storageTransferServiceClient =
     StorageTransferServiceClient.create(storageTransferServiceSettings);
 

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
 StorageTransferServiceSettings storageTransferServiceSettings =
     StorageTransferServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 StorageTransferServiceClient storageTransferServiceClient =
     StorageTransferServiceClient.create(storageTransferServiceSettings);
 

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
 StorageTransferServiceSettings storageTransferServiceSettings =
     StorageTransferServiceSettings.newHttpJsonBuilder().build();
 StorageTransferServiceClient storageTransferServiceClient =
     StorageTransferServiceClient.create(storageTransferServiceSettings);
 

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

  • Constructor Details

    • StorageTransferServiceClient

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

      protected StorageTransferServiceClient(StorageTransferServiceStub stub)
  • Method Details

    • create

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

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

      public final StorageTransferServiceSettings getSettings()
    • getStub

      public StorageTransferServiceStub 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.
    • getGoogleServiceAccount

      Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer 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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.GetGoogleServiceAccountRequest request =
             TransferProto.GetGoogleServiceAccountRequest.newBuilder()
                 .setProjectId("projectId-894832108")
                 .build();
         TransferTypes.GoogleServiceAccount response =
             storageTransferServiceClient.getGoogleServiceAccount(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getGoogleServiceAccountCallable

      Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer 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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.GetGoogleServiceAccountRequest request =
             TransferProto.GetGoogleServiceAccountRequest.newBuilder()
                 .setProjectId("projectId-894832108")
                 .build();
         ApiFuture<TransferTypes.GoogleServiceAccount> future =
             storageTransferServiceClient.getGoogleServiceAccountCallable().futureCall(request);
         // Do something.
         TransferTypes.GoogleServiceAccount response = future.get();
       }
       
    • createTransferJob

      public final TransferTypes.TransferJob createTransferJob(TransferProto.CreateTransferJobRequest request)
      Creates a transfer job that runs periodically.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.CreateTransferJobRequest request =
             TransferProto.CreateTransferJobRequest.newBuilder()
                 .setTransferJob(TransferTypes.TransferJob.newBuilder().build())
                 .build();
         TransferTypes.TransferJob response = storageTransferServiceClient.createTransferJob(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createTransferJobCallable

      Creates a transfer job that runs periodically.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.CreateTransferJobRequest request =
             TransferProto.CreateTransferJobRequest.newBuilder()
                 .setTransferJob(TransferTypes.TransferJob.newBuilder().build())
                 .build();
         ApiFuture<TransferTypes.TransferJob> future =
             storageTransferServiceClient.createTransferJobCallable().futureCall(request);
         // Do something.
         TransferTypes.TransferJob response = future.get();
       }
       
    • updateTransferJob

      public final TransferTypes.TransferJob updateTransferJob(TransferProto.UpdateTransferJobRequest request)
      Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already.

      **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.UpdateTransferJobRequest request =
             TransferProto.UpdateTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .setTransferJob(TransferTypes.TransferJob.newBuilder().build())
                 .setUpdateTransferJobFieldMask(FieldMask.newBuilder().build())
                 .build();
         TransferTypes.TransferJob response = storageTransferServiceClient.updateTransferJob(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateTransferJobCallable

      Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already.

      **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified using this RPC (for example, to set a job's status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED], [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.UpdateTransferJobRequest request =
             TransferProto.UpdateTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .setTransferJob(TransferTypes.TransferJob.newBuilder().build())
                 .setUpdateTransferJobFieldMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<TransferTypes.TransferJob> future =
             storageTransferServiceClient.updateTransferJobCallable().futureCall(request);
         // Do something.
         TransferTypes.TransferJob response = future.get();
       }
       
    • getTransferJob

      public final TransferTypes.TransferJob getTransferJob(TransferProto.GetTransferJobRequest request)
      Gets a transfer job.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.GetTransferJobRequest request =
             TransferProto.GetTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .build();
         TransferTypes.TransferJob response = storageTransferServiceClient.getTransferJob(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getTransferJobCallable

      Gets a transfer job.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.GetTransferJobRequest request =
             TransferProto.GetTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .build();
         ApiFuture<TransferTypes.TransferJob> future =
             storageTransferServiceClient.getTransferJobCallable().futureCall(request);
         // Do something.
         TransferTypes.TransferJob response = future.get();
       }
       
    • listTransferJobs

      Lists transfer jobs.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.ListTransferJobsRequest request =
             TransferProto.ListTransferJobsRequest.newBuilder()
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (TransferTypes.TransferJob element :
             storageTransferServiceClient.listTransferJobs(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
    • listTransferJobsPagedCallable

      Lists transfer jobs.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.ListTransferJobsRequest request =
             TransferProto.ListTransferJobsRequest.newBuilder()
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<TransferTypes.TransferJob> future =
             storageTransferServiceClient.listTransferJobsPagedCallable().futureCall(request);
         // Do something.
         for (TransferTypes.TransferJob element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listTransferJobsCallable

      Lists transfer jobs.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.ListTransferJobsRequest request =
             TransferProto.ListTransferJobsRequest.newBuilder()
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           TransferProto.ListTransferJobsResponse response =
               storageTransferServiceClient.listTransferJobsCallable().call(request);
           for (TransferTypes.TransferJob element : response.getTransferJobsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • pauseTransferOperation

      public final void pauseTransferOperation(TransferProto.PauseTransferOperationRequest request)
      Pauses a transfer operation.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.PauseTransferOperationRequest request =
             TransferProto.PauseTransferOperationRequest.newBuilder().setName("name3373707").build();
         storageTransferServiceClient.pauseTransferOperation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • pauseTransferOperationCallable

      public final UnaryCallable<TransferProto.PauseTransferOperationRequest,com.google.protobuf.Empty> pauseTransferOperationCallable()
      Pauses a transfer operation.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.PauseTransferOperationRequest request =
             TransferProto.PauseTransferOperationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Empty> future =
             storageTransferServiceClient.pauseTransferOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • resumeTransferOperation

      public final void resumeTransferOperation(TransferProto.ResumeTransferOperationRequest request)
      Resumes a transfer operation that is paused.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.ResumeTransferOperationRequest request =
             TransferProto.ResumeTransferOperationRequest.newBuilder().setName("name3373707").build();
         storageTransferServiceClient.resumeTransferOperation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • resumeTransferOperationCallable

      public final UnaryCallable<TransferProto.ResumeTransferOperationRequest,com.google.protobuf.Empty> resumeTransferOperationCallable()
      Resumes a transfer operation that is paused.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.ResumeTransferOperationRequest request =
             TransferProto.ResumeTransferOperationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Empty> future =
             storageTransferServiceClient.resumeTransferOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • runTransferJobAsync

      public final OperationFuture<com.google.protobuf.Empty,TransferTypes.TransferOperation> runTransferJobAsync(TransferProto.RunTransferJobRequest request)
      Starts a new operation for the specified transfer job. A `TransferJob` has a maximum of one active `TransferOperation`. If this method is called while a `TransferOperation` is active, an error 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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.RunTransferJobRequest request =
             TransferProto.RunTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .build();
         storageTransferServiceClient.runTransferJobAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • runTransferJobOperationCallable

      public final OperationCallable<TransferProto.RunTransferJobRequest,com.google.protobuf.Empty,TransferTypes.TransferOperation> runTransferJobOperationCallable()
      Starts a new operation for the specified transfer job. A `TransferJob` has a maximum of one active `TransferOperation`. If this method is called while a `TransferOperation` is active, an error 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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.RunTransferJobRequest request =
             TransferProto.RunTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .build();
         OperationFuture<Empty, TransferTypes.TransferOperation> future =
             storageTransferServiceClient.runTransferJobOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • runTransferJobCallable

      public final UnaryCallable<TransferProto.RunTransferJobRequest,Operation> runTransferJobCallable()
      Starts a new operation for the specified transfer job. A `TransferJob` has a maximum of one active `TransferOperation`. If this method is called while a `TransferOperation` is active, an error 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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.RunTransferJobRequest request =
             TransferProto.RunTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .build();
         ApiFuture<Operation> future =
             storageTransferServiceClient.runTransferJobCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteTransferJob

      public final void deleteTransferJob(TransferProto.DeleteTransferJobRequest request)
      Deletes a transfer job. Deleting a transfer job sets its status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.DeleteTransferJobRequest request =
             TransferProto.DeleteTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .build();
         storageTransferServiceClient.deleteTransferJob(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteTransferJobCallable

      public final UnaryCallable<TransferProto.DeleteTransferJobRequest,com.google.protobuf.Empty> deleteTransferJobCallable()
      Deletes a transfer job. Deleting a transfer job sets its status to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.DeleteTransferJobRequest request =
             TransferProto.DeleteTransferJobRequest.newBuilder()
                 .setJobName("jobName-1438096408")
                 .setProjectId("projectId-894832108")
                 .build();
         ApiFuture<Empty> future =
             storageTransferServiceClient.deleteTransferJobCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • createAgentPool

      public final TransferTypes.AgentPool createAgentPool(String projectId, TransferTypes.AgentPool agentPool, String agentPoolId)
      Creates an agent pool resource.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         String projectId = "projectId-894832108";
         TransferTypes.AgentPool agentPool = TransferTypes.AgentPool.newBuilder().build();
         String agentPoolId = "agentPoolId1562124732";
         TransferTypes.AgentPool response =
             storageTransferServiceClient.createAgentPool(projectId, agentPool, agentPoolId);
       }
       
      Parameters:
      projectId - Required. The ID of the Google Cloud project that owns the agent pool.
      agentPool - Required. The agent pool to create.
      agentPoolId - Required. The ID of the agent pool to create.

      The `agent_pool_id` must meet the following requirements:

      • Length of 128 characters or less.
      • Not start with the string `goog`.
      • Start with a lowercase ASCII character, followed by: * Zero or more: lowercase Latin alphabet characters, numerals, hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`). * One or more numerals or lowercase ASCII characters.

      As expressed by the regular expression: `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`.

      Throws:
      ApiException - if the remote call fails
    • createAgentPool

      public final TransferTypes.AgentPool createAgentPool(TransferProto.CreateAgentPoolRequest request)
      Creates an agent pool resource.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.CreateAgentPoolRequest request =
             TransferProto.CreateAgentPoolRequest.newBuilder()
                 .setProjectId("projectId-894832108")
                 .setAgentPool(TransferTypes.AgentPool.newBuilder().build())
                 .setAgentPoolId("agentPoolId1562124732")
                 .build();
         TransferTypes.AgentPool response = storageTransferServiceClient.createAgentPool(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createAgentPoolCallable

      Creates an agent pool resource.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.CreateAgentPoolRequest request =
             TransferProto.CreateAgentPoolRequest.newBuilder()
                 .setProjectId("projectId-894832108")
                 .setAgentPool(TransferTypes.AgentPool.newBuilder().build())
                 .setAgentPoolId("agentPoolId1562124732")
                 .build();
         ApiFuture<TransferTypes.AgentPool> future =
             storageTransferServiceClient.createAgentPoolCallable().futureCall(request);
         // Do something.
         TransferTypes.AgentPool response = future.get();
       }
       
    • updateAgentPool

      public final TransferTypes.AgentPool updateAgentPool(TransferTypes.AgentPool agentPool, com.google.protobuf.FieldMask updateMask)
      Updates an existing agent pool resource.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferTypes.AgentPool agentPool = TransferTypes.AgentPool.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         TransferTypes.AgentPool response =
             storageTransferServiceClient.updateAgentPool(agentPool, updateMask);
       }
       
      Parameters:
      agentPool - Required. The agent pool to update. `agent_pool` is expected to specify following fields:
      • [name][google.storagetransfer.v1.AgentPool.name]
      • [display_name][google.storagetransfer.v1.AgentPool.display_name]
      • [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit] An `UpdateAgentPoolRequest` with any other fields is rejected with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
      updateMask - The [field mask] (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) of the fields in `agentPool` to update in this request. The following `agentPool` fields can be updated:
      • [display_name][google.storagetransfer.v1.AgentPool.display_name]
      • [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit]
      Throws:
      ApiException - if the remote call fails
    • updateAgentPool

      public final TransferTypes.AgentPool updateAgentPool(TransferProto.UpdateAgentPoolRequest request)
      Updates an existing agent pool resource.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.UpdateAgentPoolRequest request =
             TransferProto.UpdateAgentPoolRequest.newBuilder()
                 .setAgentPool(TransferTypes.AgentPool.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         TransferTypes.AgentPool response = storageTransferServiceClient.updateAgentPool(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateAgentPoolCallable

      Updates an existing agent pool resource.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.UpdateAgentPoolRequest request =
             TransferProto.UpdateAgentPoolRequest.newBuilder()
                 .setAgentPool(TransferTypes.AgentPool.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<TransferTypes.AgentPool> future =
             storageTransferServiceClient.updateAgentPoolCallable().futureCall(request);
         // Do something.
         TransferTypes.AgentPool response = future.get();
       }
       
    • getAgentPool

      public final TransferTypes.AgentPool getAgentPool(String name)
      Gets an agent pool.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         String name = "name3373707";
         TransferTypes.AgentPool response = storageTransferServiceClient.getAgentPool(name);
       }
       
      Parameters:
      name - Required. The name of the agent pool to get.
      Throws:
      ApiException - if the remote call fails
    • getAgentPool

      public final TransferTypes.AgentPool getAgentPool(TransferProto.GetAgentPoolRequest request)
      Gets an agent pool.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.GetAgentPoolRequest request =
             TransferProto.GetAgentPoolRequest.newBuilder().setName("name3373707").build();
         TransferTypes.AgentPool response = storageTransferServiceClient.getAgentPool(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getAgentPoolCallable

      Gets an agent pool.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.GetAgentPoolRequest request =
             TransferProto.GetAgentPoolRequest.newBuilder().setName("name3373707").build();
         ApiFuture<TransferTypes.AgentPool> future =
             storageTransferServiceClient.getAgentPoolCallable().futureCall(request);
         // Do something.
         TransferTypes.AgentPool response = future.get();
       }
       
    • listAgentPools

      public final StorageTransferServiceClient.ListAgentPoolsPagedResponse listAgentPools(String projectId)
      Lists agent pools.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         String projectId = "projectId-894832108";
         for (TransferTypes.AgentPool element :
             storageTransferServiceClient.listAgentPools(projectId).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      projectId - Required. The ID of the Google Cloud project that owns the job.
      Throws:
      ApiException - if the remote call fails
    • listAgentPools

      Lists agent pools.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.ListAgentPoolsRequest request =
             TransferProto.ListAgentPoolsRequest.newBuilder()
                 .setProjectId("projectId-894832108")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (TransferTypes.AgentPool element :
             storageTransferServiceClient.listAgentPools(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
    • listAgentPoolsPagedCallable

      Lists agent pools.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.ListAgentPoolsRequest request =
             TransferProto.ListAgentPoolsRequest.newBuilder()
                 .setProjectId("projectId-894832108")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<TransferTypes.AgentPool> future =
             storageTransferServiceClient.listAgentPoolsPagedCallable().futureCall(request);
         // Do something.
         for (TransferTypes.AgentPool element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listAgentPoolsCallable

      Lists agent pools.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.ListAgentPoolsRequest request =
             TransferProto.ListAgentPoolsRequest.newBuilder()
                 .setProjectId("projectId-894832108")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           TransferProto.ListAgentPoolsResponse response =
               storageTransferServiceClient.listAgentPoolsCallable().call(request);
           for (TransferTypes.AgentPool element : response.getAgentPoolsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • deleteAgentPool

      public final void deleteAgentPool(String name)
      Deletes an agent pool.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         String name = "name3373707";
         storageTransferServiceClient.deleteAgentPool(name);
       }
       
      Parameters:
      name - Required. The name of the agent pool to delete.
      Throws:
      ApiException - if the remote call fails
    • deleteAgentPool

      public final void deleteAgentPool(TransferProto.DeleteAgentPoolRequest request)
      Deletes an agent pool.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.DeleteAgentPoolRequest request =
             TransferProto.DeleteAgentPoolRequest.newBuilder().setName("name3373707").build();
         storageTransferServiceClient.deleteAgentPool(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteAgentPoolCallable

      public final UnaryCallable<TransferProto.DeleteAgentPoolRequest,com.google.protobuf.Empty> deleteAgentPoolCallable()
      Deletes an agent pool.

      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 (StorageTransferServiceClient storageTransferServiceClient =
           StorageTransferServiceClient.create()) {
         TransferProto.DeleteAgentPoolRequest request =
             TransferProto.DeleteAgentPoolRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Empty> future =
             storageTransferServiceClient.deleteAgentPoolCallable().futureCall(request);
         // Do something.
         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