Class DataTransferServiceClient

  • All Implemented Interfaces:
    com.google.api.gax.core.BackgroundResource, AutoCloseable

    @Generated("by gapic-generator-java")
    public class DataTransferServiceClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: This API allows users to manage their data transfers into BigQuery.

    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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
       DataSourceName name =
           DataSourceName.ofProjectLocationDataSourceName(
               "[PROJECT]", "[LOCATION]", "[DATA_SOURCE]");
       DataSource response = dataTransferServiceClient.getDataSource(name);
     }
     

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

    The surface of this class includes several types of Java methods for each of the API's methods:

    1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
    2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
    3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

    See the individual methods for example code.

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

    This class can be customized by passing in a custom instance of DataTransferServiceSettings 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
     DataTransferServiceSettings dataTransferServiceSettings =
         DataTransferServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     DataTransferServiceClient dataTransferServiceClient =
         DataTransferServiceClient.create(dataTransferServiceSettings);
     

    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
     DataTransferServiceSettings dataTransferServiceSettings =
         DataTransferServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     DataTransferServiceClient dataTransferServiceClient =
         DataTransferServiceClient.create(dataTransferServiceSettings);
     

    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
     DataTransferServiceSettings dataTransferServiceSettings =
         DataTransferServiceSettings.newHttpJsonBuilder().build();
     DataTransferServiceClient dataTransferServiceClient =
         DataTransferServiceClient.create(dataTransferServiceSettings);
     

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

    • Constructor Detail

      • DataTransferServiceClient

        protected DataTransferServiceClient​(DataTransferServiceSettings settings)
                                     throws IOException
        Constructs an instance of DataTransferServiceClient, 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
    • Method Detail

      • create

        public static final DataTransferServiceClient create​(DataTransferServiceStub stub)
        Constructs an instance of DataTransferServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataTransferServiceSettings).
      • getDataSource

        public final DataSource getDataSource​(DataSourceName name)
        Retrieves a supported data source and returns its settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           DataSourceName name =
               DataSourceName.ofProjectLocationDataSourceName(
                   "[PROJECT]", "[LOCATION]", "[DATA_SOURCE]");
           DataSource response = dataTransferServiceClient.getDataSource(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/dataSources/{data_source_id}` or `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getDataSource

        public final DataSource getDataSource​(String name)
        Retrieves a supported data source and returns its settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String name = DataSourceName.ofProjectDataSourceName("[PROJECT]", "[DATA_SOURCE]").toString();
           DataSource response = dataTransferServiceClient.getDataSource(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/dataSources/{data_source_id}` or `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getDataSource

        public final DataSource getDataSource​(GetDataSourceRequest request)
        Retrieves a supported data source and returns its settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           GetDataSourceRequest request =
               GetDataSourceRequest.newBuilder()
                   .setName(
                       DataSourceName.ofProjectLocationDataSourceName(
                               "[PROJECT]", "[LOCATION]", "[DATA_SOURCE]")
                           .toString())
                   .build();
           DataSource response = dataTransferServiceClient.getDataSource(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getDataSourceCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetDataSourceRequest,​DataSource> getDataSourceCallable()
        Retrieves a supported data source and returns its settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           GetDataSourceRequest request =
               GetDataSourceRequest.newBuilder()
                   .setName(
                       DataSourceName.ofProjectLocationDataSourceName(
                               "[PROJECT]", "[LOCATION]", "[DATA_SOURCE]")
                           .toString())
                   .build();
           ApiFuture<DataSource> future =
               dataTransferServiceClient.getDataSourceCallable().futureCall(request);
           // Do something.
           DataSource response = future.get();
         }
         
      • listDataSources

        public final DataTransferServiceClient.ListDataSourcesPagedResponse listDataSources​(LocationName parent)
        Lists supported data sources and returns their settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           for (DataSource element : dataTransferServiceClient.listDataSources(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The BigQuery project id for which data sources should be returned. Must be in the form: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listDataSources

        public final DataTransferServiceClient.ListDataSourcesPagedResponse listDataSources​(ProjectName parent)
        Lists supported data sources and returns their settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ProjectName parent = ProjectName.of("[PROJECT]");
           for (DataSource element : dataTransferServiceClient.listDataSources(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The BigQuery project id for which data sources should be returned. Must be in the form: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listDataSources

        public final DataTransferServiceClient.ListDataSourcesPagedResponse listDataSources​(String parent)
        Lists supported data sources and returns their settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String parent = ProjectName.of("[PROJECT]").toString();
           for (DataSource element : dataTransferServiceClient.listDataSources(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The BigQuery project id for which data sources should be returned. Must be in the form: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listDataSources

        public final DataTransferServiceClient.ListDataSourcesPagedResponse listDataSources​(ListDataSourcesRequest request)
        Lists supported data sources and returns their settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListDataSourcesRequest request =
               ListDataSourcesRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           for (DataSource element : dataTransferServiceClient.listDataSources(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listDataSourcesPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListDataSourcesRequest,​DataTransferServiceClient.ListDataSourcesPagedResponse> listDataSourcesPagedCallable()
        Lists supported data sources and returns their settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListDataSourcesRequest request =
               ListDataSourcesRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           ApiFuture<DataSource> future =
               dataTransferServiceClient.listDataSourcesPagedCallable().futureCall(request);
           // Do something.
           for (DataSource element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listDataSourcesCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListDataSourcesRequest,​ListDataSourcesResponse> listDataSourcesCallable()
        Lists supported data sources and returns their settings.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListDataSourcesRequest request =
               ListDataSourcesRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           while (true) {
             ListDataSourcesResponse response =
                 dataTransferServiceClient.listDataSourcesCallable().call(request);
             for (DataSource element : response.getDataSourcesList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • createTransferConfig

        public final TransferConfig createTransferConfig​(LocationName parent,
                                                         TransferConfig transferConfig)
        Creates a new data transfer configuration.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           TransferConfig transferConfig = TransferConfig.newBuilder().build();
           TransferConfig response =
               dataTransferServiceClient.createTransferConfig(parent, transferConfig);
         }
         
        Parameters:
        parent - Required. The BigQuery project id where the transfer configuration should be created. Must be in the format projects/{project_id}/locations/{location_id} or projects/{project_id}. If specified location and location of the destination bigquery dataset do not match - the request will fail.
        transferConfig - Required. Data transfer configuration to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTransferConfig

        public final TransferConfig createTransferConfig​(ProjectName parent,
                                                         TransferConfig transferConfig)
        Creates a new data transfer configuration.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ProjectName parent = ProjectName.of("[PROJECT]");
           TransferConfig transferConfig = TransferConfig.newBuilder().build();
           TransferConfig response =
               dataTransferServiceClient.createTransferConfig(parent, transferConfig);
         }
         
        Parameters:
        parent - Required. The BigQuery project id where the transfer configuration should be created. Must be in the format projects/{project_id}/locations/{location_id} or projects/{project_id}. If specified location and location of the destination bigquery dataset do not match - the request will fail.
        transferConfig - Required. Data transfer configuration to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTransferConfig

        public final TransferConfig createTransferConfig​(String parent,
                                                         TransferConfig transferConfig)
        Creates a new data transfer configuration.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String parent = ProjectName.of("[PROJECT]").toString();
           TransferConfig transferConfig = TransferConfig.newBuilder().build();
           TransferConfig response =
               dataTransferServiceClient.createTransferConfig(parent, transferConfig);
         }
         
        Parameters:
        parent - Required. The BigQuery project id where the transfer configuration should be created. Must be in the format projects/{project_id}/locations/{location_id} or projects/{project_id}. If specified location and location of the destination bigquery dataset do not match - the request will fail.
        transferConfig - Required. Data transfer configuration to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTransferConfig

        public final TransferConfig createTransferConfig​(CreateTransferConfigRequest request)
        Creates a new data transfer configuration.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           CreateTransferConfigRequest request =
               CreateTransferConfigRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setTransferConfig(TransferConfig.newBuilder().build())
                   .setAuthorizationCode("authorizationCode742596102")
                   .setVersionInfo("versionInfo688769446")
                   .setServiceAccountName("serviceAccountName2137368675")
                   .build();
           TransferConfig response = dataTransferServiceClient.createTransferConfig(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createTransferConfigCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateTransferConfigRequest,​TransferConfig> createTransferConfigCallable()
        Creates a new data transfer configuration.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           CreateTransferConfigRequest request =
               CreateTransferConfigRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .setTransferConfig(TransferConfig.newBuilder().build())
                   .setAuthorizationCode("authorizationCode742596102")
                   .setVersionInfo("versionInfo688769446")
                   .setServiceAccountName("serviceAccountName2137368675")
                   .build();
           ApiFuture<TransferConfig> future =
               dataTransferServiceClient.createTransferConfigCallable().futureCall(request);
           // Do something.
           TransferConfig response = future.get();
         }
         
      • updateTransferConfig

        public final TransferConfig updateTransferConfig​(TransferConfig transferConfig,
                                                         com.google.protobuf.FieldMask updateMask)
        Updates a data transfer configuration. All fields must be set, even if they are not updated.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           TransferConfig transferConfig = TransferConfig.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           TransferConfig response =
               dataTransferServiceClient.updateTransferConfig(transferConfig, updateMask);
         }
         
        Parameters:
        transferConfig - Required. Data transfer configuration to create.
        updateMask - Required. Required list of fields to be updated in this request.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateTransferConfig

        public final TransferConfig updateTransferConfig​(UpdateTransferConfigRequest request)
        Updates a data transfer configuration. All fields must be set, even if they are not updated.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           UpdateTransferConfigRequest request =
               UpdateTransferConfigRequest.newBuilder()
                   .setTransferConfig(TransferConfig.newBuilder().build())
                   .setAuthorizationCode("authorizationCode742596102")
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setVersionInfo("versionInfo688769446")
                   .setServiceAccountName("serviceAccountName2137368675")
                   .build();
           TransferConfig response = dataTransferServiceClient.updateTransferConfig(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateTransferConfigCallable

        public final com.google.api.gax.rpc.UnaryCallable<UpdateTransferConfigRequest,​TransferConfig> updateTransferConfigCallable()
        Updates a data transfer configuration. All fields must be set, even if they are not updated.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           UpdateTransferConfigRequest request =
               UpdateTransferConfigRequest.newBuilder()
                   .setTransferConfig(TransferConfig.newBuilder().build())
                   .setAuthorizationCode("authorizationCode742596102")
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setVersionInfo("versionInfo688769446")
                   .setServiceAccountName("serviceAccountName2137368675")
                   .build();
           ApiFuture<TransferConfig> future =
               dataTransferServiceClient.updateTransferConfigCallable().futureCall(request);
           // Do something.
           TransferConfig response = future.get();
         }
         
      • deleteTransferConfig

        public final void deleteTransferConfig​(TransferConfigName name)
        Deletes a data transfer configuration, including any associated transfer runs and logs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           TransferConfigName name =
               TransferConfigName.ofProjectLocationTransferConfigName(
                   "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]");
           dataTransferServiceClient.deleteTransferConfig(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTransferConfig

        public final void deleteTransferConfig​(String name)
        Deletes a data transfer configuration, including any associated transfer runs and logs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String name =
               TransferConfigName.ofProjectTransferConfigName("[PROJECT]", "[TRANSFER_CONFIG]")
                   .toString();
           dataTransferServiceClient.deleteTransferConfig(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTransferConfig

        public final void deleteTransferConfig​(DeleteTransferConfigRequest request)
        Deletes a data transfer configuration, including any associated transfer runs and logs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           DeleteTransferConfigRequest request =
               DeleteTransferConfigRequest.newBuilder()
                   .setName(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .build();
           dataTransferServiceClient.deleteTransferConfig(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTransferConfigCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteTransferConfigRequest,​com.google.protobuf.Empty> deleteTransferConfigCallable()
        Deletes a data transfer configuration, including any associated transfer runs and logs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           DeleteTransferConfigRequest request =
               DeleteTransferConfigRequest.newBuilder()
                   .setName(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .build();
           ApiFuture<Empty> future =
               dataTransferServiceClient.deleteTransferConfigCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • getTransferConfig

        public final TransferConfig getTransferConfig​(TransferConfigName name)
        Returns information about a data transfer config.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           TransferConfigName name =
               TransferConfigName.ofProjectLocationTransferConfigName(
                   "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]");
           TransferConfig response = dataTransferServiceClient.getTransferConfig(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTransferConfig

        public final TransferConfig getTransferConfig​(String name)
        Returns information about a data transfer config.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String name =
               TransferConfigName.ofProjectTransferConfigName("[PROJECT]", "[TRANSFER_CONFIG]")
                   .toString();
           TransferConfig response = dataTransferServiceClient.getTransferConfig(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTransferConfig

        public final TransferConfig getTransferConfig​(GetTransferConfigRequest request)
        Returns information about a data transfer config.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           GetTransferConfigRequest request =
               GetTransferConfigRequest.newBuilder()
                   .setName(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .build();
           TransferConfig response = dataTransferServiceClient.getTransferConfig(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTransferConfigCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetTransferConfigRequest,​TransferConfig> getTransferConfigCallable()
        Returns information about a data transfer config.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           GetTransferConfigRequest request =
               GetTransferConfigRequest.newBuilder()
                   .setName(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .build();
           ApiFuture<TransferConfig> future =
               dataTransferServiceClient.getTransferConfigCallable().futureCall(request);
           // Do something.
           TransferConfig response = future.get();
         }
         
      • listTransferConfigs

        public final DataTransferServiceClient.ListTransferConfigsPagedResponse listTransferConfigs​(LocationName parent)
        Returns information about all transfer configs owned by a project in the specified 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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
           for (TransferConfig element :
               dataTransferServiceClient.listTransferConfigs(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The BigQuery project id for which transfer configs should be returned: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferConfigs

        public final DataTransferServiceClient.ListTransferConfigsPagedResponse listTransferConfigs​(ProjectName parent)
        Returns information about all transfer configs owned by a project in the specified 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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ProjectName parent = ProjectName.of("[PROJECT]");
           for (TransferConfig element :
               dataTransferServiceClient.listTransferConfigs(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The BigQuery project id for which transfer configs should be returned: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferConfigs

        public final DataTransferServiceClient.ListTransferConfigsPagedResponse listTransferConfigs​(String parent)
        Returns information about all transfer configs owned by a project in the specified 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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String parent = ProjectName.of("[PROJECT]").toString();
           for (TransferConfig element :
               dataTransferServiceClient.listTransferConfigs(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The BigQuery project id for which transfer configs should be returned: `projects/{project_id}` or `projects/{project_id}/locations/{location_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferConfigs

        public final DataTransferServiceClient.ListTransferConfigsPagedResponse listTransferConfigs​(ListTransferConfigsRequest request)
        Returns information about all transfer configs owned by a project in the specified 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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferConfigsRequest request =
               ListTransferConfigsRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .addAllDataSourceIds(new ArrayList<String>())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           for (TransferConfig element :
               dataTransferServiceClient.listTransferConfigs(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferConfigsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTransferConfigsRequest,​DataTransferServiceClient.ListTransferConfigsPagedResponse> listTransferConfigsPagedCallable()
        Returns information about all transfer configs owned by a project in the specified 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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferConfigsRequest request =
               ListTransferConfigsRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .addAllDataSourceIds(new ArrayList<String>())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           ApiFuture<TransferConfig> future =
               dataTransferServiceClient.listTransferConfigsPagedCallable().futureCall(request);
           // Do something.
           for (TransferConfig element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listTransferConfigsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTransferConfigsRequest,​ListTransferConfigsResponse> listTransferConfigsCallable()
        Returns information about all transfer configs owned by a project in the specified 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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferConfigsRequest request =
               ListTransferConfigsRequest.newBuilder()
                   .setParent(ProjectName.of("[PROJECT]").toString())
                   .addAllDataSourceIds(new ArrayList<String>())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           while (true) {
             ListTransferConfigsResponse response =
                 dataTransferServiceClient.listTransferConfigsCallable().call(request);
             for (TransferConfig element : response.getTransferConfigsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • scheduleTransferRuns

        @Deprecated
        public final ScheduleTransferRunsResponse scheduleTransferRuns​(TransferConfigName parent,
                                                                       com.google.protobuf.Timestamp startTime,
                                                                       com.google.protobuf.Timestamp endTime)
        Deprecated.
        This method is deprecated and will be removed in the next major version update.
        Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           TransferConfigName parent =
               TransferConfigName.ofProjectLocationTransferConfigName(
                   "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]");
           Timestamp startTime = Timestamp.newBuilder().build();
           Timestamp endTime = Timestamp.newBuilder().build();
           ScheduleTransferRunsResponse response =
               dataTransferServiceClient.scheduleTransferRuns(parent, startTime, endTime);
         }
         
        Parameters:
        parent - Required. Transfer configuration name in the form: `projects/{project_id}/transferConfigs/{config_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
        startTime - Required. Start time of the range of transfer runs. For example, `"2017-05-25T00:00:00+00:00"`.
        endTime - Required. End time of the range of transfer runs. For example, `"2017-05-30T00:00:00+00:00"`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • scheduleTransferRuns

        @Deprecated
        public final ScheduleTransferRunsResponse scheduleTransferRuns​(String parent,
                                                                       com.google.protobuf.Timestamp startTime,
                                                                       com.google.protobuf.Timestamp endTime)
        Deprecated.
        This method is deprecated and will be removed in the next major version update.
        Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String parent =
               TransferConfigName.ofProjectTransferConfigName("[PROJECT]", "[TRANSFER_CONFIG]")
                   .toString();
           Timestamp startTime = Timestamp.newBuilder().build();
           Timestamp endTime = Timestamp.newBuilder().build();
           ScheduleTransferRunsResponse response =
               dataTransferServiceClient.scheduleTransferRuns(parent, startTime, endTime);
         }
         
        Parameters:
        parent - Required. Transfer configuration name in the form: `projects/{project_id}/transferConfigs/{config_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
        startTime - Required. Start time of the range of transfer runs. For example, `"2017-05-25T00:00:00+00:00"`.
        endTime - Required. End time of the range of transfer runs. For example, `"2017-05-30T00:00:00+00:00"`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • scheduleTransferRuns

        @Deprecated
        public final ScheduleTransferRunsResponse scheduleTransferRuns​(ScheduleTransferRunsRequest request)
        Deprecated.
        This method is deprecated and will be removed in the next major version update.
        Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ScheduleTransferRunsRequest request =
               ScheduleTransferRunsRequest.newBuilder()
                   .setParent(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .setStartTime(Timestamp.newBuilder().build())
                   .setEndTime(Timestamp.newBuilder().build())
                   .build();
           ScheduleTransferRunsResponse response =
               dataTransferServiceClient.scheduleTransferRuns(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • scheduleTransferRunsCallable

        @Deprecated
        public final com.google.api.gax.rpc.UnaryCallable<ScheduleTransferRunsRequest,​ScheduleTransferRunsResponse> scheduleTransferRunsCallable()
        Deprecated.
        This method is deprecated and will be removed in the next major version update.
        Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ScheduleTransferRunsRequest request =
               ScheduleTransferRunsRequest.newBuilder()
                   .setParent(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .setStartTime(Timestamp.newBuilder().build())
                   .setEndTime(Timestamp.newBuilder().build())
                   .build();
           ApiFuture<ScheduleTransferRunsResponse> future =
               dataTransferServiceClient.scheduleTransferRunsCallable().futureCall(request);
           // Do something.
           ScheduleTransferRunsResponse response = future.get();
         }
         
      • startManualTransferRuns

        public final StartManualTransferRunsResponse startManualTransferRuns​(StartManualTransferRunsRequest request)
        Start manual transfer runs to be executed now with schedule_time equal to current time. The transfer runs can be created for a time range where the run_time is between start_time (inclusive) and end_time (exclusive), or for a specific run_time.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           StartManualTransferRunsRequest request =
               StartManualTransferRunsRequest.newBuilder()
                   .setParent(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .build();
           StartManualTransferRunsResponse response =
               dataTransferServiceClient.startManualTransferRuns(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • startManualTransferRunsCallable

        public final com.google.api.gax.rpc.UnaryCallable<StartManualTransferRunsRequest,​StartManualTransferRunsResponse> startManualTransferRunsCallable()
        Start manual transfer runs to be executed now with schedule_time equal to current time. The transfer runs can be created for a time range where the run_time is between start_time (inclusive) and end_time (exclusive), or for a specific run_time.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           StartManualTransferRunsRequest request =
               StartManualTransferRunsRequest.newBuilder()
                   .setParent(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .build();
           ApiFuture<StartManualTransferRunsResponse> future =
               dataTransferServiceClient.startManualTransferRunsCallable().futureCall(request);
           // Do something.
           StartManualTransferRunsResponse response = future.get();
         }
         
      • getTransferRun

        public final TransferRun getTransferRun​(RunName name)
        Returns information about the particular transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           RunName name =
               RunName.ofProjectLocationTransferConfigRunName(
                   "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]");
           TransferRun response = dataTransferServiceClient.getTransferRun(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTransferRun

        public final TransferRun getTransferRun​(String name)
        Returns information about the particular transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String name =
               RunName.ofProjectTransferConfigRunName("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]")
                   .toString();
           TransferRun response = dataTransferServiceClient.getTransferRun(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTransferRun

        public final TransferRun getTransferRun​(GetTransferRunRequest request)
        Returns information about the particular transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           GetTransferRunRequest request =
               GetTransferRunRequest.newBuilder()
                   .setName(
                       RunName.ofProjectLocationTransferConfigRunName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]")
                           .toString())
                   .build();
           TransferRun response = dataTransferServiceClient.getTransferRun(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getTransferRunCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetTransferRunRequest,​TransferRun> getTransferRunCallable()
        Returns information about the particular transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           GetTransferRunRequest request =
               GetTransferRunRequest.newBuilder()
                   .setName(
                       RunName.ofProjectLocationTransferConfigRunName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]")
                           .toString())
                   .build();
           ApiFuture<TransferRun> future =
               dataTransferServiceClient.getTransferRunCallable().futureCall(request);
           // Do something.
           TransferRun response = future.get();
         }
         
      • deleteTransferRun

        public final void deleteTransferRun​(RunName name)
        Deletes the specified transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           RunName name =
               RunName.ofProjectLocationTransferConfigRunName(
                   "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]");
           dataTransferServiceClient.deleteTransferRun(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTransferRun

        public final void deleteTransferRun​(String name)
        Deletes the specified transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String name =
               RunName.ofProjectTransferConfigRunName("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]")
                   .toString();
           dataTransferServiceClient.deleteTransferRun(name);
         }
         
        Parameters:
        name - Required. The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTransferRun

        public final void deleteTransferRun​(DeleteTransferRunRequest request)
        Deletes the specified transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           DeleteTransferRunRequest request =
               DeleteTransferRunRequest.newBuilder()
                   .setName(
                       RunName.ofProjectLocationTransferConfigRunName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]")
                           .toString())
                   .build();
           dataTransferServiceClient.deleteTransferRun(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteTransferRunCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteTransferRunRequest,​com.google.protobuf.Empty> deleteTransferRunCallable()
        Deletes the specified transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           DeleteTransferRunRequest request =
               DeleteTransferRunRequest.newBuilder()
                   .setName(
                       RunName.ofProjectLocationTransferConfigRunName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]")
                           .toString())
                   .build();
           ApiFuture<Empty> future =
               dataTransferServiceClient.deleteTransferRunCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • listTransferRuns

        public final DataTransferServiceClient.ListTransferRunsPagedResponse listTransferRuns​(TransferConfigName parent)
        Returns information about running and completed transfer runs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           TransferConfigName parent =
               TransferConfigName.ofProjectLocationTransferConfigName(
                   "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]");
           for (TransferRun element : dataTransferServiceClient.listTransferRuns(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: `projects/{project_id}/transferConfigs/{config_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferRuns

        public final DataTransferServiceClient.ListTransferRunsPagedResponse listTransferRuns​(String parent)
        Returns information about running and completed transfer runs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String parent =
               TransferConfigName.ofProjectTransferConfigName("[PROJECT]", "[TRANSFER_CONFIG]")
                   .toString();
           for (TransferRun element : dataTransferServiceClient.listTransferRuns(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: `projects/{project_id}/transferConfigs/{config_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferRuns

        public final DataTransferServiceClient.ListTransferRunsPagedResponse listTransferRuns​(ListTransferRunsRequest request)
        Returns information about running and completed transfer runs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferRunsRequest request =
               ListTransferRunsRequest.newBuilder()
                   .setParent(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .addAllStates(new ArrayList<TransferState>())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           for (TransferRun element : dataTransferServiceClient.listTransferRuns(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferRunsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTransferRunsRequest,​DataTransferServiceClient.ListTransferRunsPagedResponse> listTransferRunsPagedCallable()
        Returns information about running and completed transfer runs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferRunsRequest request =
               ListTransferRunsRequest.newBuilder()
                   .setParent(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .addAllStates(new ArrayList<TransferState>())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           ApiFuture<TransferRun> future =
               dataTransferServiceClient.listTransferRunsPagedCallable().futureCall(request);
           // Do something.
           for (TransferRun element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listTransferRunsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTransferRunsRequest,​ListTransferRunsResponse> listTransferRunsCallable()
        Returns information about running and completed transfer runs.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferRunsRequest request =
               ListTransferRunsRequest.newBuilder()
                   .setParent(
                       TransferConfigName.ofProjectLocationTransferConfigName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]")
                           .toString())
                   .addAllStates(new ArrayList<TransferState>())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .build();
           while (true) {
             ListTransferRunsResponse response =
                 dataTransferServiceClient.listTransferRunsCallable().call(request);
             for (TransferRun element : response.getTransferRunsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • listTransferLogs

        public final DataTransferServiceClient.ListTransferLogsPagedResponse listTransferLogs​(RunName parent)
        Returns log messages for the transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           RunName parent =
               RunName.ofProjectLocationTransferConfigRunName(
                   "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]");
           for (TransferMessage element :
               dataTransferServiceClient.listTransferLogs(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. Transfer run name in the form: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferLogs

        public final DataTransferServiceClient.ListTransferLogsPagedResponse listTransferLogs​(String parent)
        Returns log messages for the transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String parent =
               RunName.ofProjectTransferConfigRunName("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]")
                   .toString();
           for (TransferMessage element :
               dataTransferServiceClient.listTransferLogs(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. Transfer run name in the form: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferLogs

        public final DataTransferServiceClient.ListTransferLogsPagedResponse listTransferLogs​(ListTransferLogsRequest request)
        Returns log messages for the transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferLogsRequest request =
               ListTransferLogsRequest.newBuilder()
                   .setParent(
                       RunName.ofProjectLocationTransferConfigRunName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]")
                           .toString())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .addAllMessageTypes(new ArrayList<TransferMessage.MessageSeverity>())
                   .build();
           for (TransferMessage element :
               dataTransferServiceClient.listTransferLogs(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listTransferLogsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTransferLogsRequest,​DataTransferServiceClient.ListTransferLogsPagedResponse> listTransferLogsPagedCallable()
        Returns log messages for the transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferLogsRequest request =
               ListTransferLogsRequest.newBuilder()
                   .setParent(
                       RunName.ofProjectLocationTransferConfigRunName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]")
                           .toString())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .addAllMessageTypes(new ArrayList<TransferMessage.MessageSeverity>())
                   .build();
           ApiFuture<TransferMessage> future =
               dataTransferServiceClient.listTransferLogsPagedCallable().futureCall(request);
           // Do something.
           for (TransferMessage element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listTransferLogsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListTransferLogsRequest,​ListTransferLogsResponse> listTransferLogsCallable()
        Returns log messages for the transfer run.

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListTransferLogsRequest request =
               ListTransferLogsRequest.newBuilder()
                   .setParent(
                       RunName.ofProjectLocationTransferConfigRunName(
                               "[PROJECT]", "[LOCATION]", "[TRANSFER_CONFIG]", "[RUN]")
                           .toString())
                   .setPageToken("pageToken873572522")
                   .setPageSize(883849137)
                   .addAllMessageTypes(new ArrayList<TransferMessage.MessageSeverity>())
                   .build();
           while (true) {
             ListTransferLogsResponse response =
                 dataTransferServiceClient.listTransferLogsCallable().call(request);
             for (TransferMessage element : response.getTransferMessagesList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • checkValidCreds

        public final CheckValidCredsResponse checkValidCreds​(DataSourceName name)
        Returns true if valid credentials exist for the given data source and requesting user.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           DataSourceName name =
               DataSourceName.ofProjectLocationDataSourceName(
                   "[PROJECT]", "[LOCATION]", "[DATA_SOURCE]");
           CheckValidCredsResponse response = dataTransferServiceClient.checkValidCreds(name);
         }
         
        Parameters:
        name - Required. The data source in the form: `projects/{project_id}/dataSources/{data_source_id}` or `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • checkValidCreds

        public final CheckValidCredsResponse checkValidCreds​(String name)
        Returns true if valid credentials exist for the given data source and requesting user.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           String name = DataSourceName.ofProjectDataSourceName("[PROJECT]", "[DATA_SOURCE]").toString();
           CheckValidCredsResponse response = dataTransferServiceClient.checkValidCreds(name);
         }
         
        Parameters:
        name - Required. The data source in the form: `projects/{project_id}/dataSources/{data_source_id}` or `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • checkValidCreds

        public final CheckValidCredsResponse checkValidCreds​(CheckValidCredsRequest request)
        Returns true if valid credentials exist for the given data source and requesting user.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           CheckValidCredsRequest request =
               CheckValidCredsRequest.newBuilder()
                   .setName(
                       DataSourceName.ofProjectLocationDataSourceName(
                               "[PROJECT]", "[LOCATION]", "[DATA_SOURCE]")
                           .toString())
                   .build();
           CheckValidCredsResponse response = dataTransferServiceClient.checkValidCreds(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • checkValidCredsCallable

        public final com.google.api.gax.rpc.UnaryCallable<CheckValidCredsRequest,​CheckValidCredsResponse> checkValidCredsCallable()
        Returns true if valid credentials exist for the given data source and requesting user.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           CheckValidCredsRequest request =
               CheckValidCredsRequest.newBuilder()
                   .setName(
                       DataSourceName.ofProjectLocationDataSourceName(
                               "[PROJECT]", "[LOCATION]", "[DATA_SOURCE]")
                           .toString())
                   .build();
           ApiFuture<CheckValidCredsResponse> future =
               dataTransferServiceClient.checkValidCredsCallable().futureCall(request);
           // Do something.
           CheckValidCredsResponse response = future.get();
         }
         
      • enrollDataSources

        public final void enrollDataSources​(EnrollDataSourcesRequest request)
        Enroll data sources in a user project. This allows users to create transfer configurations for these data sources. They will also appear in the ListDataSources RPC and as such, will appear in the [BigQuery UI](https://console.cloud.google.com/bigquery), and the documents can be found in the public guide for [BigQuery Web UI](https://cloud.google.com/bigquery/bigquery-web-ui) and [Data Transfer Service](https://cloud.google.com/bigquery/docs/working-with-transfers).

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           EnrollDataSourcesRequest request =
               EnrollDataSourcesRequest.newBuilder()
                   .setName("name3373707")
                   .addAllDataSourceIds(new ArrayList<String>())
                   .build();
           dataTransferServiceClient.enrollDataSources(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • enrollDataSourcesCallable

        public final com.google.api.gax.rpc.UnaryCallable<EnrollDataSourcesRequest,​com.google.protobuf.Empty> enrollDataSourcesCallable()
        Enroll data sources in a user project. This allows users to create transfer configurations for these data sources. They will also appear in the ListDataSources RPC and as such, will appear in the [BigQuery UI](https://console.cloud.google.com/bigquery), and the documents can be found in the public guide for [BigQuery Web UI](https://cloud.google.com/bigquery/bigquery-web-ui) and [Data Transfer Service](https://cloud.google.com/bigquery/docs/working-with-transfers).

        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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           EnrollDataSourcesRequest request =
               EnrollDataSourcesRequest.newBuilder()
                   .setName("name3373707")
                   .addAllDataSourceIds(new ArrayList<String>())
                   .build();
           ApiFuture<Empty> future =
               dataTransferServiceClient.enrollDataSourcesCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • listLocations

        public final DataTransferServiceClient.ListLocationsPagedResponse listLocations​(com.google.cloud.location.ListLocationsRequest request)
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (Location element : dataTransferServiceClient.listLocations(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listLocationsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,​DataTransferServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<Location> future =
               dataTransferServiceClient.listLocationsPagedCallable().futureCall(request);
           // Do something.
           for (Location element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listLocationsCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,​com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListLocationsResponse response =
                 dataTransferServiceClient.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 com.google.cloud.location.Location getLocation​(com.google.cloud.location.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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
           Location response = dataTransferServiceClient.getLocation(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getLocationCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,​com.google.cloud.location.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 (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
           GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
           ApiFuture<Location> future =
               dataTransferServiceClient.getLocationCallable().futureCall(request);
           // Do something.
           Location response = future.get();
         }
         
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.google.api.gax.core.BackgroundResource
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface com.google.api.gax.core.BackgroundResource
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface com.google.api.gax.core.BackgroundResource
      • shutdownNow

        public void shutdownNow()
        Specified by:
        shutdownNow in interface com.google.api.gax.core.BackgroundResource