Class DatasetServiceClient (2.8.9)

public class DatasetServiceClient implements BackgroundResource

Service Description: The service that handles the CRUD of Vertex AI Dataset and its child resources.

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


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
   Dataset response = datasetServiceClient.getDataset(name);
 }
 

Note: close() needs to be called on the DatasetServiceClient 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 DatasetServiceSettings to create(). For example:

To customize credentials:


 DatasetServiceSettings datasetServiceSettings =
     DatasetServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings);
 

To customize the endpoint:


 DatasetServiceSettings datasetServiceSettings =
     DatasetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 DatasetServiceClient datasetServiceClient = DatasetServiceClient.create(datasetServiceSettings);
 

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

Inheritance

java.lang.Object > DatasetServiceClient

Implements

BackgroundResource

Static Methods

create()

public static final DatasetServiceClient create()

Constructs an instance of DatasetServiceClient with default settings.

Returns
TypeDescription
DatasetServiceClient
Exceptions
TypeDescription
IOException

create(DatasetServiceSettings settings)

public static final DatasetServiceClient create(DatasetServiceSettings settings)

Constructs an instance of DatasetServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsDatasetServiceSettings
Returns
TypeDescription
DatasetServiceClient
Exceptions
TypeDescription
IOException

create(DatasetServiceStub stub)

public static final DatasetServiceClient create(DatasetServiceStub stub)

Constructs an instance of DatasetServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DatasetServiceSettings).

Parameter
NameDescription
stubDatasetServiceStub
Returns
TypeDescription
DatasetServiceClient

Constructors

DatasetServiceClient(DatasetServiceSettings settings)

protected DatasetServiceClient(DatasetServiceSettings settings)

Constructs an instance of DatasetServiceClient, 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.

Parameter
NameDescription
settingsDatasetServiceSettings

DatasetServiceClient(DatasetServiceStub stub)

protected DatasetServiceClient(DatasetServiceStub stub)
Parameter
NameDescription
stubDatasetServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

createDatasetAsync(CreateDatasetRequest request)

public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(CreateDatasetRequest request)

Creates a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   CreateDatasetRequest request =
       CreateDatasetRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDataset(Dataset.newBuilder().build())
           .build();
   Dataset response = datasetServiceClient.createDatasetAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateDatasetRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Dataset,CreateDatasetOperationMetadata>

createDatasetAsync(LocationName parent, Dataset dataset)

public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(LocationName parent, Dataset dataset)

Creates a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Dataset dataset = Dataset.newBuilder().build();
   Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get();
 }
 
Parameters
NameDescription
parentLocationName

Required. The resource name of the Location to create the Dataset in. Format: projects/{project}/locations/{location}

datasetDataset

Required. The Dataset to create.

Returns
TypeDescription
OperationFuture<Dataset,CreateDatasetOperationMetadata>

createDatasetAsync(String parent, Dataset dataset)

public final OperationFuture<Dataset,CreateDatasetOperationMetadata> createDatasetAsync(String parent, Dataset dataset)

Creates a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Dataset dataset = Dataset.newBuilder().build();
   Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get();
 }
 
Parameters
NameDescription
parentString

Required. The resource name of the Location to create the Dataset in. Format: projects/{project}/locations/{location}

datasetDataset

Required. The Dataset to create.

Returns
TypeDescription
OperationFuture<Dataset,CreateDatasetOperationMetadata>

createDatasetCallable()

public final UnaryCallable<CreateDatasetRequest,Operation> createDatasetCallable()

Creates a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   CreateDatasetRequest request =
       CreateDatasetRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDataset(Dataset.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       datasetServiceClient.createDatasetCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<CreateDatasetRequest,Operation>

createDatasetOperationCallable()

public final OperationCallable<CreateDatasetRequest,Dataset,CreateDatasetOperationMetadata> createDatasetOperationCallable()

Creates a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   CreateDatasetRequest request =
       CreateDatasetRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDataset(Dataset.newBuilder().build())
           .build();
   OperationFuture<Dataset, CreateDatasetOperationMetadata> future =
       datasetServiceClient.createDatasetOperationCallable().futureCall(request);
   // Do something.
   Dataset response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<CreateDatasetRequest,Dataset,CreateDatasetOperationMetadata>

deleteDatasetAsync(DatasetName name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteDatasetAsync(DatasetName name)

Deletes a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
   datasetServiceClient.deleteDatasetAsync(name).get();
 }
 
Parameter
NameDescription
nameDatasetName

Required. The resource name of the Dataset to delete. Format: projects/{project}/locations/{location}/datasets/{dataset}

Returns
TypeDescription
OperationFuture<Empty,DeleteOperationMetadata>

deleteDatasetAsync(DeleteDatasetRequest request)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteDatasetAsync(DeleteDatasetRequest request)

Deletes a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DeleteDatasetRequest request =
       DeleteDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .build();
   datasetServiceClient.deleteDatasetAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteDatasetRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,DeleteOperationMetadata>

deleteDatasetAsync(String name)

public final OperationFuture<Empty,DeleteOperationMetadata> deleteDatasetAsync(String name)

Deletes a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
   datasetServiceClient.deleteDatasetAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The resource name of the Dataset to delete. Format: projects/{project}/locations/{location}/datasets/{dataset}

Returns
TypeDescription
OperationFuture<Empty,DeleteOperationMetadata>

deleteDatasetCallable()

public final UnaryCallable<DeleteDatasetRequest,Operation> deleteDatasetCallable()

Deletes a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DeleteDatasetRequest request =
       DeleteDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .build();
   ApiFuture<Operation> future =
       datasetServiceClient.deleteDatasetCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteDatasetRequest,Operation>

deleteDatasetOperationCallable()

public final OperationCallable<DeleteDatasetRequest,Empty,DeleteOperationMetadata> deleteDatasetOperationCallable()

Deletes a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DeleteDatasetRequest request =
       DeleteDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .build();
   OperationFuture<Empty, DeleteOperationMetadata> future =
       datasetServiceClient.deleteDatasetOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteDatasetRequest,Empty,DeleteOperationMetadata>

exportDataAsync(DatasetName name, ExportDataConfig exportConfig)

public final OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(DatasetName name, ExportDataConfig exportConfig)

Exports data from a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
   ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build();
   ExportDataResponse response = datasetServiceClient.exportDataAsync(name, exportConfig).get();
 }
 
Parameters
NameDescription
nameDatasetName

Required. The name of the Dataset resource. Format: projects/{project}/locations/{location}/datasets/{dataset}

exportConfigExportDataConfig

Required. The desired output location.

Returns
TypeDescription
OperationFuture<ExportDataResponse,ExportDataOperationMetadata>

exportDataAsync(ExportDataRequest request)

public final OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(ExportDataRequest request)

Exports data from a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ExportDataRequest request =
       ExportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .setExportConfig(ExportDataConfig.newBuilder().build())
           .build();
   ExportDataResponse response = datasetServiceClient.exportDataAsync(request).get();
 }
 
Parameter
NameDescription
requestExportDataRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<ExportDataResponse,ExportDataOperationMetadata>

exportDataAsync(String name, ExportDataConfig exportConfig)

public final OperationFuture<ExportDataResponse,ExportDataOperationMetadata> exportDataAsync(String name, ExportDataConfig exportConfig)

Exports data from a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
   ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build();
   ExportDataResponse response = datasetServiceClient.exportDataAsync(name, exportConfig).get();
 }
 
Parameters
NameDescription
nameString

Required. The name of the Dataset resource. Format: projects/{project}/locations/{location}/datasets/{dataset}

exportConfigExportDataConfig

Required. The desired output location.

Returns
TypeDescription
OperationFuture<ExportDataResponse,ExportDataOperationMetadata>

exportDataCallable()

public final UnaryCallable<ExportDataRequest,Operation> exportDataCallable()

Exports data from a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ExportDataRequest request =
       ExportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .setExportConfig(ExportDataConfig.newBuilder().build())
           .build();
   ApiFuture<Operation> future = datasetServiceClient.exportDataCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ExportDataRequest,Operation>

exportDataOperationCallable()

public final OperationCallable<ExportDataRequest,ExportDataResponse,ExportDataOperationMetadata> exportDataOperationCallable()

Exports data from a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ExportDataRequest request =
       ExportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .setExportConfig(ExportDataConfig.newBuilder().build())
           .build();
   OperationFuture<ExportDataResponse, ExportDataOperationMetadata> future =
       datasetServiceClient.exportDataOperationCallable().futureCall(request);
   // Do something.
   ExportDataResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<ExportDataRequest,ExportDataResponse,ExportDataOperationMetadata>

getAnnotationSpec(AnnotationSpecName name)

public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name)

Gets an AnnotationSpec.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   AnnotationSpecName name =
       AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]");
   AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name);
 }
 
Parameter
NameDescription
nameAnnotationSpecName

Required. The name of the AnnotationSpec resource. Format: projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}

Returns
TypeDescription
AnnotationSpec

getAnnotationSpec(GetAnnotationSpecRequest request)

public final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request)

Gets an AnnotationSpec.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   GetAnnotationSpecRequest request =
       GetAnnotationSpecRequest.newBuilder()
           .setName(
               AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
                   .toString())
           .setReadMask(FieldMask.newBuilder().build())
           .build();
   AnnotationSpec response = datasetServiceClient.getAnnotationSpec(request);
 }
 
Parameter
NameDescription
requestGetAnnotationSpecRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
AnnotationSpec

getAnnotationSpec(String name)

public final AnnotationSpec getAnnotationSpec(String name)

Gets an AnnotationSpec.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String name =
       AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
           .toString();
   AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the AnnotationSpec resource. Format: projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}

Returns
TypeDescription
AnnotationSpec

getAnnotationSpecCallable()

public final UnaryCallable<GetAnnotationSpecRequest,AnnotationSpec> getAnnotationSpecCallable()

Gets an AnnotationSpec.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   GetAnnotationSpecRequest request =
       GetAnnotationSpecRequest.newBuilder()
           .setName(
               AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]")
                   .toString())
           .setReadMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<AnnotationSpec> future =
       datasetServiceClient.getAnnotationSpecCallable().futureCall(request);
   // Do something.
   AnnotationSpec response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetAnnotationSpecRequest,AnnotationSpec>

getDataset(DatasetName name)

public final Dataset getDataset(DatasetName name)

Gets a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
   Dataset response = datasetServiceClient.getDataset(name);
 }
 
Parameter
NameDescription
nameDatasetName

Required. The name of the Dataset resource.

Returns
TypeDescription
Dataset

getDataset(GetDatasetRequest request)

public final Dataset getDataset(GetDatasetRequest request)

Gets a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   GetDatasetRequest request =
       GetDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .setReadMask(FieldMask.newBuilder().build())
           .build();
   Dataset response = datasetServiceClient.getDataset(request);
 }
 
Parameter
NameDescription
requestGetDatasetRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Dataset

getDataset(String name)

public final Dataset getDataset(String name)

Gets a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
   Dataset response = datasetServiceClient.getDataset(name);
 }
 
Parameter
NameDescription
nameString

Required. The name of the Dataset resource.

Returns
TypeDescription
Dataset

getDatasetCallable()

public final UnaryCallable<GetDatasetRequest,Dataset> getDatasetCallable()

Gets a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   GetDatasetRequest request =
       GetDatasetRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .setReadMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Dataset> future = datasetServiceClient.getDatasetCallable().futureCall(request);
   // Do something.
   Dataset response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetDatasetRequest,Dataset>

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getSettings()

public final DatasetServiceSettings getSettings()
Returns
TypeDescription
DatasetServiceSettings

getStub()

public DatasetServiceStub getStub()
Returns
TypeDescription
DatasetServiceStub

importDataAsync(DatasetName name, List<ImportDataConfig> importConfigs)

public final OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(DatasetName name, List<ImportDataConfig> importConfigs)

Imports data into a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
   List<ImportDataConfig> importConfigs = new ArrayList<>();
   ImportDataResponse response = datasetServiceClient.importDataAsync(name, importConfigs).get();
 }
 
Parameters
NameDescription
nameDatasetName

Required. The name of the Dataset resource. Format: projects/{project}/locations/{location}/datasets/{dataset}

importConfigsList<ImportDataConfig>

Required. The desired input locations. The contents of all input locations will be imported in one batch.

Returns
TypeDescription
OperationFuture<ImportDataResponse,ImportDataOperationMetadata>

importDataAsync(ImportDataRequest request)

public final OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(ImportDataRequest request)

Imports data into a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ImportDataRequest request =
       ImportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .addAllImportConfigs(new ArrayList<ImportDataConfig>())
           .build();
   ImportDataResponse response = datasetServiceClient.importDataAsync(request).get();
 }
 
Parameter
NameDescription
requestImportDataRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<ImportDataResponse,ImportDataOperationMetadata>

importDataAsync(String name, List<ImportDataConfig> importConfigs)

public final OperationFuture<ImportDataResponse,ImportDataOperationMetadata> importDataAsync(String name, List<ImportDataConfig> importConfigs)

Imports data into a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
   List<ImportDataConfig> importConfigs = new ArrayList<>();
   ImportDataResponse response = datasetServiceClient.importDataAsync(name, importConfigs).get();
 }
 
Parameters
NameDescription
nameString

Required. The name of the Dataset resource. Format: projects/{project}/locations/{location}/datasets/{dataset}

importConfigsList<ImportDataConfig>

Required. The desired input locations. The contents of all input locations will be imported in one batch.

Returns
TypeDescription
OperationFuture<ImportDataResponse,ImportDataOperationMetadata>

importDataCallable()

public final UnaryCallable<ImportDataRequest,Operation> importDataCallable()

Imports data into a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ImportDataRequest request =
       ImportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .addAllImportConfigs(new ArrayList<ImportDataConfig>())
           .build();
   ApiFuture<Operation> future = datasetServiceClient.importDataCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ImportDataRequest,Operation>

importDataOperationCallable()

public final OperationCallable<ImportDataRequest,ImportDataResponse,ImportDataOperationMetadata> importDataOperationCallable()

Imports data into a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ImportDataRequest request =
       ImportDataRequest.newBuilder()
           .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .addAllImportConfigs(new ArrayList<ImportDataConfig>())
           .build();
   OperationFuture<ImportDataResponse, ImportDataOperationMetadata> future =
       datasetServiceClient.importDataOperationCallable().futureCall(request);
   // Do something.
   ImportDataResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<ImportDataRequest,ImportDataResponse,ImportDataOperationMetadata>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listAnnotations(DataItemName parent)

public final DatasetServiceClient.ListAnnotationsPagedResponse listAnnotations(DataItemName parent)

Lists Annotations belongs to a dataitem

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]");
   for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentDataItemName

Required. The resource name of the DataItem to list Annotations from. Format: projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}

Returns
TypeDescription
DatasetServiceClient.ListAnnotationsPagedResponse

listAnnotations(ListAnnotationsRequest request)

public final DatasetServiceClient.ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest request)

Lists Annotations belongs to a dataitem

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListAnnotationsRequest request =
       ListAnnotationsRequest.newBuilder()
           .setParent(
               DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Annotation element : datasetServiceClient.listAnnotations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListAnnotationsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DatasetServiceClient.ListAnnotationsPagedResponse

listAnnotations(String parent)

public final DatasetServiceClient.ListAnnotationsPagedResponse listAnnotations(String parent)

Lists Annotations belongs to a dataitem

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String parent =
       DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString();
   for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The resource name of the DataItem to list Annotations from. Format: projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}

Returns
TypeDescription
DatasetServiceClient.ListAnnotationsPagedResponse

listAnnotationsCallable()

public final UnaryCallable<ListAnnotationsRequest,ListAnnotationsResponse> listAnnotationsCallable()

Lists Annotations belongs to a dataitem

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListAnnotationsRequest request =
       ListAnnotationsRequest.newBuilder()
           .setParent(
               DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListAnnotationsResponse response =
         datasetServiceClient.listAnnotationsCallable().call(request);
     for (Annotation element : response.getResponsesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListAnnotationsRequest,ListAnnotationsResponse>

listAnnotationsPagedCallable()

public final UnaryCallable<ListAnnotationsRequest,DatasetServiceClient.ListAnnotationsPagedResponse> listAnnotationsPagedCallable()

Lists Annotations belongs to a dataitem

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListAnnotationsRequest request =
       ListAnnotationsRequest.newBuilder()
           .setParent(
               DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Annotation> future =
       datasetServiceClient.listAnnotationsPagedCallable().futureCall(request);
   // Do something.
   for (Annotation element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListAnnotationsRequest,ListAnnotationsPagedResponse>

listDataItems(DatasetName parent)

public final DatasetServiceClient.ListDataItemsPagedResponse listDataItems(DatasetName parent)

Lists DataItems in a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
   for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentDatasetName

Required. The resource name of the Dataset to list DataItems from. Format: projects/{project}/locations/{location}/datasets/{dataset}

Returns
TypeDescription
DatasetServiceClient.ListDataItemsPagedResponse

listDataItems(ListDataItemsRequest request)

public final DatasetServiceClient.ListDataItemsPagedResponse listDataItems(ListDataItemsRequest request)

Lists DataItems in a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListDataItemsRequest request =
       ListDataItemsRequest.newBuilder()
           .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   for (DataItem element : datasetServiceClient.listDataItems(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListDataItemsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DatasetServiceClient.ListDataItemsPagedResponse

listDataItems(String parent)

public final DatasetServiceClient.ListDataItemsPagedResponse listDataItems(String parent)

Lists DataItems in a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString();
   for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The resource name of the Dataset to list DataItems from. Format: projects/{project}/locations/{location}/datasets/{dataset}

Returns
TypeDescription
DatasetServiceClient.ListDataItemsPagedResponse

listDataItemsCallable()

public final UnaryCallable<ListDataItemsRequest,ListDataItemsResponse> listDataItemsCallable()

Lists DataItems in a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListDataItemsRequest request =
       ListDataItemsRequest.newBuilder()
           .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListDataItemsResponse response = datasetServiceClient.listDataItemsCallable().call(request);
     for (DataItem element : response.getResponsesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDataItemsRequest,ListDataItemsResponse>

listDataItemsPagedCallable()

public final UnaryCallable<ListDataItemsRequest,DatasetServiceClient.ListDataItemsPagedResponse> listDataItemsPagedCallable()

Lists DataItems in a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListDataItemsRequest request =
       ListDataItemsRequest.newBuilder()
           .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<DataItem> future =
       datasetServiceClient.listDataItemsPagedCallable().futureCall(request);
   // Do something.
   for (DataItem element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDataItemsRequest,ListDataItemsPagedResponse>

listDatasets(ListDatasetsRequest request)

public final DatasetServiceClient.ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request)

Lists Datasets in a Location.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListDatasetsRequest request =
       ListDatasetsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   for (Dataset element : datasetServiceClient.listDatasets(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListDatasetsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
DatasetServiceClient.ListDatasetsPagedResponse

listDatasets(LocationName parent)

public final DatasetServiceClient.ListDatasetsPagedResponse listDatasets(LocationName parent)

Lists Datasets in a Location.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. The name of the Dataset's parent resource. Format: projects/{project}/locations/{location}

Returns
TypeDescription
DatasetServiceClient.ListDatasetsPagedResponse

listDatasets(String parent)

public final DatasetServiceClient.ListDatasetsPagedResponse listDatasets(String parent)

Lists Datasets in a Location.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. The name of the Dataset's parent resource. Format: projects/{project}/locations/{location}

Returns
TypeDescription
DatasetServiceClient.ListDatasetsPagedResponse

listDatasetsCallable()

public final UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> listDatasetsCallable()

Lists Datasets in a Location.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListDatasetsRequest request =
       ListDatasetsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListDatasetsResponse response = datasetServiceClient.listDatasetsCallable().call(request);
     for (Dataset element : response.getResponsesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDatasetsRequest,ListDatasetsResponse>

listDatasetsPagedCallable()

public final UnaryCallable<ListDatasetsRequest,DatasetServiceClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()

Lists Datasets in a Location.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   ListDatasetsRequest request =
       ListDatasetsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setReadMask(FieldMask.newBuilder().build())
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<Dataset> future =
       datasetServiceClient.listDatasetsPagedCallable().futureCall(request);
   // Do something.
   for (Dataset element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListDatasetsRequest,ListDatasetsPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateDataset(Dataset dataset, FieldMask updateMask)

public final Dataset updateDataset(Dataset dataset, FieldMask updateMask)

Updates a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   Dataset dataset = Dataset.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Dataset response = datasetServiceClient.updateDataset(dataset, updateMask);
 }
 
Parameters
NameDescription
datasetDataset

Required. The Dataset which replaces the resource on the server.

updateMaskFieldMask

Required. The update mask applies to the resource. For the FieldMask definition, see google.protobuf.FieldMask. Updatable fields:

* display_name * description * labels

Returns
TypeDescription
Dataset

updateDataset(UpdateDatasetRequest request)

public final Dataset updateDataset(UpdateDatasetRequest request)

Updates a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   UpdateDatasetRequest request =
       UpdateDatasetRequest.newBuilder()
           .setDataset(Dataset.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Dataset response = datasetServiceClient.updateDataset(request);
 }
 
Parameter
NameDescription
requestUpdateDatasetRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Dataset

updateDatasetCallable()

public final UnaryCallable<UpdateDatasetRequest,Dataset> updateDatasetCallable()

Updates a Dataset.

Sample code:


 try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
   UpdateDatasetRequest request =
       UpdateDatasetRequest.newBuilder()
           .setDataset(Dataset.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Dataset> future = datasetServiceClient.updateDatasetCallable().futureCall(request);
   // Do something.
   Dataset response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateDatasetRequest,Dataset>